python-poetry / python-poetry/poetry
Project isn't updated to the directory set by "directory" argument
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 34.3k
- Forks
- 2.5k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 30
Description
Description
I am not sure if it is, but it looks like a bug, when I run poetry --directory path/to/project build I get an error:
WARNING: No build backend defined. Please define one in the pyproject.toml.
...
(backend is set under "path/to/project/pyproject.toml")
...
Readme pathpath/to/project/README.mddoes not exist.
It's weird because if I run Poetry from said directory by changing directory on shell it does work correctly without any issues: poetry build.
Maybe my understanding about this is wrong.
Workarounds
- Changing directory to project manually and running build works:
cd path/to/project && poetry build - Appending
--project ./seems to work as well. This is weird, I'd assume project is automatically set to "currect directory" when it is changed with--directorybut it's not. So you have to manually switch it by doing something like this:
poetry --directory path/to/project --project ./ build
which seems to work correctly as well.
Poetry Installation Method
pip
Operating System
RHEL9
Poetry Version
2.1.1
Poetry Configuration
Fully vanilla config, only changes are source repositories which are PyPi mirrors.
Python Sysconfig
No response
Example pyproject.toml
[tool.poetry]
name = "poetry-demo"
version = "0.1.0"
description = ""
authors = ["My name", "email@example.net"]
readme = "README.md"
package-mode = true
packages = [
{ include = "src" }
]
[tool.poetry.dependencies]
python = "^3.9"
boto3 = "^1.35.54"
poethepoet = "^0.33.0"
requests = "^2.32.3"
[[tool.poetry.source]]
name = "nexus"
url = "https://nexus.net/repo/repository/pypi/simple/"
priority = "primary"
[tool.poetry.group.dev.dependencies]
nox = "^2024.10.9"
poethepoet = "^0.33.0"
pytest = "^8.3.5"
nox-poetry = "^1.2.0"
[tool.poetry.requires-plugins]
poetry-plugin-export = ">=1.8"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
Poetry Runtime Logs
Sorry, I can't get these right now, let me know if these are mandatory.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing poetry --directory path/to/project build and compare it with the working cd path/to/project && poetry build and --project ./ variant. Inspect how the command resolves path/to/project/pyproject.toml and README.md; done means the build uses the target project's configuration without requiring --project ./.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100