This repository demonstrates a Python monorepo structure using Poetry for packaging and dependency management.
apps/
: Contains applications. Applications should not import other applications.libs/
: Contains libraries. Applications can import multiple libraries.
- Install Poetry: Follow the Poetry installation guide to install Poetry.
- Refer to the README in
apps/be-funny/
and follow the installation instructions. - Review the structure and
pyproject.toml
inlibs/
to understand dependency management. - Examine the
pyproject.toml
inapps/be-funny/
to understand script definitions and dependency management.
- Split an application into multiple applications only if necessary, such as when multiple services are highly unrelated and managed by different teams.
- Applications must not be imported by other applications or libraries.
- Each application may include a
Dockerfile
for containerization. While not shown in this repository, it is a common practice in production environments. - Define Python dependencies in the root
pyproject.toml
file. TheDockerfile
should manage only non-Python dependencies, except for Python, Poetry, and pip themselves.
- Libraries are required when multiple applications need to use the same functionality. Usually, it's originally a package or module under one original application.
- Libraries are located in the
libs/
directory and can be imported by both applications and other libraries. - Libraries should not contain a
Dockerfile
. All dependencies must be managed through thepyproject.toml
file.
This project is licensed under the MIT License. See the LICENSE file for details.