An opinionated CLI tool for Python monorepo MGMT.
Project description
Scream
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
By default packages are tested against python 3.7.x, which means you have it available on your PATH. If you about different versions, please see the configuration options.
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:
- Using
scream build
in your CI tool to build packages and ship them to your machines. - 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.
- Specify
dependency_links
in thesetup.cfg
for each 'local' dependency:
dependency_links =
git+ssh://git@github.com/ORG/REPO.git@master#egg=examplea-0#subdirectory=subpackages/examplea
- 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
Configuration
- In your packages
setup.cfg
the variablepython_requires
determines which versions of python your package will be tested against.
- Ex. python_requires = 2.7, 3.6, 3.7
Note: the python versions you intend to test must be available on your path.
Upcoming Features
- Auto version handling.
- Pre commit hook to flake8.
- Pre commit hook to avoid committing a large file.
- Docs builder
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
Hashes for scream-0.0.8-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0c1fe56de28eacc211b4d7a426d574ef5a1f823542f84a53588d595822702ba |
|
MD5 | bc0f88c2c60409187e8a613ec9881572 |
|
BLAKE2b-256 | ddee6217756de4c66502a64bae6dc0cb66d4c6a45cba071f99d1b4d7062ae957 |