Skip to main content

testcontainers-rustfs

Unofficial Testcontainers Python module for RustFS, an S3-compatible object store.

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

Install

Requires Python 3.14 or newer.

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

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

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:

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

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

Tests require a running Docker daemon.

Metadata

Release files for testcontainers-rustfs 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for testcontainers-rustfs 1.0.0
File Size Uploaded
testcontainers_rustfs-1.0.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for testcontainers-rustfs 1.0.0
File Interpreter ABI Platform
testcontainers_rustfs-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.9 kB

Release files / testcontainers_rustfs-1.0.0.tar.gz

Download URL testcontainers_rustfs-1.0.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
21c8fcba543d55faab0b4a3badb9f25e5e811869c819d07c9560bcc5bc774264
BLAKE2b-256 checksum
How to use checksums
9ae8fcf6fdf4bc7824897caea21b740112fe01894bd1b4914beb5485e8e82ae0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / testcontainers_rustfs-1.0.0-py3-none-any.whl

Download URL testcontainers_rustfs-1.0.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b131ad5e14c131165d68f6e07e44927768f2e99a99b22dce5aeb0dec432a1474
BLAKE2b-256 checksum
How to use checksums
ae243468783c1d3455993168bf4ca352fe3188dbf0843992f4bdc0b0618e1e13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

1.1.0

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page