Skip to content

eunseo0u0/my-little-monorepo-with-pants

Repository files navigation

My Little Monorepo with Pants

Python Ruff Black Docformatter Linux MacOS

Welcome to "My Little Monorepo with Pants" - This repository contains an example of a monorepo with Python which utilizes a powerful tool, called Pants. Feel free to explore, experiment, and adapt the practices demonstrated here to meet your specific development needs. Whether you're new to monorepos or Pants, this repository aims to be a valuable resource for enhancing your development workflow. 🚀✨

Repository Highlights

  • Pants: This repository is built on the Pants build system. It not only utilizes Pants for code execution but also for various tasks like code formatting, linting, and testing. Additionally, Pants is employed for building and pushing container images (with Docker), as well as managing dependencies.

  • Simple API Example: Explore a straightforward CRUD API implemented with FastAPI. This example can be instrumental in understanding Python monorepo concepts.

  • Automated Build: A streamlined continuous integration (CI) and continuous delivery (CD) process is in place, automated through GitHub Actions.

Core Pants Goals

  • run: run an executable or script.
  • test: run tests with Pytest.
  • fmt: autoformat source code.
  • lint: lint source code in check-only mode.
  • check: run MyPy.
  • repl: open a REPL (standard shell or IPython).
  • package: package your code into an asset, e.g. a wheel or a PEX file.
  • publish: how to distribute packages to a repository

Repository Structure

./
├── 3rdparty/
│   ├── BUILD
│   ├── black-requirements.txt
│   ├── black.lock
│   ├── coverage-py-requirements.txt
│   ├── coverage-py.lock
│   ├── docformatter-requirements.txt
│   ├── docformatter.lock
│   ├── pytest-requirements.txt
│   ├── pytest.lock
│   ├── python-default.lock
│   ├── python-requirements.txt
│   ├── ruff-requirements.txt
│   └── ruff.lock
├── BUILD
├── LICENSE
├── README.md
├── pants.ci.toml
├── pants.toml
├── pyproject.toml
├── src/
│   └── todos/
│       ├── BUILD
│       ├── Dockerfile
│       ├── Makefile
│       ├── README.md
│       ├── apps/
│       │   ├── BUILD
│       │   ├── monitor.py
│       │   └── v1/
│       │       ├── BUILD
│       │       └── todos.py
│       ├── main.py
│       └── models/
│           └── v1/
│               ├── BUILD
│               └── todos.py
└── tests/
    └── src/
        └── todos/
            └── apps/
                ├── BUILD
                ├── monitor_test.py
                └── v1/
                    ├── BUILD
                    └── todos_test.py

References