Metadata-Version: 2.4
Name: testcontainers-rustfs
Version: 1.0.0
Summary: Unofficial Testcontainers Python module for RustFS
Author: Bence Molnár
Author-email: Bence Molnár <developer@molnarbence.dev>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Dist: testcontainers>=4.15.0
Requires-Dist: boto3>=1.34 ; extra == 'boto3'
Requires-Python: >=3.14
Project-URL: Homepage, https://github.com/mb-dot-dev/testcontainers-rustfs
Project-URL: Repository, https://github.com/mb-dot-dev/testcontainers-rustfs
Project-URL: Issues, https://github.com/mb-dot-dev/testcontainers-rustfs/issues
Provides-Extra: boto3
Description-Content-Type: text/markdown

# testcontainers-rustfs

Unofficial [Testcontainers](https://testcontainers.com/) Python module for
[RustFS](https://github.com/rustfs/rustfs), an S3-compatible object store.

Not affiliated with or endorsed by the RustFS or Testcontainers projects.

## Install

Requires Python 3.14 or newer.

```bash
pip install 'testcontainers-rustfs[boto3]'
```

The `boto3` extra is optional. Without it the container still starts and
`get_config()` / `get_url()` work; only `get_client()` requires boto3.

## Usage

```python
from testcontainers_rustfs import RustfsContainer

with RustfsContainer() as rustfs:
    client = rustfs.get_client()
    client.create_bucket(Bucket="testbucket")
    client.put_object(Bucket="testbucket", Key="hello.txt", Body=b"Hello RustFS")

    stored = client.get_object(Bucket="testbucket", Key="hello.txt")["Body"].read()
```

Bucket names must be 3–63 characters — RustFS rejects shorter names with
`InvalidBucketName`.

### Bringing your own client

```python
with RustfsContainer() as rustfs:
    config = rustfs.get_config()
    # {'endpoint': 'localhost:32768', 'endpoint_url': 'http://localhost:32768',
    #  'access_key': 'rustfsadmin', 'secret_key': 'rustfsadmin', 'region_name': 'us-east-1'}
```

`endpoint` is the `host:port` form some SDKs expect; `endpoint_url` is the full
URL boto3 wants.

### Web console

Disabled by default. Enable it to inspect a failing test's data by eye:

```python
with RustfsContainer(console=True) as rustfs:
    print(rustfs.get_console_url())
```

`get_console_url()` raises `RuntimeError` if the console was not enabled.

## Configuration

| Parameter | Default | Description |
|---|---|---|
| `image` | `rustfs/rustfs:1.0.0-beta.12` | Docker image. Pinned deliberately — RustFS is pre-1.0 and `:latest` moves often |
| `port` | `9000` | Container port serving the S3 API |
| `access_key` | `rustfsadmin` | Access key for client connections |
| `secret_key` | `rustfsadmin` | Secret key for client connections |
| `console` | `False` | Enable and expose the web console (keyword-only) |
| `console_port` | `9001` | Container port serving the console (keyword-only) |
| `region_name` | `us-east-1` | Region reported to S3 clients (keyword-only) |

Any further keyword arguments are passed through to `DockerContainer`.

Credentials and region are always passed explicitly to the boto3 client, so your
`~/.aws/config` never influences test behaviour.

## Development

```bash
make install-dev
make test      # lint + unit
make coverage
```

Tests require a running Docker daemon.
