Skip to main content

A helper module for setup.py scripts.

Project description

SetupHelper: Automating the 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.)

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.

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

setuphelper-0.1.tar.gz (12.8 kB view details)

Uploaded Source

File details

Details for the file setuphelper-0.1.tar.gz.

File metadata

  • Download URL: setuphelper-0.1.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for setuphelper-0.1.tar.gz
Algorithm Hash digest
SHA256 d0d63eebe32d03636c8b9105a06a9a58ed0564d5c2d1d65ed61e43fa1c89339d
MD5 aaaa4c656f03d071a1c799c2c91ba32d
BLAKE2b-256 a424f9adff2939f8020ed1712ec7ef9101fc97ba90ca64d29f32d2197e72c5cf

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