Skip to content

Installing black with poetry fails #5756

Closed

Description

Environment data

  • VS Code version: 1.34.0
  • Extension version (available under the Extensions sidebar): 2019.4.12954
  • OS and version: macOS 10.14.5
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv via Poetry
  • Relevant/affected Python packages and their versions: black

Expected behaviour

Use --allow-prereleases option from poetry when installing black (until black comes with a released version).

Actual behaviour

source /Users/kristofferb/Library/Caches/pypoetry/virtualenvs/my-project-py3.7/bin/activate
poetry add black

~/Code/my-project
% source /Users/kristofferb/Library/Caches/pypoetry/virtualenvs/my-project-py3.7/bin/activate

~/Code/my-project
my-project-py3.7 % poetry add black
                                                      
[ValueError]                           
Could not find a matching version of package black  
                                                      
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...

Steps to reproduce:

  1. Install poetry
  2. poetry new my-project && code my-project
  3. poetry install to have it set up venv
  4. update .vscode/settings.json python.pythonPath to the venv created by poetry
  5. update .vscode/settings.json python.poetryPath to the path to the poetry executable (which poetry)
  6. open my_project/init.py, run Format Document
  7. On prompt "Formatter autopep8 is not installed. Install?" select "Use Black"
  8. Notice that the extension runs a command in the terminal (as described under Actual behavior).

Logs

Not relevant, can be provided upon request though

Activity

  1. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on May 24, 2019
  2. kbakk commented on May 24, 2019

    @kbakk
    Author

    Related issue: psf/black#517 Non-prerelease black release

  3. DonJayamanne commented on May 28, 2019

    @DonJayamanne

    Duplicate of #5171

  4. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on May 28, 2019
  5. locked as resolved and limited conversation to collaborators on Jun 4, 2019
  6. added a commit that references this issue on Jun 11, 2019
    76642f9
  7. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jun 18, 2019
  8. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jun 18, 2019
  9. ghost added
    triage-neededNeeds assignment to the proper sub-team
    on Jun 20, 2019
  10. ghost removed
    triage-neededNeeds assignment to the proper sub-team
    on Jun 20, 2019
  11. kimadeline commented on Jun 20, 2019

    @kimadeline

    Validated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions