Commands¶
The Global --python
Option¶
usage: setl [-h] [--python PYTHON] {build,clean,develop,publish,setup.py} ...
Named Arguments¶
--python | Target Python executable |
Setl is able to run “out of environment,” i.e. does not need to be installed
into the same environment that builds the package. The interpreter is instead
passed in by the --python
command. For example, the following command
builds the project against the command python2.7
:
sefl --python=python2.7 build
The --python
option accepts one of the followings:
- Absolute or relative path to a Python executable.
- Python command (
shutil.which
is used to resolve). - Python version specifier (the Python launcher is used to resolve).
Default Heuristic¶
Setl tries to do the right thing if no --python
value is explicitly given.
It looks for the following places, in this order:
- A non-empty environment variable
SETL_PYTHON
(interpreted with the same rules as--python
). - If Setl is run in an activated virtual environment context, use that
active environment’s interpreter. (Setl detects the
VIRTUAL_ENV
environment variable.) - If Setl is installed inside a virtual environment, use the interpreter it
is installed in (i.e.
sys.executable
).
If all of the above checks fail, Setl will require an explicit --python
value, or otherwise error out.
Note
The specified Python needs to have pip available.
Build Files¶
Build the package
usage: setl build [-h] [--info] [--ext] [--py] [--clib] [--scripts]
Named Arguments¶
--info | Build .egg-info directory |
--ext | Build extensions |
--py | Build pure Python modules |
--clib | Build C libraries |
--scripts | Build scripts |
Most of the flags have a direct setup.py build_*
counterpart. --info
corresponds to setup.py egg_info
.
If no flags are passed, Setl will run setup.py egg_info build
to go through
all the build steps.
Install for Development¶
Install package in ‘development mode’
usage: setl develop [-h]
Behaves very much like setup.py develop.
Build and Publish Distributions¶
Publish distributions to PyPI
usage: setl publish [-h] [--source] [--wheel] [--no-check]
[--no-upload | --repository NAME | --repository-url URL]
Named Arguments¶
--source | Publish the sdist |
--wheel | Publish the wheel |
--no-check | Do not check the distributions before upload |
--no-upload | Do no upload built distributions |
--repository | Repository declared in the config file to upload to |
--repository-url | |
Repository URL to upload to |
Builds distribution packages, and uploads them to a repository (package index). The default is to upload to PyPI. Use the repository flags to change. For example, this uploads the files to TestPyPI instead:
setl publish --repository-url https://test.pypi.org/legacy/
Repository options are passed directly to Twine.
Clean up Built Files¶
Clean up temporary files from build
usage: setl clean [-h]
Unlike setup.py clean
, this cleans up all the built files (except the
generated distributions). The in-tree .egg-info
files associated to the
package is also removed.