python-poetry / python-poetry/poetry-plugin-export

Export command requires dev source dependencies to be present

Open
#148 1 comment 5 reactions 0 assignees View on GitHub

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 (-vvv option).

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.