Skip to content

sebschrader/setuptools_configure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

setuptools_configure

setuptools_configure adds a configure step to setuptools-based projects, that allows you to define variables that can be substituted in the distribution metadata or any project file.

Every major build system like autotools, cmake or scons, includes facilities to configure builds.

Basic Usage

..code:: python

from setuptools_configure import setup

setup(name='my-project',

version='1.0', substitutions={

'': '',

}, )

Predefined Variables

setuptools_configure already predefines the following variables for you. You may overwrite these variables.

PACKAGE_NAME
The value given to the name keyword argument of the setup function.
PACKAGE_VERSION, PACKAGE_AUTHOR, PACKAGE_AUTHOR_EMAIL, PACKAGE_URL
Like PACKAGE_NAME.

Configuring Files

Exporting to Python

Most of the time, you want to be able to access the build configuration during the runtime of your code. You could write a template, e.g constants.py.in and declare it in configure_files. However, this is tedious and error-prone, as you have to

You can declare constants_module which contains all substitution variables and their values and which will be generated automatically by setuptools_configure during the configure step.

Dynamic Variables

Caching

Limitations

Most setuptools extensions can be used without importing them directly in the setup.py file.

Either they are just installed and their commands and keywords are available through pkg_resources entry point mechanism or they can be depended on explicitly with the setup_requires keyword argument of the setup function.

setuptools_configure however can not work this way, due to the implementation of distutils and setuptools.

A custom setup function is necessary, that is executed before setuptools does anything. This means that you have to have setuptools_configure installed before you can run setup.py.

Changelog

0.1.0 (2016-07-28)

  • Initial release

About

Add a configure step to setuptools projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages