Multi package repos - cma-open/cmatools GitHub Wiki
Should a repo contain only one python package or can it hold multiple packages?
Typicaly a repo will be used to hold a single python package (optionally subdivided into related subpackages). However it is possible to store several packages in a single repo, each with their own setup.py, version number and associated tests. There are pos and cons to using a single repo to host several different packages, vs keeping each in its own repo.
One package per repo
Pros
- All code and functionality is grouped together for maintenance and access
- Setup of the package is clear and easy
- Version numbering can be easily linked to repo tags and release numbers
- This is the default, so users will be familiar and will expect this
Cons
- Need to carefully link any other repos that are dependencies
- Requires regular re-builds during development to ensure all linked repos are re-built and up to date
- Setting up and switching between repos for multi package development may introduce time and cost overheads
Multiple packages per repo
Pros
- Code is collected together and may be quicker to edit and maintain in one place, e.g. when edits to related packages are required to be made together
- The use of a common package with shared functinality to the other packages is quick to update and test
- Testing Continuous Integration (CI) pipelines may be easier to manage
Cons
- Install and setup is less clear to users, e.g. if they only want to install one of the packages
- The link between package version and repo tag release number is uncertain and harder to manage
- Documentation pages may become less clear for users, as they will display info accross several packages