Skip to content

Commit 9a7c592

Browse files
Merge pull request #89 from aboutcode-org/bugfix/progressbar-hidden-propetry
Fix click compatibility issues
2 parents aba7c1b + 48001c3 commit 9a7c592

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
parameters:
3838
job_name: macos14_cpython
3939
image_name: macOS-14
40-
python_versions: ['3.9', '3.10', '3.11', '3.12']
40+
python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13']
4141
test_suites:
4242
all: venv/bin/pytest -n 2 -vvs
4343

@@ -68,9 +68,9 @@ jobs:
6868
python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"]
6969
test_suites:
7070
click_versions: |
71-
for clk_ver in 8.1.7 8.1.6 8.1.5 8.1.4 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.2 8.0.3 8.0.1 7.1.2 7.1.1 7.1 6.7;
71+
for clk_ver in 8.2.0 8.2.1 8.1.8 8.1.7 8.1.6 8.1.5 8.1.4 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.2 8.0.3 8.0.1 7.1.2 7.1.1 7.1 6.7;
7272
do
73-
pip install click==$clk_ver;
73+
venv/bin/pip install click==$clk_ver;
7474
venv/bin/pytest -vvs tests/test_cliutils_progressbar.py;
7575
done
7676

requirements-dev.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
aboutcode-toolkit==7.2.0
1+
aboutcode-toolkit==11.1.1
22
black==23.1.0
33
bleach==6.0.0
44
boolean.py==4.0
@@ -10,6 +10,7 @@ exceptiongroup==1.1.0
1010
execnet==1.9.0
1111
importlib-metadata==6.0.0
1212
iniconfig==2.0.0
13+
isort==6.0.1
1314
jaraco.classes==3.2.3
1415
jeepney==0.8.0
1516
jinja2==3.1.2
@@ -27,6 +28,7 @@ pathspec==0.11.0
2728
pkginfo==1.9.6
2829
platformdirs==3.0.0
2930
pluggy==1.0.0
31+
pycodestyle==2.13.0
3032
pycparser==2.21
3133
pygments==2.14.0
3234
pytest==7.2.1

requirements.txt

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
attrs==22.2.0
2-
beautifulsoup4==4.13.3
3-
certifi==2022.12.7
1+
attrs==25.3.0
2+
beautifulsoup4==4.13.4
3+
certifi==2025.4.26
44
chardet==5.2.0
5-
click==8.1.3
6-
idna==3.4
7-
pip==23.0
8-
PyYAML==6.0
9-
requests==2.28.2
10-
saneyaml==0.6.0
11-
setuptools==67.1.0
12-
soupsieve==2.4
5+
charset-normalizer==3.4.2
6+
click==8.2.1;python_version>='3.10'
7+
click==8.1.8;python_version<'3.10'
8+
idna==3.10
9+
pip==25.1.1
10+
PyYAML==6.0.2
11+
requests==2.32.2
12+
saneyaml==0.6.1
13+
setuptools==80.3.1
14+
soupsieve==2.7
1315
text-unidecode==1.3
14-
urllib3==1.26.14
15-
wheel==0.38.4
16+
typing_extensions==4.13.2
17+
urllib3==1.26.20
18+
wheel==0.38.4

setup.cfg

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ setup_requires = setuptools_scm[toml] >= 4
4040
python_requires = >=3.9
4141

4242
install_requires =
43-
attrs >= 18.1, !=20.1.0
43+
attrs >= 18.1,!=20.1.0;python_version<'3.11'
44+
attrs >= 22.1.0;python_version>='3.11'
4445
Beautifulsoup4[chardet] >= 4.13.0
45-
click >= 6.7, !=7.0
46+
click >= 6.7, !=7.0;python_version<'3.10'
47+
click >= 8.2.0;python_version>='3.10'
4648
requests[use_chardet_on_py3] >= 2.7.0
4749
saneyaml >= 0.5.2
4850
text_unidecode >= 1.0
@@ -56,7 +58,7 @@ where = src
5658
testing =
5759
pytest >= 6, != 7.0.0
5860
pytest-xdist >= 2
59-
aboutcode-toolkit >= 7.0.2
61+
aboutcode-toolkit >= 11.1.1
6062
pycodestyle >= 2.8.0
6163
twine
6264
black
@@ -70,4 +72,3 @@ docs =
7072
sphinx-autobuild
7173
sphinx-rtd-dark-mode>=1.3.0
7274
sphinx-copybutton
73-

src/commoncode/cliutils.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,20 @@ def format_options(self, ctx, formatter):
164164
formatter.write_dl(sorted_records)
165165

166166

167+
class CompatProgressBar(ProgressBar):
168+
# TODO Remove when dropping support for Python 3.9 or Click 8.1.
169+
@property
170+
def is_hidden(self) -> bool:
171+
return self.hidden
172+
173+
@is_hidden.setter
174+
def is_hidden(self, value: bool) -> None:
175+
self.hidden = value
176+
177+
167178
# overriden and copied from Click to work around Click woes for
168179
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
169-
class DebuggedProgressBar(ProgressBar):
180+
class DebuggedProgressBar(CompatProgressBar):
170181
# overriden and copied from Click to work around Click woes for
171182
# https://github.com/aboutcode-org/scancode-toolkit/issues/2583
172183
def make_step(self, n_steps):
@@ -200,7 +211,7 @@ def render_progress(self):
200211
return super(EnhancedProgressBar, self).render_progress()
201212

202213

203-
class ProgressLogger(ProgressBar):
214+
class ProgressLogger(CompatProgressBar):
204215
"""
205216
A subclass of Click ProgressBar providing a verbose line-by-line progress
206217
reporting.

0 commit comments

Comments
 (0)