Skip to main content

An opinionated CLI tool for Python monorepo MGMT.

Project description

Scream

Python 3.7 License: MIT

What you do when you see a bunch of python... packages.

or...

An opinionated CLI tool for Python monorepo MGMT.


It's objective is to ease the creation, testing, and deploying of multiple python packages in a single repository. To ensure non-overlapping names with PYPI, this tool forces you to use namespace packages. Namespaces are defined according to python's pkgutil-style.

Highlights

  • Creates a consistent blueprint for all packages in a single repository.
    • Promotes code re-use.
    • Consistent Styling.
    • Consistent Testing / Linting / Docs.
  • Uses tox to setup virtualenvs for tests.
  • Pre-commit hooks to help prevent those gosh darn mistakes.

Commands

  • scream new <package_name> - Creates new template package.
  • scream test [--dry-run][--all] - Installs a package.
  • scream install <package_name> - Test packages that have changed or who's dependencies have changed since master.
  • scream build - Builds a python wheel and bundles it with all it's dependencies as wheels.

Quickstart

mkdir mymonorepo
cd mymonorepo

scream init

scream new com_packagea
scream new com_packageb

scream test --all

coverage report

Using your monorepo packages

The two common ways you would install packages from this monorepo are:

  1. Using scream build in your CI tool to build packages and ship them to your machines.
  2. Standard pip install individual packages to any machine from private or public github repos.

If your repository is public, you can simply install a subpackage anywhere using:

pip install 'git+ssh://git@github.com/ORG/REPO.git@master#subdirectory=examplea'

If your repository is private, you need a few extra steps to make sure packages that depend on other packages in this monorepo can be installed.

  1. Specify dependency_links in the setup.cfg for each 'local' dependency:
dependency_links =
    git+ssh://git@github.com/ORG/REPO.git@master#egg=examplea-0#subdirectory=subpackages/examplea
  1. pip install as before, but specifiy the flag --process-dependency-links
pip install 'git+ssh://git@github.com/ORG/REPO.git@master#subdirectory=examplea' --process-dependency-links

Important User Configs

  1. In your packages setup.cfg the variable python_requires determines which versions of python your package will be tested against.

Upcoming Features

  • Auto version handling.
  • Pre commit hook to flake8.
  • Pre commit hook to avoid committing a large file.
  • Docs builder

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

scream-0.0.4.tar.gz (11.4 kB view hashes)

Uploaded Source

Built Distribution

scream-0.0.4-py3-none-any.whl (18.6 kB view hashes)

Uploaded Python 3

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