Skip to main content

Create a pyproject.toml file from setuptools configuration

Project description

# setuptools-pyproject-migration

<!– markdownlint-disable MD013 –> [![PyPI](https://img.shields.io/pypi/v/setuptools-pyproject-migration.svg)](https://pypi-hypernode.com/project/setuptools-pyproject-migration) ![PyPI versions](https://img.shields.io/pypi/pyversions/setuptools-pyproject-migration.svg) [![tests](https://github.com/diazona/setuptools-pyproject-migration/workflows/tests/badge.svg)](https://github.com/diazona/setuptools-pyproject-migration/actions?query=workflow%3A%22tests%22) [![documentation](https://readthedocs.org/projects/setuptools-pyproject-migration/badge/?version=latest)](https://setuptools-pyproject-migration.readthedocs.io/en/latest/?badge=latest) [![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Code style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![skeleton](https://img.shields.io/badge/skeleton-2023-informational)](https://blog.jaraco.com/skeleton) <!– markdownlint-enable MD013 –>

## 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 setup-to-pyproject `

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

### 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).

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.1a0.tar.gz (45.5 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file setuptools-pyproject-migration-0.1a0.tar.gz.

File metadata

File hashes

Hashes for setuptools-pyproject-migration-0.1a0.tar.gz
Algorithm Hash digest
SHA256 80c1e6267b2e3c4d391f9c22e467e808a69bfd99a1baf93c82a3d3a6fcfac7b9
MD5 2224144c7f6e52b4c17052543353676f
BLAKE2b-256 c750c73ee0ffe05de321f30e2cd126968c1ee93864c81f38830f6502599680f5

See more details on using hashes here.

File details

Details for the file setuptools_pyproject_migration-0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for setuptools_pyproject_migration-0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd7f6f0d01e5a545eaeac75845222c197c1233f1382de024c82dd3a8164bf243
MD5 b64b57eeff3e11600dfd615242686c8f
BLAKE2b-256 04a511f459f7a417f85310f329d72ce3402e5ded66b691e7d7ed416bd74e512c

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