You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doesn't seem applicable. poetry install command succeeds, and logs don't reveal anything apparently obvious (would rather not scrub data if not needed).
The text was updated successfully, but these errors were encountered:
[tool.poetry]
name = "monorepo"
version = "0.0.0"
packages = [
{include = "src", from = "my_project", to = "my_project"}
]
[tool.poetry.dependencies]
python = "^3.10"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
If I run:
poetry lock
poetry install
poetry shell
python
>>> import my_project # <-- raises import error
>>> import src # <-- resolves to monorepo/myproject/src. Expectation is that this line fails and first line succeeds
Looking at the change you provided it looks like for local install this might be expected. I have no idea why this is though and if I run poetry build the .tar.gz created also has a src/ folder and not a my_module folder.
Description
Documentation on pyproject.toml suggests that the following syntax is supported.
My understanding of what this should do is that a local install of the package in question should probably support
import target_package
.I am not seeing this however and
my_package
is resolved as the module name. Is this feature actually supported or do I misunderstand something?Workarounds
No real workaround. Rename the folder in the source to the desired target name I suppose.
Poetry Installation Method
install.python-poetry.org
Operating System
Windows 11
Poetry Version
1.8.3
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
No response
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: