Skip to main content

A utility module to automate building setup configuration files.

Project description

setuputils3

A utility module to automate building setup configuration files. The latest official release is available on PyPI at https://pypi.org/project/setuputils3/ and the latest source code is available on Gitlab at https://gitlab.com/pdonis/setuputils3.

Running setuputils in the root of your source tree will build a setup.cfg file for you from inputs that you supply and from its ability to auto-discover the things that typically go into a distribution of your Python application or library. The main tool that uses setup.cfg, setuptools, also has much the same auto-discovery capability, but the advantage with setuputils is that you get to see all the output of the auto-discovery logic in the final setup.cfg file before using it to build your distribution. With setuptools, you have no way of getting an advance look at what the tool thinks should go into your distribution; you only see what is in the distribution after it is built.

Using setuputils in this mode is simple: for each section of setup.cfg, you put options that you want to specify in advance in the root of your source tree in files with an .in extension, one for each section that will end up in setup.cfg. For example, you would put metadata in the file metadata.in, options in the file options.in, etc. You would not include anything that you want setuputils to auto-discover, so, for example, if you want setuputils to auto-discover your packages, you would not include "packages" in your options.in file at all (whereas with setuptools you would include "packages = find:" in your setup.cfg).

Once you have created your .in files, then you simply execute

$ python3 -m setuputils

in the root of your source tree. This will build the setup.cfg file for you. You can then look at it to make sure it is correct before using a build backend to build your distribution.

With this mode, if you are using a PEP 517 compliant build backend, you do not need a setup.py script at all. (Setuptools qualifies as such a backend as long as you include a pyproject.toml file and specify setuptools in it, as described in the Python packaging documentation.) If you do have a setup.py script, all it would need to contain is an import of setuptools and call to setuptools.setup() with no arguments (since all of the information needed is in setup.cfg).

Note, however, that if you have a setup.py script that was used with previous versions of setuputils, you do not have to transition it to the new format using .in files all at once. Setuputils will read any global variables that are defined in your setup.py, as you would have done in previous setuputils versions, and include them in what it outputs to setup.cfg after processing them just as it would have in previous versions, so you can transition things incrementally if that works better for your project. (However, you should remove any calls to setup_vars in your setup.py script, leaving only the call to setuptools.setup() with no arguments, since all the information it needs will be in setup.cfg.)

See the module docstrings for more information.

SETUPUTILS3 is Copyright (C) 2012-2022 by Peter A. Donis. Released under the Python Software Foundation License.

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

setuputils3-2.0.3.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

setuputils3-2.0.3-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file setuputils3-2.0.3.tar.gz.

File metadata

  • Download URL: setuputils3-2.0.3.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.9

File hashes

Hashes for setuputils3-2.0.3.tar.gz
Algorithm Hash digest
SHA256 58e70b9a6427161d8a70c3022a09e19422fe487aaf9bce07c284ab50ea5a7c09
MD5 5586fd6a6238f7da900bf1f9c35b2305
BLAKE2b-256 d39d063cdce99f385afed6321ac2f347be6c3f2dbbd08928e2c0fde7a911201a

See more details on using hashes here.

File details

Details for the file setuputils3-2.0.3-py3-none-any.whl.

File metadata

  • Download URL: setuputils3-2.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.8.0 tqdm/4.19.5 CPython/3.6.9

File hashes

Hashes for setuputils3-2.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4bb9b8f4ebc4c7d5986138a3af943bb0b41206e9eb9c338f70c2338f60bf11be
MD5 85c15042bf1f73cc608ccc43ba8d57d3
BLAKE2b-256 c591b3e4713218df480a7d4eefc4f02ca6463e810e8f13db2d47b2e27e802f1e

See more details on using hashes here.

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