https://github.com/diazona/setuptools-pyproject-migration
Generate a pyproject.toml file from setuptools
https://github.com/diazona/setuptools-pyproject-migration
pyproject-toml python setuptools
Last synced: 5 months ago
JSON representation
Generate a pyproject.toml file from setuptools
- Host: GitHub
- URL: https://github.com/diazona/setuptools-pyproject-migration
- Owner: diazona
- License: mit
- Created: 2023-06-27T05:19:43.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-12-01T20:55:28.000Z (7 months ago)
- Last Synced: 2025-12-04T10:52:16.917Z (7 months ago)
- Topics: pyproject-toml, python, setuptools
- Language: Python
- Homepage: https://setuptools-pyproject-migration.readthedocs.io/en/latest/
- Size: 532 KB
- Stars: 21
- Watchers: 2
- Forks: 3
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# setuptools-pyproject-migration
[](https://pypi.org/project/setuptools-pyproject-migration)

[](https://github.com/diazona/setuptools-pyproject-migration/actions?query=workflow%3A%22tests%22)
[](https://setuptools-pyproject-migration.readthedocs.io/en/latest/?badge=latest)
[](https://www.repostatus.org/#active)
[](https://github.com/astral-sh/ruff)
[](https://github.com/psf/black)
[](https://blog.jaraco.com/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](https://pypa.github.io/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
```console
pipx install setuptools-pyproject-migration
```
After that, in any directory that has a `setup.py` and/or `setup.cfg` file, you
can run
```console
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:
```console
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
```console
python -m pip install setuptools-pyproject-migration
```
and then running
```console
python setup.py pyproject
```
will print out the content of your `pyproject.toml` file.
## History
Inspired by [a conversation on Mastodon](https://mastodon.longlandclan.id.au/@stuartl/110518282805008552).