Skip to main content

Convert pyproject.toml to setup.py

Project description

pyproject-to-setup

Python Version License

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.toml and setup.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

  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyproject_to_setup-0.1.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyproject_to_setup-0.1.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

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

Hashes for pyproject_to_setup-0.1.1.tar.gz
Algorithm Hash digest
SHA256 389f70b615f77d8e1a39bed400c82ab17ccc8a80885f55d068dd9c42a4b8b9b0
MD5 887eb324deb96912c238538f7a491b15
BLAKE2b-256 e05d0af71b4d6f46369d15b524e68eb7d8208fe841ada8752d0248c64619da55

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyproject_to_setup-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pyproject_to_setup-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02b9be7efac3670de1538bc5f588123b4841ab5fe597fd075b526e8d60721baa
MD5 889a5a65a6954d61e9506650c1029a97
BLAKE2b-256 2544aefbd727475c0ebaf913c2558ce6805dd6ce23b529d591e335b380969e9d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page