pyproject-to-setup
Convert pyproject.toml to setup.py based on PEP 621 specification.
Overview
A tool to help maintainers who need to support both modern Python packaging (pyproject.toml) and legacy packaging (setup.py) simultaneously. It provides flexible conversion modes and follows the PEP 621 specification.
Installation
pip install pyproject-to-setup
Quick Start
Basic usage:
# Convert pyproject.toml in current directory
pyproject-to-setup
# Show help
pyproject-to-setup --help
Example conversion:
# pyproject.toml
[project]
name = "spam-eggs"
version = "2020.0.0"
dependencies = ["httpx"]
requires-python = ">=3.8"
# Generated setup.py
import setuptools
setuptools.setup(
name="spam-eggs",
version="2020.0.0",
python_requires=">=3.8",
install_requires=["httpx"],
)
Features
- Convert between
pyproject.tomlandsetup.py - Multiple conversion modes (full, minimal, hybrid)
- Supports PEP 621 fields
- Command line interface and Python API
- Validation of input files
Development
Requirements:
- Python 3.12+
- Docker (optional)
- Make (optional)
Basic setup:
Using Docker
make docker-build
make docker-up
Without Docker
-
Install
uv: https://docs.astral.sh/uv/getting-started/installation/uv sync
CONTRIBUTING
For contribution guidelines, please see CONTRIBUTING.md.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for pyproject-to-setup 0.1.1
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 |
|---|---|---|---|---|
| pyproject_to_setup-0.1.1.tar.gz | 26.8 kB | With provenance | Details for pyproject_to_setup-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyproject_to_setup-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyproject_to_setup-0.1.1-py3-none-any.whl |
Total release size: 35.1 kB
Release files / pyproject_to_setup-0.1.1.tar.gz
| Download URL | pyproject_to_setup-0.1.1.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
389f70b615f77d8e1a39bed400c82ab17ccc8a80885f55d068dd9c42a4b8b9b0
|
|
BLAKE2b-256 checksum How to use checksums |
e05d0af71b4d6f46369d15b524e68eb7d8208fe841ada8752d0248c64619da55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 5, 2025.
Transparency logRelease files / pyproject_to_setup-0.1.1-py3-none-any.whl
| Download URL | pyproject_to_setup-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02b9be7efac3670de1538bc5f588123b4841ab5fe597fd075b526e8d60721baa
|
|
BLAKE2b-256 checksum How to use checksums |
2544aefbd727475c0ebaf913c2558ce6805dd6ce23b529d591e335b380969e9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 5, 2025.
Transparency logSecurity for pyproject-to-setup 0.1.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for pyproject_to_setup-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 5, 2025.
Transparency logA 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.