21

There are multiple projects in my monorepo, which has package management via Poetry individually. For instance,

monorepo
├── a
│   └── pyproject.toml
├── b
│   └── pyproject.toml
└── c
    └── pyproject.toml

Each project has its own sessions for [tool.poetry.dependencies] and [tool.poetry.dev-dependencies]. However, they did share huge amount of common configs such as

  • [tool.taskipy.tasks]
  • [tool.isort]
  • [tool.black]
  • ...

My question is how to define common configs which could be reused for monorepo projects?

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
northtree
  • 8,569
  • 11
  • 61
  • 80

2 Answers2

1

You could go with

[tool.poetry.dependencies]
rootproject = {path = "path/to/root/project"}

However keep in mind that each dependency will still have its' own Virtual Environment, if that's not sufficient you can go with a different tool such as pip-tools.

Naji
  • 56
  • 3
0

See this discussion _https://github.com/python-poetry/poetry/issues/2270

You can do that by creating a local config (poetry.toml) for each of your sub-packages with virtualenvs.create false. You then mark the sub-packages as dependencies as suggested by @fredrikaverpil and include them as packages.