Skip to main content

Python Build Simplified. A simple setuptools automation, designed mainly for publishing multiple packages from single repository

Project description

Python Build Simplified

Lighter alternative to PBR. Created to support easily multiple namespace packages built from single repository. Ultra simple, allows to have almost empty file, while keeping all information in setup.json

Optionally integrates with Pipfile.lock which means you can stop using requirements.txt and use fully reproducible builds on production without doing pip freeze manually


  • External dependencies in requirements-external.txt
  • Internal dependencies (packages from same repository) in requirements-subpackages.txt
  • All arguments that goes to setup() are placed as dictionary in setup.json file, there is no magic there
  • and README.rst (in order) are loaded automatically as long description
  • Uses SCM plugin (setuptools_scm) by default
  • Optional Pipfile.lock from Pipenv support
  • Command ./ --quiet freeze_dependencies to print dependencies in requirements.txt format
  • Command ./ install_dependencies to install dependencies using pip

Getting started


Needs to be configured, so the pip and pipenv would know the dependencies to run file

requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.0", "riotkit.pbs>=1.0"]

The usage of PBS is really simple, import and unpack a dictionary. Optionally override values as you wish - there is no magic, everything is passed explicitly, so you can print it or pass to setup()

#!/usr/bin/env python3
from setuptools import setup
from riotkit.pbs import get_setup_attributes

# advanced usage: override any attribute
attributes = get_setup_attributes(git_root_dir='../../')
attributes['long_description'] += "\nBuilt using Riotkit Python Build Simplified"



Again, there is no any magic. Every key there is an attribute that should go to setup() from setuptools. Please look at setuptools documentation for list of available attributes, you can find it there:

    "name": "rkd.process",
    "author": "RiotKit non-profit organization",
    "author_email": "",
    "description": "rkd.process provides easy process interaction and output capturing/redirecting, wraps subprocess from Python's standard library.",
    "url": "",
    "license": "Apache-2",
    "classifiers": [
        "Development Status :: 5 - Production/Stable",
        "Environment :: Console",
        "Intended Audience :: Developers",
        "Intended Audience :: System Administrators",
        "Intended Audience :: Information Technology",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: POSIX",
        "Programming Language :: Python :: 3 :: Only"
    "keywords": ["rkd", "riotkit", "anarchism", "output capturing", "output", "subprocess"]


It's a regular requirements.txt replacement, with all versions there.


Points out which files should be included in a distribution package.

recursive-exclude tests *
recursive-exclude example *
include requirements-external.txt
include requirements-subpackages.txt
include setup.json

Additional work to do in multiple-package repository

Multiple-package repositories are used to keep versioning in synchronization for multiple packages. Some of packages could be dependent on each other, but possible to install standalone.

See real use case:


A dynamic version of requirements.txt, where a simple templating mechanism is available to allow creating dependencies to packages that are released together with current package from same repository.

rkd.process >= {{ current_version }}, < {{ next_minor_version }}

Available variables:

  • current_version: Example
  • next_minor_version: Example 1.4
  • next_major_version: Example 2.0

Pipenv support

Pipenv support could be optionally enabled. In this case all standard dependencies from Pipfile.lock would be frozen and added to install_requires automatically.

#!/usr/bin/env python3
from setuptools import setup
from riotkit.pbs import get_setup_attributes



PBS is not performing any magic inside, so there is a possibility to just print the attributes that would be used in setup()

#!/usr/bin/env python3
from setuptools import setup
from riotkit.pbs import get_setup_attributes
import pprint

attributes = get_setup_attributes(git_root_dir='../../')

pp = pprint.PrettyPrinter(indent=4)

# setup(
#     **attributes
# )

Project details

Download files

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

Source Distribution

riotkit.pbs-1.0.tar.gz (14.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page