Black: Missing wheels for Python 3.7 and 3.8

Created on 7 May 2020  路  5Comments  路  Source: psf/black

Describe the bug
Black only provides Python 3.6 wheels for the latest version (19.10b0). There should be 3.7 and 3.8 wheels made available as well.

To Reproduce

Expected behavior
Wheels should be available for py37 and py38 as well

Environment

  • Version: 19.10b0
  • OS and Python version: Linux/Python 3.7.3

Does this bug also happen on master?
N/A

Additional context
Version 18.3a1 (https://pypi.org/project/black/18.3a1/#files) has a py3 wheel, which makes it compatible with all Python3 interpreters. The move to a py36 wheel is understandable (to enforce Black's Python >= 3.6 requirement as I understand), but without additional wheels we cannot use it with Python 3.7.

bug

All 5 comments

@ckataki Is there a specific use case where a py37 or py38 specific wheel is required to install _Black_ 19.10b0 on Python37 or Python38? The available wheel for _Black_ 19.10b0 is a Pure Python wheel, meaning that installers can if necessary, fall back to a wheel built for an older version of Python. Quoting from PEP 425 (which describes the naming of wheels):

It is recommended that installers try to choose the most feature complete built distribution available (the one most specific to the installation environment) by default before falling back to pure Python versions published for older Python releases.

Admittedly, I don't know much about packaging for Python for platforms other than Windows. More context about your use case would be appreciated.

Confirmed it uses black-19.10b0-py36-none-any.whl for Python 3.8:

$ python --version
Python 3.8.2
$ pip uninstall -y black
Found existing installation: black 19.10b0
Uninstalling black-19.10b0:
  Successfully uninstalled black-19.10b0
$ pip install --no-cache-dir black
Collecting black
  Downloading black-19.10b0-py36-none-any.whl (97 kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 97 kB 1.7 MB/s
Requirement already satisfied: regex in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (2020.1.8)
Requirement already satisfied: appdirs in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (1.4.3)
Requirement already satisfied: attrs>=18.1.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (19.3.0)
Requirement already satisfied: click>=6.5 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (7.1.2)
Requirement already satisfied: pathspec<1,>=0.6 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (0.7.0)
Requirement already satisfied: toml>=0.9.4 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (0.10.0)
Requirement already satisfied: typed-ast>=1.4.0 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from black) (1.4.1)
Installing collected packages: black
Successfully installed black-19.10b0

I think this is more an issue with pip < 20.0 and the python version tag. It seems like it was removed with version 20.0 (https://pip.pypa.io/en/stable/news/#id41)

root@a7fadbf0aa80:/# python -V
Python 3.7.7
root@a7fadbf0aa80:/# pip -V
pip 19.0.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
root@a7fadbf0aa80:/# pip download --no-deps --python-version 37 --no-cache --only-binary :all: black==19.10b0
Collecting black==19.10b0
  Could not find a version that satisfies the requirement black==19.10b0 (from versions: 18.3a0, 18.3a1)
No matching distribution found for black==19.10b0
You are using pip version 19.0.3, however version 20.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
root@a7fadbf0aa80:/# pip install --upgrade pip >/dev/null
root@a7fadbf0aa80:/# pip -V
pip 20.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
root@a7fadbf0aa80:/# pip download --no-deps --python-version 37 --no-cache --only-binary :all: black==19.10b0
Collecting black==19.10b0
  Downloading black-19.10b0-py36-none-any.whl (97 kB)
     |鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 97 kB 2.9 MB/s 
  Saved /black-19.10b0-py36-none-any.whl
Successfully downloaded black

As you can see above, this is an issue with pip 19.0.3, but not with pip 20.1. Given that version 20 is fairly new (at least from the perspective of enterprises), upgrades can be slow.
Not sure how easy it would be from your side to release more wheels, but I understand if you would rather not do it.

Confirmed it uses black-19.10b0-py36-none-any.whl for Python 3.8:

If that's the case I'd like to suggest we should just drop explicit version wheels and return to the usual py3 tagged wheel and rely on our python_requires=">=3.6" to enfoce we need >= 3.6. That is here:

To make a normal py3 tagged wheel we just need to drop the following:
https://github.com/psf/black/blob/master/setup.cfg#L2

Happy to do the PR is we all agree.

@cooperlees I agree, makes sense.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brettcannon picture brettcannon  路  3Comments

testvinder picture testvinder  路  3Comments

decibyte picture decibyte  路  3Comments

nottrobin picture nottrobin  路  3Comments

quodlibetor picture quodlibetor  路  3Comments