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.0.tar.gz (26.5 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.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file pyproject_to_setup-0.1.0.tar.gz.

File metadata

  • Download URL: pyproject_to_setup-0.1.0.tar.gz
  • Upload date:
  • Size: 26.5 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.0.tar.gz
Algorithm Hash digest
SHA256 647f97f06c59763bb12db5ae01630f11f9fc62bdd98a5f2a801c15c4c942dccb
MD5 99c1f88a1215a2b507947a9ff8ccf1ba
BLAKE2b-256 06593ae2afb8d7e6b83f8e47ba3e151f7a00f079d6fffffcfb66968d67c305ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyproject_to_setup-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pyproject_to_setup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b68e5d1c03580487d20200790615a0e344e2be28c99e7723825e7f5dfd4843e
MD5 d00745f433a849f0889097cbe76f2c91
BLAKE2b-256 e2c2d240199d11d897eedbb06b2b472d66572c2f51e7b2db0d345e810cd48c46

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyproject_to_setup-0.1.0-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