Shared helpers for setuptools configuration
Project description
setup_utility
Utility functions for setuptools utilities - my standard source checks, testing, cleanup, deployment, etc.
See LICENSE for important licensing information.
Installing
Your setup.py will need jfaleiro.setup_utility to start - so you either make sure you have it pre-installed using pip:
pip install jfaleiro.setup_utility
or add this on the very top of your setup.py and forget about it moving forward.
try:
import setup_utility
except ModuleNotFoundError as e:
from pip._internal import main
assert main('install jfaleiro.setup_utility'.split()) == 0
from setup_utility import (
BehaveTestCommand,
CleanCommand,
LicenseHeaderCommand,
version_from_git,
)
and
cmd_classes = {
'license_headers': LicenseHeaderCommand,
'behave_test': BehaveTestCommand,
'clean': CleanCommand,
}
Using
python setup.py --help-commands
You should have commands license_headers, clean, and behave_test listed. To know what you can configure try python setup.py <command> --help:
python setup.py license_headers --help
You can use command line parameters or add the same commands on setup.cfg:
[license_headers]
header-file = HEADER
[aliases]
test=pytest
[tool:pytest]
addopts = --cov=setup_utility --cov-report html
You can also produce your version number from standard git information (tag, branch name, and number of differences):
setup(
...
version=version_from_git(),
...
)
Release tags release/<version> with nnn differences from master will produce version <version>.dev<nnn> and a tagged version <tag> on master will produce the version <tag>. Everything else will produce master.dev<nnn> for master or no-version.dev<nnn> for any other branch.
Enjoy.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jfaleiro.setup_utility-0.0.1.tar.gz.
File metadata
- Download URL: jfaleiro.setup_utility-0.0.1.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c2a263274ea384b0280f015347bc26f12e000c86cf0d849ed4c5080acd968c
|
|
| MD5 |
642f8e751e68e4a2bb6b14f8abba621b
|
|
| BLAKE2b-256 |
662c82593035212eecdc7bf91ab22e4cfcf9156108f1610954dad3d5a503f3cf
|
File details
Details for the file jfaleiro.setup_utility-0.0.1-py3-none-any.whl.
File metadata
- Download URL: jfaleiro.setup_utility-0.0.1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
059afe7da8465a5c7f40935fd136dec1ed7905cbeb87edf074f79fed756aec37
|
|
| MD5 |
2120ef1e053a3de7b47972f96ba9cd24
|
|
| BLAKE2b-256 |
99670c0ccbf5ee823ac1f0e225380797507ff508c9cada042ef411d5951baa09
|