diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a3fc9e8..c4743d9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -37,7 +37,7 @@ jobs: parameters: job_name: macos14_cpython image_name: macOS-14 - python_versions: ['3.9', '3.10', '3.11', '3.12'] + python_versions: ['3.9', '3.10', '3.11', '3.12', '3.13'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -68,9 +68,9 @@ jobs: python_versions: ["3.9", "3.10", "3.11", "3.12", "3.13"] test_suites: click_versions: | - 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; + 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; do - pip install click==$clk_ver; + venv/bin/pip install click==$clk_ver; venv/bin/pytest -vvs tests/test_cliutils_progressbar.py; done diff --git a/requirements-dev.txt b/requirements-dev.txt index 4645517..0dc3378 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,4 +1,4 @@ -aboutcode-toolkit==7.2.0 +aboutcode-toolkit==11.1.1 black==23.1.0 bleach==6.0.0 boolean.py==4.0 @@ -10,6 +10,7 @@ exceptiongroup==1.1.0 execnet==1.9.0 importlib-metadata==6.0.0 iniconfig==2.0.0 +isort==6.0.1 jaraco.classes==3.2.3 jeepney==0.8.0 jinja2==3.1.2 @@ -27,6 +28,7 @@ pathspec==0.11.0 pkginfo==1.9.6 platformdirs==3.0.0 pluggy==1.0.0 +pycodestyle==2.13.0 pycparser==2.21 pygments==2.14.0 pytest==7.2.1 diff --git a/requirements.txt b/requirements.txt index 562ae0b..ec24059 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,18 @@ -attrs==22.2.0 -beautifulsoup4==4.13.3 -certifi==2022.12.7 +attrs==25.3.0 +beautifulsoup4==4.13.4 +certifi==2025.4.26 chardet==5.2.0 -click==8.1.3 -idna==3.4 -pip==23.0 -PyYAML==6.0 -requests==2.28.2 -saneyaml==0.6.0 -setuptools==67.1.0 -soupsieve==2.4 +charset-normalizer==3.4.2 +click==8.2.1;python_version>='3.10' +click==8.1.8;python_version<'3.10' +idna==3.10 +pip==25.1.1 +PyYAML==6.0.2 +requests==2.32.2 +saneyaml==0.6.1 +setuptools==80.3.1 +soupsieve==2.7 text-unidecode==1.3 -urllib3==1.26.14 -wheel==0.38.4 +typing_extensions==4.13.2 +urllib3==1.26.20 +wheel==0.38.4 \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 063b149..852bf80 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,9 +40,11 @@ setup_requires = setuptools_scm[toml] >= 4 python_requires = >=3.9 install_requires = - attrs >= 18.1, !=20.1.0 + attrs >= 18.1,!=20.1.0;python_version<'3.11' + attrs >= 22.1.0;python_version>='3.11' Beautifulsoup4[chardet] >= 4.13.0 - click >= 6.7, !=7.0 + click >= 6.7, !=7.0;python_version<'3.10' + click >= 8.2.0;python_version>='3.10' requests[use_chardet_on_py3] >= 2.7.0 saneyaml >= 0.5.2 text_unidecode >= 1.0 @@ -56,7 +58,7 @@ where = src testing = pytest >= 6, != 7.0.0 pytest-xdist >= 2 - aboutcode-toolkit >= 7.0.2 + aboutcode-toolkit >= 11.1.1 pycodestyle >= 2.8.0 twine black @@ -70,4 +72,3 @@ docs = sphinx-autobuild sphinx-rtd-dark-mode>=1.3.0 sphinx-copybutton - diff --git a/src/commoncode/cliutils.py b/src/commoncode/cliutils.py index 8ec419c..026e26b 100644 --- a/src/commoncode/cliutils.py +++ b/src/commoncode/cliutils.py @@ -164,9 +164,20 @@ def format_options(self, ctx, formatter): formatter.write_dl(sorted_records) +class CompatProgressBar(ProgressBar): + # TODO Remove when dropping support for Python 3.9 or Click 8.1. + @property + def is_hidden(self) -> bool: + return self.hidden + + @is_hidden.setter + def is_hidden(self, value: bool) -> None: + self.hidden = value + + # overriden and copied from Click to work around Click woes for # https://github.com/aboutcode-org/scancode-toolkit/issues/2583 -class DebuggedProgressBar(ProgressBar): +class DebuggedProgressBar(CompatProgressBar): # overriden and copied from Click to work around Click woes for # https://github.com/aboutcode-org/scancode-toolkit/issues/2583 def make_step(self, n_steps): @@ -200,7 +211,7 @@ def render_progress(self): return super(EnhancedProgressBar, self).render_progress() -class ProgressLogger(ProgressBar): +class ProgressLogger(CompatProgressBar): """ A subclass of Click ProgressBar providing a verbose line-by-line progress reporting.