setup.py: execution
Date: January 24th 2016
Last updated: January 24th 2016
What are my options for compiling a python package?
Read on or read the docs here or here.
1) Create source distribution with sdist:
cd path/to/root/directory
python setup.py sdist
# windows
setup.py sdist
sdist creates a single archived file (tar.gz or zip depending on platform). The archived file is required to register a distribution with PyPI. At a local level this file produced from sdist can be used in two ways:
python setup.py build # usually for developer
python setup.py install # usually for the user
The build command compiles bytecode but doesn't install the module. This allows the developer to do more testing.
2) Create a built distribution with bdist:
python setup.py bdist
Running bdist without any additional arguments will create the default file type for your platform (e.g. on a unix system this would be: module-0.0.1.platform.tar.gz).
When this file is unpacked it gets installed as if python setup.py install as called. However, the file must be unpacked in the root of the filesystem or a python prefixed directory.
3) Create an executable installer for windows users:
python setup.py bdist_wininst
# produces: module-0.0.1.win32.exe