{"id":24250,"library":"poetry-multiproject-plugin","title":"Poetry Multiproject Plugin","description":"A Poetry plugin that enables using relative package includes in multi-project monorepos. It allows a Poetry project to include packages from sibling directories as if they were part of the same project, with support for Poetry v2 and PEP 621. Version 1.8.4 is the latest supporting Python >=3.8,<4.0, under active development with regular releases.","status":"active","version":"1.8.4","language":"python","source_language":"en","source_url":"https://github.com/davidvujic/poetry-multiproject-plugin","tags":["poetry","plugin","monorepo","multi-project","relative-imports"],"install":[{"cmd":"poetry self add poetry-multiproject-plugin","lang":"bash","label":"Install via Poetry"},{"cmd":"pip install poetry-multiproject-plugin","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core dependency; the plugin runs as a Poetry plugin.","package":"poetry","optional":false}],"imports":[],"quickstart":{"code":"# Ensure the plugin is installed:\n# poetry self add poetry-multiproject-plugin\n\n# In your pyproject.toml, add:\n# [tool.poetry.plugins.poetry]\n# multiproject-plugin = \"poetry_multiproject_plugin.plugin\"\n\n# Then use relative includes in pyproject.toml:\n# [tool.poetry]\n# packages = [\n#     { include = \"../shared_lib\", from = \"..\" },\n# ]\n\n# Build the project with:\n# poetry build-project\n\nimport subprocess\nimport os\n\n# Example: run the build command (ensure plugin is configured)\nsubprocess.run(['poetry', 'build-project'], cwd=os.path.dirname(os.path.abspath(__file__)))","lang":"python","description":"Minimal setup to use the plugin; requires manual pyproject.toml configuration."},"warnings":[{"fix":"Update plugin to >=1.8.0: poetry self add poetry-multiproject-plugin@latest","message":"Poetry v2 changes: The plugin v1.8.0+ adds support for Poetry v2, but older versions (pre-1.8.0) are incompatible with Poetry v2. Ensure you have at least v1.8.0 if using Poetry 2.","severity":"breaking","affected_versions":">=1.0.0, <1.8.0"},{"fix":"Update to >=1.8.1: poetry self add poetry-multiproject-plugin@latest","message":"PEP 621 support requires v1.8.1+: If your pyproject.toml uses [project] instead of [tool.poetry], you need plugin >=1.8.1. Older versions will fail to parse.","severity":"breaking","affected_versions":"<1.8.1"},{"fix":"Explicitly declare each relative package include in your pyproject.toml under 'packages'.","message":"Relative includes must be listed explicitly in pyproject.toml: The plugin only processes packages declared under [tool.poetry.packages] (or [project] in PEP 621). It does not automatically discover sibling packages.","severity":"gotcha","affected_versions":"all"},{"fix":"Add the option to build command: poetry build-project --with-top-namespace","message":"Namespace packages: Use --with-top-namespace to handle top-level namespace imports. If you have a namespace package like 'namespace.submodule', you may need that flag to avoid import aliases with missing module names.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade to poetry-multiproject-plugin>=1.8.4.","cause":"The plugin version <1.8.4 fails when importing a module without 'from' (e.g., 'import module') when using --with-top-namespace.","error":"AttributeError: 'NoneType' object has no attribute 'group'"},{"fix":"Add the relative path to [tool.poetry.packages] or [project.urls]? Actually, ensure packages = [{ include = \"../shared_lib\", from = \"..\" }] in pyproject.toml.","cause":"The relative package is not declared in pyproject.toml under 'packages'.","error":"ModuleNotFoundError for relative includes"},{"fix":"Install using 'poetry self add poetry-multiproject-plugin' and verify with 'poetry plugin show'.","cause":"The plugin is not installed or Poetry's plugin system is not detecting it.","error":"Poetry command not found: build-project"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}