question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Black specifies a requirement for click>=7.1.2 but actually requires click>=8.0

See original GitHub issue

Describe the bug

Installing black from the head of the main branch and click<8.0 results in a stack trace whenever the tool is run.

To Reproduce

python3 -m venv black-click-compat-bug
source black-click-compat-bug/bin/activate
python -m pip install \
  "click<8.0" \
  git+https://github.com/psf/black
black --help

Resulting traceback:

Traceback (most recent call last):
  File "/home/enpaul/black-click-compat-bug/bin/black", line 5, in <module>
    from black import patched_main
  File "/home/enpaul/black-click-compat-bug/lib64/python3.10/site-packages/black/__init__.py", line 34, in <module>
    from click.core import ParameterSource
ImportError: cannot import name 'ParameterSource' from 'click.core' (/home/enpaul/black-click-compat-bug/lib64/python3.10/site-packages/click/core.py)

Expected behavior

Black should specify a requirement for click>=8.0.0 (actual specification is for >=7.1.2)

Environment

  • Black’s version: 21.12b1.dev40+g565f9c9
  • OS: Linux (Fedora 35)
  • Python: Python 3.10.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
Duciwucicommented, Mar 4, 2022

This didn’t fix the problem.

I still got the problem with:

python: 3.7 black: 22.1.0 click: 8.0.4

File "/usr/local/bin/black", line 5, in <module>
   from black import patched_main
File "src/black/__init__.py", line 35, in <module>
ImportError: cannot import name 'ParameterSource' from 'click.core' (/usr/local/lib/python3.7/site-packages/click/core.py)
5reactions
mdgilenecommented, Jan 31, 2022

Forcing click>=8.0.0 on users for a dev dependency is pretty harsh. There are MANY application dependencies that are still locked to <=7.1.2.

Due to this I can’t upgrade from the latest Black beta release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typer 0.3.2 has requirement click<7.2.0,>=7.1.1, but you'll have ...
So to resolve this ERROR: typer 0.3.2 has requirement click<7.2.0 ... Try installing a specific click version, pip install click==7.2.0.
Read more >
Should You Use Upper Bound Version Constraints?
First, if you are writing a library, your “users” are specifying your package in their dependencies; if an update breaks them, they can...
Read more >
black · PyPI
Black can be installed by running pip install black . It requires Python 3.7+ to run. If you want to format Jupyter Notebooks,...
Read more >
Acceptance Test Kit - DFNET Research
Tests & Requirements; 1.2. ... Examining data values according to user-specified criteria. 15.6. ... Modify Levels = 0-4. Write = 0-4.
Read more >
Computer Organization
Digital circuits of your computer use voltage levels to represent 1 and 0. ... The combinational circuit is like a black box but...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found