Skip to main content

Create a pyproject.toml file from setuptools configuration

Project description

setuptools-pyproject-migration

PyPI PyPI versions tests documentation Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public. Ruff Code style: Black skeleton

Introduction

pyproject.toml represents the new era of Python packaging, but many old projects are still using setuptools. That's where this package comes in: just install it, run it, and it will print out a nicely formatted pyproject.toml file with the same metadata that you had in setup.py or setup.cfg.

Or at least, that's the goal. The project is currently a work in progress with only partial support for all the attributes that might exist in a setuptools configuration, so this won't yet work for anything complex. Feel free to file an issue to highlight anything that needs to be added!

Installation and usage

There are two different ways to install this project. You can use either or both depending on what you prefer.

Standalone application

To install setuptools-pyproject-migration as an application, we recommend using pipx (though of course you can also do this with pip install --user or in a virtual environment of your choice). First make sure you have pipx installed, then run

pipx install setuptools-pyproject-migration

After that, in any directory that has a setup.py and/or setup.cfg file, you can run

setuptools-pyproject-migration

and it will print out the content of pyproject.toml as computed from your setup.py and/or setup.cfg. Running setuptools-pyproject-migration -h will print a brief usage summary.

You can also install and run the application in one go as follows:

pipx run setuptools-pyproject-migration

Virtual environment

Or you can use setuptools-pyproject-migration in a virtual environment you use to develop your project. Activate your virtual environment and then run

python -m pip install `setuptools-pyproject-migration

and then running

python setup.py pyproject

will print out the content of your pyproject.toml file.

History

Inspired by a conversation on Mastodon.

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

setuptools-pyproject-migration-0.2.0.tar.gz (52.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file setuptools-pyproject-migration-0.2.0.tar.gz.

File metadata

File hashes

Hashes for setuptools-pyproject-migration-0.2.0.tar.gz
Algorithm Hash digest
SHA256 de31aaac86354ff889e94d0d1cb57940247c66a72f9c9c93b414b720981a17ef
MD5 33d08938f34ea6b96def878937f515a9
BLAKE2b-256 a3bf9b6c6318387d406bdc4a914c0977204025703ce7d136a1acb74b7b207f21

See more details on using hashes here.

File details

Details for the file setuptools_pyproject_migration-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_pyproject_migration-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5bb9164e59ab174cc8dece526d48953c4e4b1fc28830c51618a1bab1e2e0fafb
MD5 7ed2d59c5b53e38fc2b718723fd1c40b
BLAKE2b-256 f183f2faf2297707c87748e536a7cf92f00d584c826e6892141d11daa1b489bf

See more details on using hashes here.

Supported by

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