Scream
Still very much a WIP. Lots of work to be done; please open issues or pull requests.
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.
Why use Scream?
-
Scream holds all packages to the same standards
- Enforces consistent styling.
- Enforces consistent testing.
- Enforces consistent documentation.
-
Uses tox to setup virtualenvs for isolated testing across python versions.
-
Pre-commit hooks to help prevent those gosh darn mistakes.
Problems with most monorepos
-
Testing & CI/CD pipeline can become slow with many packages.
The other available solutions are:
These tools are extremely powerful, but sometimes are overkill, and introduce a fair amount of overhead to manage.
-
Installing intra-monorepo package dependencies is hard with a private repositories.
The available solutions are:
- Have all your packages distributed publically.
- Host a private PYPI index.
- pip install using dependency links.
How scream works
Scream aims to cause as little overhead as possible for managing your monorepo. No fancy third party configuration or private PYPI repositories.
Scream uses the existing python packaging requirements to resolve intra-monorepo dependencies,
and git to detect what's changed since the parent branch.
For example:
cat setup.cfg.
[metadata]
name = company_packageA
version = 0.0.1
description = Your package description!
[options]
packages = find:
install_requires =
company_packageB
If you make a change to company_packageA then run tests...
> scream test --dry-run
The following packages have changes compared since branch: `master`:
company_packagea
Packages that require testing:
company_packagea
company_packageb
Commands
scream init- Run this first. Initiates a monorepo in an empty directory.scream new <package-name>- Creates new template package.scream test [--dry-run][--all][--parallel]- Tests packages and package dependents that have changed.scream install <package-name>[--test]- Installs a package.--testinstalls testing dependencies.deploy <package-name>- Runs deploy.py in your package directory.scream build- Builds a python wheel and bundles it with all it's dependencies as wheels. (TODO)
-vwill enable verbose logs.
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
Done!
Create a new package with `scream new <namespace>.<package_name>`
> scream new com.packagea
Created project `com.packagea`
> scream new com.packageb
Created project `com.packageb`
> scream test --all --parallel
Running tests... (Using all cores)
> coverage report
Using your monorepo packages
The two common ways you would install packages from this monorepo are:
- Clone your repository and run
scream buildorscream installin 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_linksin thesetup.cfgfor 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.cfgthe variablepython_requiresdetermines 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.
Metadata
Release files for scream 0.0.34
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| scream-0.0.34.tar.gz | 18.5 kB | Without provenance | Details for scream-0.0.34.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| scream-0.0.34-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for scream-0.0.34-py2.py3-none-any.whl |
Total release size: 43.5 kB
Release files / scream-0.0.34.tar.gz
| Download URL | scream-0.0.34.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
017a5469067a536821e77461d52b211fd832369237107527d31c778e2adfe1d2
|
|
BLAKE2b-256 checksum How to use checksums |
8ee88ccba07f6854d55f04402ca84e55f9eb9b41c6370faa689d9b4f20d2349e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Release files / scream-0.0.34-py2.py3-none-any.whl
| Download URL | scream-0.0.34-py2.py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
00de32e6c46ef69723db7f045f800079b428fece4ba151e59a36ad31a34153e5
|
|
BLAKE2b-256 checksum How to use checksums |
6d6bb842d8d364818eb1881bcf47e0fe5358f52bb4e26cba27bc64de0156d55d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4
|
Security for scream 0.0.34
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.