python-poetry / python-poetry/poetry-plugin-export
Export command requires dev source dependencies to be present
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 335
- Forks
- 57
- Avg merge
- 1h 23m
- Merged PRs (30d)
- 3
Description
- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvvoption).
Similar issue to: https://github.com/python-poetry/poetry/issues/875
- OS version and name: CentOS, any OS.
- Poetry version: Latest
- Link of a Gist with the contents of your pyproject.toml file: N/A
Issue
I have a dev dependency on a python package from source, e.g.
package_name = {path = "package_name"}
However, in my production build step, this package will not be present. But attempting to export when the package is not present results in the following error:
$ poetry export -f requirements.txt
[ValueError]
Directory package_name does not exist
Dev dependencies should not be required to generate a requirements.txt for prod. I confirmed this issue is present for poetry install --no-dev as well.
Workaround
The workaround is to create a "fake" package:
mkdir package_name
touch package_name/setup.py
Contributor guide
No contributing guide indexed for this repository
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
Reproduce the issue with a dev path dependency such as package_name = {path = "package_name"} absent, then compare poetry export -f requirements.txt with poetry install --no-dev. Start from the export command and its handling of the project dependency metadata. Done means production dependency export and installation no longer require an unavailable dev-only path package.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100