https://github.com/curt-park/python-monorepo-template
Python monorepo template with Pants
https://github.com/curt-park/python-monorepo-template
docker github-actions monorepo pants python
Last synced: 14 days ago
JSON representation
Python monorepo template with Pants
- Host: GitHub
- URL: https://github.com/curt-park/python-monorepo-template
- Owner: Curt-Park
- Created: 2023-08-19T07:18:51.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-19T18:02:55.000Z (about 2 years ago)
- Last Synced: 2024-11-15T19:35:21.912Z (11 months ago)
- Topics: docker, github-actions, monorepo, pants, python
- Language: Python
- Homepage:
- Size: 41 KB
- Stars: 19
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Monorepo Template
Python Monorepo Template with [Pants](https://www.pantsbuild.org/).
## Items
- [x] Small Python projects with dependency
- [x] Project execution
- [x] Formatting (black, isort)
- [x] Linting (flake8, pylint, pydocstyle)
- [x] Unit Test
- [x] Docker build
- [x] GitHub actions## Project Structure
```bash
.
└── libs
├── base # base has add2(int, int)
└── fancy # fancy has add3(int, int, int) method which calls add2
```## Prerequisites
- For Linux
```bash
curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash
```- For Mac
```bash
brew install pantsbuild/tap/pants
```## How to run
```bash
# How to execute
pants run libs/base/main.py
pants run libs/fancy/main.py# How to format
pants fmt :: # for all projects
pants fmt libs/base:: # for base
pants fmt libs/fancy:: # for fancy# How to lint
pants lint :: # for all projects
pants lint libs/base:: # for base
pants lint libs/fancy:: # for fancy# How to run unit tests
pants test :: # for all projects
pants test libs/base:: # for base
pants test libs/fancy:: # for fancy# Build docker images
pants package docker/Dockerfile.base # build base
pants package docker/Dockerfile.fancy # build fancy
```## References
- https://www.pantsbuild.org/docs
- https://github.com/pantsbuild/example-python
- https://github.com/pantsbuild/example-docker
- https://github.com/tweag/python-monorepo-example