Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
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
mackeyja92 opened this Issue Jun 5, 2018 · 15 comments

Comments

@mackeyja92
Copy link

mackeyja92 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).
sdispater/poetry#198
sdispater/poetry#571

@brettcannon

This comment has been minimized.

Copy link
Member

brettcannon commented Jun 5, 2018

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

This comment has been minimized.

Copy link
Member

brettcannon commented Jun 13, 2018

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.

@golyalpha golyalpha referenced this issue Jul 24, 2018

Closed

Add env command #278

0 of 2 tasks complete
@kevinpostal

This comment was marked as off-topic.

Copy link

kevinpostal commented Jan 16, 2019

+1 Add support, please

@kevinpostal

This comment has been minimized.

Copy link

kevinpostal commented Jan 16, 2019

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

@qubitron

This comment has been minimized.

Copy link

qubitron commented Jan 30, 2019

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

DonJayamanne commented Jan 31, 2019

I believe this should be addressed in the implementation somehow.

Activating poetry environments do not work (at least not yet).
sdispater/poetry#198
sdispater/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

This comment has been minimized.

Copy link
Member

brettcannon commented Feb 15, 2019

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

@abhishekvm

This comment has been minimized.

Copy link

abhishekvm commented Feb 17, 2019

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

This comment has been minimized.

Copy link
Member

brettcannon commented Feb 20, 2019

@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

This comment has been minimized.

Copy link

DonJayamanne commented Feb 27, 2019

@dclong

This comment was marked as off-topic.

Copy link

dclong commented Mar 12, 2019

It's great if the pybuilder dependency management is also supported.

@brettcannon

This comment was marked as resolved.

Copy link
Member

brettcannon commented Mar 12, 2019

@dclong please open a separate issue.

@DonJayamanne DonJayamanne referenced this issue Mar 13, 2019

Merged

Add poetryPath in package.json #4747

2 of 2 tasks complete

@DonJayamanne DonJayamanne removed this from the 2019, week 9 - Feb Sprint 5 milestone Mar 13, 2019

@ericsnowcurrently

This comment has been minimized.

Copy link
Member

ericsnowcurrently commented Mar 18, 2019

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.

@pvscbot pvscbot 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.
You can’t perform that action at this time.