cclauss / setuptools-py2cfg

Script for converting setup.py to setup.cfg

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setuptools-py2cfg

Latest version released on PyPi Build status BSD 3-Clause

Since version 30.3.0, setuptools supports declarative configuration through the setup.cfg file. This script helps convert existing setup.py files to setup.cfg in the format expected by setuptools.

Usage

Just point setuptools-py2cfg to a setup.py file or run it in a directory containing a setup.py. For example, given the following setup.py:

Running setuptools-py2cfg.py would print:

There are several non-essential options that control the format of the generated ini-file:

usage: setuptools-py2cfg.py [-h] [-t int] [-i int] [-a] [path]

converts an existing setup.py file to a setup.cfg in the format expected by
setuptools

positional arguments:
  path                  path to setup.py file (default: ./setup.py)

optional arguments:
  -h, --help            show this help message and exit
  -t int, --dangling-list-threshold int
                        lists longer than this many characters are converted
                        to a dangling list (default: 40)
  -i int, --dangling-list-indent int
                        number of spaces to use when indenting dangling lists
                        (default: 4)
  -a, --always-use-dangling-lists
                        use dangling lists everywhere (default: False)

Keep in mind that a setup.py file with a single call to setuptools.setup() is still needed after migrating all metadata to setup.cfg.

Installation

The latest stable version of setuptools-py2cfg can be installed from pypi:

Todo

  • Handle entry_scripts in ini-format.
  • Write a test or two.

License

Released under the terms of the Revised BSD License.

About

Script for converting setup.py to setup.cfg

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Python 100.0%