Skip to main content

SetupHelper: Automating Boilerplate in Python Setup Scripts

This Python module will make your setup scripts simpler to write, by automating as much as possible of the ‘boilerplate’ that normally goes into them. Instead of invoking the setup function with a long list of keyword arguments, you just set global variables in your setup script and then invoke the setup_main function, passing globals() as its argument. (The SetupHelper setup.py script itself illustrates this usage.)

The helper module does all the grunt work of translating your variables into keyword arguments, including automatically deducing and generating many arguments so that you only have to specify a much simpler set of data. As a bonus, if you are using Python’s standard distutils, SetupHelper provides (very basic!) support for the requires keyword, downloading and installing required packages for you, as long as their download URLs are available on PyPI. (Note that the distutils in Python 2.5 and later allow the requires keyword in distribution metadata, but do not actually use it to install anything for you. Of course some distutils replacements like setuptools do provide this functionality; if you are using setuptools, you can set the variable __distutils_pkg__ to ‘setuptools’ and SetupHelper will use setuptools’ support instead of its own.)

Since SetupHelper has all the information needed to determine what should be in your source or binary distribution files, it auto-generates MANIFEST.in each time it runs, so you don’t have to maintain your MANIFEST.in file manually (and if you did, it would get overwritten anyway). Even though it is not strictly necessary to write MANIFEST.in unless you are running a distribution command, SetupHelper does it every time because checking its output can often help you debug problems with the variable definitions in your setup script. (At least, it has certainly helped me to do that!)

As one other bonus, SetupHelper allows you to automate the running of post-install scripts; just set the __post_install__ variable in your setup.py to a list of script names to be run from a subshell (this is done using os.system, so it has the limitations of that Python command). It is desirable to allow post-install scripts to be run from setup.py so that SetupHelper can ensure that any required packages are fully installed by just calling python setup.py install on them once they are unpacked.

Installation

Of course, to install SetupHelper, you can simply type:

$ python setup.py install

in the directory where you unpacked the SetupHelper archive. However, since SetupHelper is used by setup scripts, you will probably want to include it along with your setup.py in the source archives for your Python projects.

Metadata

Release files for setuphelper 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for setuphelper 0.2
File Size Uploaded Provenance Actions
setuphelper-0.2.tar.gz 15.3 kB Without provenance Details for setuphelper-0.2.tar.gz

Release files / setuphelper-0.2.tar.gz

Download URL setuphelper-0.2.tar.gz
Size 15.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b4cdd1fa8ffe0ca4a81b90f309ff1f10ad38f445a660a073a4c49272f33718e
BLAKE2b-256 checksum
How to use checksums
21405949f8778fd1dfc675898308adf084f7db18ad03b503eaedf506e1a19160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for setuphelper 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page