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

Black version number is not properly set when downloading from source and installing from PyPi. #1910

Closed
dciborow opened this issue Jan 7, 2021 · 3 comments
Labels
C: packaging Installation and packaging of Black T: bug Something isn't working T: user support OP looking for assistance or answers to a question

Comments

@dciborow
Copy link

dciborow commented Jan 7, 2021

Describe the bug
I am trying to install black locally after downloading from pypi, but the version is set to 0.0.0.

To Reproduce Steps to reproduce the behavior:

  1. In "core.in" place one line "black==20.8b1"
  2. pip-compile --allow-unsafe --generate-hashes --output-file=./core-linux.txt ./core.in
    1.```
    pip download
    --no-build-isolation
    --require-hashes
    --no-binary :all:
    --only-binary ${BINARY}
    -d "/source/packages/pywheel"
    -r "/tmp/requirements/core-linux.txt"
1. ```
pip install \
        --no-build-isolation \
        --no-index \
        --find-links "/source/packages/pywheel" \
        --require-hashes \
        --no-deps \
        --no-binary :all: \
        --only-binary ${BINARY} \
        --upgrade \
        -r "/tmp/requirements/core-linux.txt"

Processing /source/packages/pywheel/black-20.8b1.tar.gz
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
WARNING: Requested black==20.8b1 from file:///source/packages/pywheel/black-20.8b1.tar.gz (from -r /tmp/requirements/test-linux.txt (line 35)), but installing version 0.0.0
ERROR: Requested black==20.8b1 from file:///source/packages/pywheel/black-20.8b1.tar.gz (from -r /tmp/requirements/test-linux.txt (line 35)) has different version in metadata: '0.0.0'

Expected behavior A clear and concise description of what you expected to happen.
Install correctly.

Environment (please complete the following information):

  • Version: [e.g. master] 20.8b1
  • OS and Python version: [e.g. Linux/Python 3.7.4rc1]
    Linux - Python 3.7
@dciborow dciborow added the T: bug Something isn't working label Jan 7, 2021
@ichard26
Copy link
Collaborator

ichard26 commented Jan 7, 2021

I'm not sure what you're trying to do, but try making sure setuptools-scm is available in the environment you're installing to.

@dciborow
Copy link
Author

dciborow commented Jan 8, 2021

This is a duplicate of this issue. I found it after posting this.
#1847

@ichard26
Copy link
Collaborator

Closing since releases since 20.8b1 have wheels which completely sidestep the version being 0.0.0. And even if you're using a sdist (like in this issue), there's nothing on Black's side we can do to fix this (well other than stopping to use setuptools-scm to version our releases which we are definitely not doing).

As mentioned before, make sure you have a recent install of setuptools and setuptools-scm (wheel may be helpful too although I'm not enough of a packaging expert to know) available in your target environment (especially if you disable build isolation).

Also, embedded Pythons aren't supported by Pip and we won't officially support installation where the tooling doesn't support it itself.

@ichard26 ichard26 added C: packaging Installation and packaging of Black T: user support OP looking for assistance or answers to a question labels May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: packaging Installation and packaging of Black T: bug Something isn't working T: user support OP looking for assistance or answers to a question
Projects
None yet
Development

No branches or pull requests

2 participants