https://github.com/manuel-koch/hatch-monorepo-sandbox
Sandbox to try out publishing multiple artifacts with hatch from a monorepo
https://github.com/manuel-koch/hatch-monorepo-sandbox
hatch monorepo monorepo-example python
Last synced: 3 months ago
JSON representation
Sandbox to try out publishing multiple artifacts with hatch from a monorepo
- Host: GitHub
- URL: https://github.com/manuel-koch/hatch-monorepo-sandbox
- Owner: manuel-koch
- Created: 2024-02-27T16:45:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-02T15:41:45.000Z (over 1 year ago)
- Last Synced: 2024-12-28T03:40:10.559Z (10 months ago)
- Topics: hatch, monorepo, monorepo-example, python
- Language: Makefile
- Homepage:
- Size: 16.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hatch-monorepo-sandbox
This repo is a sandbox to try out using `hatch` to publish multiple
related python packages from a single monorepo.Main idea:
- have a library that contains production code
- have an auxiliary library that contains non-production code, e.g. test factories, debug helpers asf.
- version of auxiliary lib matches version of production lib
- when testing the production library, use the auxiliary library tooStructure of this repo:
- `my-sandbox-lib` holds the project configuration for the production library.
- `my-sandbox-lib-addon` holds the project configuration for the auxiliary library.
- `my-sandbox-tool` an arbitrary project configuration that makes use of `my-sandbox-lib` & `my-sandbox-lib-addon`.
I.e. this is how other projects would typically use `my-sandbox-lib` & `my-sandbox-lib-addon`.
- `src` holds the source code
- project configuration for an environment that combines all of the following
- production library `my-sandbox-lib`
- auxiliary library `my-sandbox-lib-addon`
- test code `tests`# Development
Typical development activity ( updating the libs with new functionality, adding bugfixes )
would involve commands from the repo root directory, like
- `make reset_env` to rebuild the python environment.
- `make format` to format sources of the libs & test code.
- `make lint` to lint sources of the libs & test code.
- `make test` to run tests on libs.Once development is finished, the updated libs can be build & published, using
- `make build_lib_package` to build production library `my-sandbox-lib`.
- `make build_lib_addon_package` to build auxiliary library `my-sandbox-lib-addon`.
- `make build_and_publish` to build the libs and publish them to a PyPi repository.