Package: scream
ScreamStill 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'spkgutil-style.ScreamWhy use Scream?Problems with most monoreposHow scream worksCommandsQuickstartUsing your monorepo packagesConfigurationUpcoming FeaturesWhy use Scream?Scream holds all packages to the same standardsEnforces consistent styling.Enforces consistent testing.Enforces consistent documentation.Usestoxto setup virtualenvs for isolated testing across python versions.Pre-commit hooks to help prevent those gosh darn mistakes.Problems with most monoreposTesting & CI/CD pipeline can become slow with many packages.The other available solutions are:Use a build tool likePantsorBazel.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 usingdependency links.How scream worksScream 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,
andgitto detect what's changed since the parent branch.For example:catsetup.cfg.[metadata]name=company_packageAversion=0.0.1description=Your package description![options]packages=find:install_requires=company_packageBIf you make a change tocompany_packageAthen run tests...>screamtest--dry-run

Thefollowingpackageshavechangescomparedsincebranch:`master`:company_packagea

Packagesthatrequiretesting:company_packageacompany_packagebCommandsscream 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.QuickstartBy 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 theconfiguration options.>mkdirmymonorepo
>cdmymonorepo

>screaminit
Done!
Createanewpackagewith`screamnew<namespace>.<package_name>`>screamnewcom.packagea
Createdproject`com.packagea`>screamnewcom.packageb
Createdproject`com.packageb`>screamtest--all--parallel
Runningtests...(Usingallcores)>coveragereportUsing your monorepo packagesThe two common ways you would install packages from this monorepo are:Clone your repository and runscream 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 ispublic, you can simply install a subpackage anywhere using:pipinstall'git+ssh://git@github.com/ORG/REPO.git@master#subdirectory=examplea'If your repository isprivate,
you need a few extra steps to make sure packages that depend on other packages in this monorepo can be installed.Specifydependency_linksin thesetup.cfgfor each 'local' dependency:dependency_links=git+ssh://git@github.com/ORG/REPO.git@master#egg=examplea-0#subdirectory=subpackages/exampleapip install as before, but specifiy the flag--process-dependency-linkspipinstall'git+ssh://git@github.com/ORG/REPO.git@master#subdirectory=examplea'--process-dependency-linksConfigurationIn your packagessetup.cfgthe variablepython_requiresdetermines which versions of python your package will be tested against.Ex. python_requires = 2.7, 3.6, 3.7Note: the python versions you intend to test must be available on your path.Upcoming FeaturesAuto version handling.Pre commit hook to flake8.Pre commit hook to avoid committing a large file.