Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide way to export only development dependencies #1441

Closed
2 tasks done
homeworkprod opened this issue Oct 6, 2019 · 8 comments
Closed
2 tasks done

Provide way to export only development dependencies #1441

homeworkprod opened this issue Oct 6, 2019 · 8 comments
Labels
kind/feature Feature requests/implementations

Comments

@homeworkprod
Copy link

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I'm using Poetry v1.0.0b for this, which (as opposed to v0.12.x) includes the export command.

I come from a background where core dependencies are defined in requirements.txt and development ones in requirements-dev.txt (or similar). Test dependencies might have their own file as well (e.g. to only install what's necessary to test on CI systems, but not debug and documentation tools).

My issue is that while I can (re-)create the core requirements file via poetry export -f requirements.txt --without-hashes -o requirements.txt, I cannot do the same for the list of (only) development dependencies.

There is the --dev option for the export command ("Include development dependencies."), but it includes the core dependencies, too. Thus, the result is not the list of additional dependencies that required for development purposes only.

I'm not sure how this can be solved without breaking the (probably useful) use case of exporting all dependencies together.

  • Maybe a --dev-only option?
  • Or make --dev output only development dependencies, but not core ones? And
  • introduce --all to output both core and development dependencies?
    • Should these include extras? If not, and I don't think they should, is the name "all" appropriate?
@homeworkprod homeworkprod added the kind/feature Feature requests/implementations label Oct 6, 2019
@finswimmer
Copy link
Member

finswimmer commented Oct 12, 2019

I like the idea, and I think it would be a useful feature for the --extras packages as well. My two favorite implementation would be:

  • --dev-only/ --extras-only as parameters
  • -f requirements-dev.txt/-f requirements-extra.txt

If we can get a consensus about the way, I think I would be able to implement such feature.

@sdispater What's your opinion?

@RCheese
Copy link

RCheese commented Nov 9, 2020

https://github.com/RCheese/deplodocker
now I am using not enough DRY )

@kodekracker
Copy link

@python-poetry/triage Any new updates on this issue ? This feature would be very useful.

@njoyce
Copy link

njoyce commented Mar 18, 2021

I just started looking at moving from pipenv to poetry and this issue came up.

@vchrombie
Copy link

I have faced a similar situation and wrote this small tool vchrombie/peodd (poetry export, but only for dev-dependencies) for this purpose.

You can install using pip

$ pip install peodd

and use it direclty from the command line

$ peodd -o requirements-dev.txt

The requirements-dev.txt would have the dev-dependencies (in the requirements.txt format) which would be ready to use.
I have tested the poetry versions format ^n.n.n, >=n.n.n, n.n.n and they worked fine. Hoping to add the rest of the formats too.

It would be great if you can try using the tool and provide feedback.

Thanks in advance.

vchrombie added a commit to vchrombie/poetry that referenced this issue Jul 14, 2021
This commit adds the support for exporting only the
dev-dependencies to the poetry.

Fixes python-poetry#1441
vchrombie added a commit to vchrombie/poetry that referenced this issue Jul 14, 2021
This commit adds the support, for exporting only the
dev-dependencies, to the poetry.

Fixes python-poetry#1441
vchrombie added a commit to vchrombie/poetry-export-plugin that referenced this issue Jul 14, 2021
This commit adds the support, for exporting only the
dev-dependencies, to the export plugin.

Related to python-poetry/poetry#1441
Extension to python-poetry/poetry#4283
vchrombie added a commit to vchrombie/poetry that referenced this issue Sep 18, 2021
This commit adds the support, for exporting only the
dev-dependencies, to the poetry.

Fixes python-poetry#1441
@mkniewallner
Copy link
Member

export command is being replaced by a plugin in Poetry 1.2, which should solve the use cases you mentioned.

Tested on latest version with the plugin:

curl -sSL https://install.python-poetry.org | python - --git https://github.com/python-poetry/poetry.git@master
poetry plugin add poetry-plugin-export

Then:

# Export main + dev dependencies
poetry export -f requirements.txt --output requirements.txt --with dev

# Export main dependencies
poetry export -f requirements.txt --output requirements_without_dev.txt

# Export dev dependencies only
poetry export -f requirements.txt --output requirements_only_dev.txt --only dev

Could you confirm if it solves all your use cases?

@mkniewallner mkniewallner added the status/waiting-on-response Waiting on response from author label May 28, 2022
@mkniewallner
Copy link
Member

Closing, since this is implemented now (see #1441 (comment)).

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants