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

Export always includes common dev and extras requirements

Open
#23 5 comments 6 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).

  • OS version and name: macOS Mojave 10.14.3

  • Poetry version: 1.0.5

  • Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/shparki/36f5cabc9d99f10cc511eb0e186f7473

Issue

This issue seems pretty simple at the front but has caused me a bunch of grief.
TL;DR: No requirements are technically specified, and yet when I perform a basic poetry export -f requirements.txt --without-hashes > requirements.txt the following is set in the requirements.txt:

botocore==1.15.16
docutils==0.15.2
jmespath==0.9.5
python-dateutil==2.8.1
s3transfer==0.3.3
six==1.14.0
urllib3==1.25.8; python_version != "3.4"

with the folloing pyproject.toml:

[tool.poetry]
name = "my-project"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]

[tool.poetry.dependencies]
python = "^3.7"
awscli = {version = "^1.18.16", optional = true}

[tool.poetry.dev-dependencies]
boto3 = "^1.12.16"

[tool.poetry.extras]
"aws" = ["awscli"]

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

I have deleted the pyproject.toml and re-performed poetry update in an attempt to create a fresh poetry.lock, and yet it keeps outputting these requirements. After some experimenting, I believe this is due to those being common requirements between dev and extras. Although those shouldn't be included in a basic export, somehow their common requirements are included. I confirmed this by commenting out the extras and updating and then commenting out the dev requirements and updating and both times the requirements.txt is empty.

I believe this functionality is a bug rather than a feature request due to the inclusion of the --dev and --extras parameters in poetry export to specify all dev/extras requirements to be included.

Steps to Reproduce

  1. Create a blank project
  2. Define some dependencies as 'dev' and none for core dependencies(note, if you export requirements.txt at this point, it will be empty; for this step, I did boto3 in testing)
  3. Define some extra dependencies that have common dependencies as some of the dev dependencies. (for this step, I did awscli for testing)
  4. Export core requirements. It should be empty, but in reality, it will contain common dependencies between dev and extras (in testing, mine included botocore, which I knew was a common dependency for boto3 and awscli).

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 the provided pyproject.toml and poetry export -f requirements.txt --without-hashes, then compare exports with the dev and extras options. Done means a core-only export is empty when only dev and optional dependencies exist, while explicitly requested dev or extras dependencies still export their required packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.