Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for jfaleiro.setup-utility, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size jfaleiro.setup_utility-0.0.1-py3-none-any.whl (16.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size jfaleiro.setup_utility-0.0.1.tar.gz (17.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page