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

WIP: Add no-install param to poetry add #1834

Open
wants to merge 1 commit into
base: develop
from

Conversation

@adisbladis
Copy link
Contributor

adisbladis commented Jan 5, 2020

Pull Request Check List

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

  • Added tests for changed code.
  • Updated documentation for changed code.

Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the develop branch. If it's a bug fix or only a documentation update, it should be based on the master branch.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

I want to use poetry to manage my dependencies without touching the
virtual environment.
@adisbladis adisbladis changed the title No install Add no-install param to poetry add Jan 5, 2020
@adisbladis adisbladis changed the title Add no-install param to poetry add WIP: Add no-install param to poetry add Jan 5, 2020
@sdispater

This comment has been minimized.

Copy link
Member

sdispater commented Jan 6, 2020

Since there is no feature request issue related to this: which use case does this try to solve?

I don't see the value of this feature and seems more like and edge but I might be wrong.

@adisbladis

This comment has been minimized.

Copy link
Contributor Author

adisbladis commented Jan 6, 2020

It is a bit of a "strange" use-case. I want to let poetry deal with dependency solving only and let https://github.com/nix-community/poetry2nix create/load the environments.

@juhoautio

This comment has been minimized.

Copy link

juhoautio commented Jan 9, 2020

I have a slightly different kind of use case for this feature. I have a project generator that wraps poetry to create a structure that extends poetry's defaults. For this I'm using poetry new, followed by poetry add to add some additional default dependencies. However, poetry add also creates the virtual environment and installs the dependencies, which takes some time.

On the other hand, the interactive poetry init allows specifying additional dependencies without installing them. But it's not ideal to wrap the interactive command when further input is not wanted by the user.

To explain the use case a bit more, workflow is that a user could run mygenerator new quickly, then edit the pyproject.toml manually to for example remove unwanted default dependencies, and run poetry install once done with the manual editing. Also, as poetry init & poetry new don't create the virtual environment, I would like my generator to be able to skip it.

My use case could be cleanly implemented with any of these changes in poetry:

  • Add a --no-install option to poetry add
  • Add options --dependency and --dev-dependency to poetry new (this is my favorite, because why not, when init already supports these flags) (feature request: #1854)
  • Add option --no-interactive to poetry init
  • Add a function in poetry lib that allows easily modifying pyproject.toml so that it preserves the original layout of poetry new
@finswimmer finswimmer added the Feature label Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.