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

Support Poetry depenedency manager #1871

Closed
jared-mackey opened this issue Jun 5, 2018 · 15 comments
Closed

Support Poetry depenedency manager #1871

jared-mackey opened this issue Jun 5, 2018 · 15 comments
Assignees
Labels
feature-request Request for new features or functionality

Comments

@jared-mackey
Copy link

jared-mackey commented Jun 5, 2018

Currently it looks like Pipenv is supported but not poetry. Is there plans to support this dependency manager as well?

Note:

Activating poetry environments do not work (at least not yet).
python-poetry/poetry#198
python-poetry/poetry#571

@brettcannon brettcannon added feature-request Request for new features or functionality needs decision labels Jun 5, 2018
@brettcannon
Copy link
Member

No specific plans at the moment, but if people begin to vote for this issue with a 👍 reaction then we will definitely consider it.

@brettcannon
Copy link
Member

We are going to wait until poetry hits version 1.0 before making a decision about this. People should continue to leave a 👍 reaction on the top comment until then to help us prioritize a decision and potential work compared to other feature requests.

@kevinpostal

This comment has been minimized.

@kevinpostal
Copy link

One workaround is to use virtualenvs in project root. Then vscode picks it up.
poetry config settings.virtualenvs.in-project true

@qubitron
Copy link

We are looking at implementing this, so I want to clarify the desired behavior here: if Poetry is detected in the current environment, prompt user if they want to install packages (pylint, rope, etc) using poetry.

Is that correct? Please let us know if there's additional behavior desired here.

@leos
Copy link

leos commented Jan 31, 2019

Any installations should happen via poetry. It would also be great if VS Code could autodetect the poetry virtualenv and use it.

@lig
Copy link

lig commented Jan 31, 2019

@qubitron personally, I found poetry's lack of interpreter version management ability a bit frustrating. I believe this should be addressed in the implementation somehow. Comparing to pipenv's ability to choose an interpreter version to create the environment based on Pipfile, poetry always uses the default interpreter to create the environment and could fail if the version is incompatible with the requirement defined in pyproject.toml.

@DonJayamanne
Copy link

I believe this should be addressed in the implementation somehow.

Activating poetry environments do not work (at least not yet).
python-poetry/poetry#198
python-poetry/poetry#571

If things don't work in the tool itself, we're not going to try to add workarounds or implement solutions.

What can be done however is just add support for using poetry, when the extension prompts users to install any python packages. We do this today for conda, pipenv, environments.

I.e. when user needs to install a formatter, we'll (optionally) make use of poetry.

@brettcannon
Copy link
Member

@lig since we do not manage environment creation that will be out of scoped for this work.

@abhishekvm
Copy link

We are looking at implementing this, so I want to clarify the desired behavior here: if Poetry is detected in the current environment, prompt user if they want to install packages (pylint, rope, etc) using poetry.

Is that correct? Please let us know if there's additional behavior desired here.

Till the time support for poetry gets added, I was thinking if there is any hacky way we can get through this. vscode installs any packages with following command:
<PYTHONPATH>python -m pip install -U pytest or <PYTHONPATH>python -m pip install -U pylint

Is there any way in vscode where we can map pip install to poetry add --dev?

@brettcannon
Copy link
Member

@abhishekvm nope, we don't provide that kind of functionality. You can always do the install manually while people wait for this feature since as you noticed we aren't doing anything too magical.

@DonJayamanne
Copy link

DonJayamanne commented Feb 27, 2019

@dclong

This comment has been minimized.

@brettcannon

This comment has been minimized.

@ericsnowcurrently
Copy link
Member

I was able to verify that poetry is used to install modules:

  1. python -m pip install --user poetry
  2. in project: python -m poetry init
  3. in project: python -m poetry lock
  4. workspace settings: "python.linting.flake8enabled": true
  5. reload window

This caused the popup for installing flake8. Then poetry was used to install flake8.

@ghost ghost removed the needs PR label Mar 18, 2019
@ericsnowcurrently ericsnowcurrently removed their assignment Mar 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

10 participants