Registry / aws / s3pypi

s3pypi

JSON →
library2.0.1pypypi✓ verified 84d ago

s3pypi is a Python command-line interface and library for creating and managing a private Python Package Index hosted in an Amazon S3 bucket. It supports uploading packages (wheels and source distributions), generating `index.html` files, and integrating with `pip`. The current version is `2.0.1`. It maintains an active development pace with releases typically tied to feature enhancements or bug fixes.

pip install s3pypi
INSTALL
IMPORT
SIG · S3PYPI
S
s3pypi
awspythonv2.0.1
Install
7.4s avg
Import
—
Disk
53MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 54.7MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 7.4s · import 0.000s · 55MB
53MB installed
● package 53MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

S3PyPI
✓ import s3pypi
✗ from s3pypi import S3PyPI

This quickstart demonstrates programmatically deploying a dummy Python package to an S3-backed PyPI repository. It requires AWS credentials and an S3 bucket configured in your environment variables. `s3pypi` will automatically pick up credentials from standard AWS locations (environment, shared credentials file).

import os import shutil from pathlib import Path from s3pypi.main import S3PyPI # 1. Create a temporary directory and a dummy package file dist_dir = Path("dist_temp_s3pypi") dist_dir.mkdir(exist_ok=True) dummy_package_name = "my_dummy_package-1.0.0-py3-none-any.whl" dummy_package_path = dist_dir / dummy_package_name dummy_package_path.write_text("This is a dummy package file content.") print(f"Created dummy package file: {dummy_package_path}") # 2. Configure S3PyPI using environment variables for AWS credentials # Ensure AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION are set in your environment # and S3_PYPI_BUCKET points to your target S3 bucket. aws_region = os.environ.get('AWS_REGION', 'us-east-1') s3_bucket_name = os.environ.get('S3_PYPI_BUCKET', 'your-s3pypi-bucket-name') print(f"\nAttempting to deploy package to s3://{s3_bucket_name} in region {aws_region}...") try: s3 = S3PyPI( bucket=s3_bucket_name, region=aws_region, files=[str(dummy_package_path)] # Directly provide the path to the artifact ) s3.deploy() # Use .deploy() as .upload() was removed in v2.0.0 print(f"Successfully deployed {dummy_package_name} to s3://{s3_bucket_name}.") except Exception as e: print(f"Error deploying package: {e}") print("\nEnsure you have configured AWS credentials (e.g., via environment variables, ~/.aws/credentials) ") print(f"and that S3 bucket '{s3_bucket_name}' exists and you have write permissions (s3:PutObject, s3:GetObject, s3:ListBucket).") # 3. Clean up temporary files shutil.rmtree(dist_dir) print("Cleaned up temporary files.")
s3pypi --version
Debug
Known issues
breakingThe CLI subcommand `s3pypi upload` was renamed to `s3pypi deploy` in version 2.0.0.
fix
Update your shell scripts and automation to use `s3pypi deploy` instead of `s3pypi upload`.
affects: >=2.0.0
breakingThe programmatic API method `S3PyPI.upload()` was removed and replaced by `S3PyPI.deploy()` in version 2.0.0.
fix
Migrate your Python code to call `s3_instance.deploy()` instead of `s3_instance.upload()`.
affects: >=2.0.0
breakingThe CLI argument `--region` was renamed to `--bucket-region` in version 2.0.0 to clarify its scope to the S3 bucket's region.
fix
Adjust CLI commands to use `--bucket-region` when specifying the S3 bucket's AWS region.
affects: >=2.0.0
gotchaDeploying packages requires appropriate AWS S3 permissions (`s3:PutObject`, `s3:GetObject`, `s3:ListBucket`) on the target bucket for the IAM user or role `s3pypi` is using.
fix
Ensure the IAM policy attached to your AWS credentials includes these necessary S3 actions on the bucket. For cross-account access, also verify the bucket policy.
affects: All
Upgrade
Version history
2.0.1latest on PyPI · released Jan 14, 2024
Audit
Dependencies
boto3requiredRequired for interacting with AWS S3.
Agent activity
51 hits · last 30 days
node
50
Resources
s3pypi — pip install s3pypi · libregistry