Convert pyproject.toml to setup.py
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyproject_to_setup-0.1.1.tar.gz.
File metadata
- Download URL: pyproject_to_setup-0.1.1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
389f70b615f77d8e1a39bed400c82ab17ccc8a80885f55d068dd9c42a4b8b9b0
|
|
| MD5 |
887eb324deb96912c238538f7a491b15
|
|
| BLAKE2b-256 |
e05d0af71b4d6f46369d15b524e68eb7d8208fe841ada8752d0248c64619da55
|
Provenance
The following attestation bundles were made for pyproject_to_setup-0.1.1.tar.gz:
Publisher:
publish-to-pypi.yml on Geson-anko/pyproject-to-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyproject_to_setup-0.1.1.tar.gz -
Subject digest:
389f70b615f77d8e1a39bed400c82ab17ccc8a80885f55d068dd9c42a4b8b9b0 - Sigstore transparency entry: 159802604
- Sigstore integration time:
-
Permalink:
Geson-anko/pyproject-to-setup@1ae82031f9a9f83a0eeec15ac6839dd2d4c01c20 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Geson-anko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1ae82031f9a9f83a0eeec15ac6839dd2d4c01c20 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyproject_to_setup-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pyproject_to_setup-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02b9be7efac3670de1538bc5f588123b4841ab5fe597fd075b526e8d60721baa
|
|
| MD5 |
889a5a65a6954d61e9506650c1029a97
|
|
| BLAKE2b-256 |
2544aefbd727475c0ebaf913c2558ce6805dd6ce23b529d591e335b380969e9d
|
Provenance
The following attestation bundles were made for pyproject_to_setup-0.1.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Geson-anko/pyproject-to-setup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyproject_to_setup-0.1.1-py3-none-any.whl -
Subject digest:
02b9be7efac3670de1538bc5f588123b4841ab5fe597fd075b526e8d60721baa - Sigstore transparency entry: 159802605
- Sigstore integration time:
-
Permalink:
Geson-anko/pyproject-to-setup@1ae82031f9a9f83a0eeec15ac6839dd2d4c01c20 -
Branch / Tag:
refs/tags/0.1.1 - Owner: https://github.com/Geson-anko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@1ae82031f9a9f83a0eeec15ac6839dd2d4c01c20 -
Trigger Event:
push
-
Statement type: