sage-pypi-publisher
A tiny toolkit to compile Python packages to bytecode, build wheels, and publish to PyPI/TestPyPI. Extracted from SAGE's internal sage-dev tooling and made standalone.
Features
- Copy a package tree and compile
.py→.pyc(keeps__init__.pyand_version.py). - Auto-adjust
pyproject.toml/MANIFEST.into include compiled artifacts and binary extensions. - Build wheels with
python -m build. - Upload via
twine(with--dry-runby default). - Simple Typer-based CLI.
Installation
pip install .
# or
pip install sage-pypi-publisher
CLI
sage-pypi-publisher --help
# Compile only
sage-pypi-publisher compile /path/to/pkg -o /tmp/out
# Compile + build
sage-pypi-publisher build /path/to/pkg -o /tmp/out
# Compile + build + upload to TestPyPI
sage-pypi-publisher build /path/to/pkg -o /tmp/out -u -r testpypi --no-dry-run
# Upload an existing wheel
sage-pypi-publisher upload dist/yourpkg-0.1.0-py3-none-any.whl -r pypi --no-dry-run
Python API
from pathlib import Path
from pypi_publisher.compiler import BytecodeCompiler
compiler = BytecodeCompiler(Path("/path/to/pkg"))
compiled = compiler.compile_package()
wheel = compiler.build_wheel(compiled)
compiler.upload_wheel(wheel, repository="testpypi", dry_run=True)
Notes
- Requires
python -m buildandtwineavailable. - No backward compatibility with
sage-devCLI; PyPI commands have been removed from SAGE. - Designed to be monorepo-friendly but works with any package path that contains
pyproject.toml.
Metadata
Release files for sage-pypi-publisher 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sage_pypi_publisher-0.1.5.tar.gz | 16.6 kB | Without provenance | Details for sage_pypi_publisher-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sage_pypi_publisher-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for sage_pypi_publisher-0.1.5-py3-none-any.whl |
Total release size: 34.6 kB
Release files / sage_pypi_publisher-0.1.5.tar.gz
| Download URL | sage_pypi_publisher-0.1.5.tar.gz |
|---|---|
| Size | 16.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0591479dccff98c8df55589789c603103de706771a83e8010275d2b2f4e123af
|
|
BLAKE2b-256 checksum How to use checksums |
ab4ea776461b16589f744e1675b0d5427789bafac63bfb6b102720e0249d1d2d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Release files / sage_pypi_publisher-0.1.5-py3-none-any.whl
| Download URL | sage_pypi_publisher-0.1.5-py3-none-any.whl |
|---|---|
| Size | 18.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d029f910b211b28616cc3e073c48a0f7cb6b669ba325a025ce8ebe7c19fa40bc
|
|
BLAKE2b-256 checksum How to use checksums |
e3fba7cb7b54ff2e76cc3c2334538adaf05c61dc90fd6ef7bd3e1866b81628bb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.12
|
Security for sage-pypi-publisher 0.1.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.