poetry-plugin-export
poetry-plugin-export copied to clipboard
Export command requires dev source dependencies to be present
- [x] I am on the latest Poetry version.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [x] 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
Same for me.
I have IPython in dev, still poetry export --without-hashes -f requirements.txt including all dev packages