From bdccbd9986c145cf0ab8f31596426a1dba90ce72 Mon Sep 17 00:00:00 2001 From: Remco de Boer <29308176+redeboer@users.noreply.github.com> Date: Wed, 26 Jul 2023 17:40:49 -0400 Subject: [PATCH] MAINT: update pip constraints and pre-commit (#192) * FIX: update allowed PR/issue labels * MAINT: use future annotations where possible (not with pydantic) --------- Co-authored-by: GitHub Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .constraints/py3.10.txt | 83 ++++++++++++++--------------- .constraints/py3.11.txt | 83 ++++++++++++++--------------- .constraints/py3.7.txt | 50 +++++++++--------- .constraints/py3.8.txt | 85 +++++++++++++++--------------- .constraints/py3.9.txt | 85 +++++++++++++++--------------- .github/workflows/ci.yml | 3 ++ .github/workflows/pr-linting.yml | 5 +- .pre-commit-config.yaml | 18 +++---- .vscode/settings.json | 1 + docs/conf.py | 27 +++++----- pyproject.toml | 4 ++ src/pwa_pages/project_inventory.py | 2 +- src/pwa_pages/repo/__init__.py | 17 +++--- src/pwa_pages/repo/_github.py | 13 +++-- src/pwa_pages/repo/_gitlab.py | 15 ++++-- 15 files changed, 254 insertions(+), 237 deletions(-) diff --git a/.constraints/py3.10.txt b/.constraints/py3.10.txt index bc2ed096..516558a5 100644 --- a/.constraints/py3.10.txt +++ b/.constraints/py3.10.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.10.txt --strip-extras setup.py +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.10.txt --strip-extras # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -12,49 +12,49 @@ argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 arrow==1.2.3 asttokens==2.2.1 -async-lru==2.0.2 +async-lru==2.0.3 attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 -certifi==2023.5.7 +certifi==2023.7.22 cffi==1.15.1 cfgv==3.3.1 chardet==5.1.0 -charset-normalizer==3.1.0 -click==8.1.4 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 comm==0.1.3 contourpy==1.1.0 coverage==7.2.7 -cryptography==41.0.1 +cryptography==41.0.2 cycler==0.11.0 -dataproperty==1.0.0 +dataproperty==1.0.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 deprecated==1.2.14 -distlib==0.3.6 +distlib==0.3.7 docutils==0.19 dominate==2.8.0 exceptiongroup==1.1.2 -execnet==1.9.0 +execnet==2.0.2 executing==1.2.0 -fastjsonschema==2.17.1 -feynman==2.0.2 +fastjsonschema==2.18.0 +feynman==2.1.0 filelock==3.12.2 -fonttools==4.40.0 +fonttools==4.41.1 fqdn==1.5.1 greenlet==2.0.2 -identify==2.5.24 +identify==2.5.26 idna==3.4 imagesize==1.4.1 -importlib-metadata==6.7.0 +importlib-metadata==6.8.0 iniconfig==2.0.0 -ipykernel==6.24.0 +ipykernel==6.25.0 ipython==8.14.0 ipython-genutils==0.2.0 ipywidgets==8.0.7 @@ -63,8 +63,8 @@ jedi==0.18.2 jinja2==3.1.2 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.18.0 -jsonschema-specifications==2023.6.1 +jsonschema==4.18.4 +jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-cache==0.6.1 jupyter-client==8.3.0 @@ -74,11 +74,11 @@ jupyter-events==0.6.3 jupyter-lsp==2.2.0 jupyter-server==2.7.0 jupyter-server-terminals==0.4.4 -jupyterlab==4.0.2 +jupyterlab==4.0.3 jupyterlab-code-formatter==2.2.1 jupyterlab-myst==2.0.1 jupyterlab-pygments==0.2.2 -jupyterlab-server==2.23.0 +jupyterlab-server==2.24.0 jupyterlab-widgets==3.0.8 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -96,13 +96,12 @@ mypy==1.4.1 mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 -nbclassic==1.0.0 nbclient==0.7.4 -nbconvert==7.6.0 -nbformat==5.9.0 +nbconvert==7.7.3 +nbformat==5.9.1 nest-asyncio==1.5.6 nodeenv==1.8.0 -notebook==6.5.4 +notebook==7.0.0 notebook-shim==0.2.3 numpy==1.23.5 overrides==7.3.1 @@ -110,14 +109,14 @@ packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.11.1 -pathvalidate==3.0.0 +pathvalidate==3.1.0 pexpect==4.8.0 pickleshare==0.7.5 pillow==10.0.0 -platformdirs==3.8.1 +platformdirs==3.9.1 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -125,12 +124,12 @@ pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.2 pycparser==2.21 -pydantic==2.0.2 -pydantic-core==2.1.2 +pydantic==2.1.1 +pydantic-core==2.4.0 pydata-sphinx-theme==0.13.3 pygithub==1.59.0 pygments==2.15.1 -pyjwt==2.7.0 +pyjwt==2.8.0 pynacl==1.5.0 pyparsing==3.0.9 pyproject-api==1.5.3 @@ -142,17 +141,17 @@ python-dateutil==2.8.2 python-gitlab==3.15.0 python-json-logger==2.0.7 pytz==2023.3 -pyyaml==6.0 +pyyaml==6.0.1 pyzmq==25.1.0 qtconsole==5.4.3 qtpy==2.3.1 -referencing==0.29.1 +referencing==0.30.0 requests==2.31.0 requests-toolbelt==1.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.8.8 -ruff==0.0.277 +rpds-py==0.9.2 +ruff==0.0.280 send2trash==1.8.2 six==1.16.0 sniffio==1.3.0 @@ -175,7 +174,7 @@ sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -sqlalchemy==2.0.18 +sqlalchemy==2.0.19 stack-data==0.6.2 sympy==1.12 tabledata==1.3.1 @@ -190,21 +189,21 @@ traitlets==5.9.0 typepy==1.3.1 types-docutils==0.20.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-pyyaml==6.0.12.10 -types-setuptools==68.0.0.1 +types-python-dateutil==2.8.19.14 +types-pyyaml==6.0.12.11 +types-setuptools==68.0.0.3 typing-extensions==4.7.1 uri-template==1.3.0 -urllib3==2.0.3 -virtualenv==20.23.1 +urllib3==2.0.4 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -wheel==0.40.0 +wheel==0.41.0 widgetsnbextension==4.0.8 wrapt==1.15.0 -zipp==3.15.0 +zipp==3.16.2 # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/.constraints/py3.11.txt b/.constraints/py3.11.txt index 1e4c37d9..ca959304 100644 --- a/.constraints/py3.11.txt +++ b/.constraints/py3.11.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.11 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.11.txt --strip-extras setup.py +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.11.txt --strip-extras # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -12,48 +12,48 @@ argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 arrow==1.2.3 asttokens==2.2.1 -async-lru==2.0.2 +async-lru==2.0.3 attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 -certifi==2023.5.7 +certifi==2023.7.22 cffi==1.15.1 cfgv==3.3.1 chardet==5.1.0 -charset-normalizer==3.1.0 -click==8.1.4 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 comm==0.1.3 contourpy==1.1.0 coverage==7.2.7 -cryptography==41.0.1 +cryptography==41.0.2 cycler==0.11.0 -dataproperty==1.0.0 +dataproperty==1.0.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 deprecated==1.2.14 -distlib==0.3.6 +distlib==0.3.7 docutils==0.19 dominate==2.8.0 -execnet==1.9.0 +execnet==2.0.2 executing==1.2.0 -fastjsonschema==2.17.1 -feynman==2.0.2 +fastjsonschema==2.18.0 +feynman==2.1.0 filelock==3.12.2 -fonttools==4.40.0 +fonttools==4.41.1 fqdn==1.5.1 greenlet==2.0.2 -identify==2.5.24 +identify==2.5.26 idna==3.4 imagesize==1.4.1 -importlib-metadata==6.7.0 +importlib-metadata==6.8.0 iniconfig==2.0.0 -ipykernel==6.24.0 +ipykernel==6.25.0 ipython==8.14.0 ipython-genutils==0.2.0 ipywidgets==8.0.7 @@ -62,8 +62,8 @@ jedi==0.18.2 jinja2==3.1.2 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.18.0 -jsonschema-specifications==2023.6.1 +jsonschema==4.18.4 +jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-cache==0.6.1 jupyter-client==8.3.0 @@ -73,11 +73,11 @@ jupyter-events==0.6.3 jupyter-lsp==2.2.0 jupyter-server==2.7.0 jupyter-server-terminals==0.4.4 -jupyterlab==4.0.2 +jupyterlab==4.0.3 jupyterlab-code-formatter==2.2.1 jupyterlab-myst==2.0.1 jupyterlab-pygments==0.2.2 -jupyterlab-server==2.23.0 +jupyterlab-server==2.24.0 jupyterlab-widgets==3.0.8 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -95,13 +95,12 @@ mypy==1.4.1 mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 -nbclassic==1.0.0 nbclient==0.7.4 -nbconvert==7.6.0 -nbformat==5.9.0 +nbconvert==7.7.3 +nbformat==5.9.1 nest-asyncio==1.5.6 nodeenv==1.8.0 -notebook==6.5.4 +notebook==7.0.0 notebook-shim==0.2.3 numpy==1.23.5 overrides==7.3.1 @@ -109,14 +108,14 @@ packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.11.1 -pathvalidate==3.0.0 +pathvalidate==3.1.0 pexpect==4.8.0 pickleshare==0.7.5 pillow==10.0.0 -platformdirs==3.8.1 +platformdirs==3.9.1 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -124,12 +123,12 @@ pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.2 pycparser==2.21 -pydantic==2.0.2 -pydantic-core==2.1.2 +pydantic==2.1.1 +pydantic-core==2.4.0 pydata-sphinx-theme==0.13.3 pygithub==1.59.0 pygments==2.15.1 -pyjwt==2.7.0 +pyjwt==2.8.0 pynacl==1.5.0 pyparsing==3.0.9 pyproject-api==1.5.3 @@ -141,17 +140,17 @@ python-dateutil==2.8.2 python-gitlab==3.15.0 python-json-logger==2.0.7 pytz==2023.3 -pyyaml==6.0 +pyyaml==6.0.1 pyzmq==25.1.0 qtconsole==5.4.3 qtpy==2.3.1 -referencing==0.29.1 +referencing==0.30.0 requests==2.31.0 requests-toolbelt==1.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.8.8 -ruff==0.0.277 +rpds-py==0.9.2 +ruff==0.0.280 send2trash==1.8.2 six==1.16.0 sniffio==1.3.0 @@ -174,7 +173,7 @@ sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -sqlalchemy==2.0.18 +sqlalchemy==2.0.19 stack-data==0.6.2 sympy==1.12 tabledata==1.3.1 @@ -188,21 +187,21 @@ traitlets==5.9.0 typepy==1.3.1 types-docutils==0.20.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-pyyaml==6.0.12.10 -types-setuptools==68.0.0.1 +types-python-dateutil==2.8.19.14 +types-pyyaml==6.0.12.11 +types-setuptools==68.0.0.3 typing-extensions==4.7.1 uri-template==1.3.0 -urllib3==2.0.3 -virtualenv==20.23.1 +urllib3==2.0.4 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -wheel==0.40.0 +wheel==0.41.0 widgetsnbextension==4.0.8 wrapt==1.15.0 -zipp==3.15.0 +zipp==3.16.2 # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/.constraints/py3.7.txt b/.constraints/py3.7.txt index eec00a7f..c698aa70 100644 --- a/.constraints/py3.7.txt +++ b/.constraints/py3.7.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.7 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.7.txt --strip-extras setup.py +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.7.txt --resolver=backtracking --strip-extras # accessible-pygments==0.0.4 aiofiles==22.1.0 @@ -21,29 +21,29 @@ black==23.3.0 bleach==6.0.0 cached-property==1.5.2 cachetools==5.3.1 -certifi==2023.5.7 +certifi==2023.7.22 cffi==1.15.1 cfgv==3.3.1 chardet==5.1.0 -charset-normalizer==3.1.0 -click==8.1.4 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 coverage==7.2.7 -cryptography==41.0.1 +cryptography==41.0.2 cycler==0.11.0 -dataproperty==1.0.0 +dataproperty==1.0.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 deprecated==1.2.14 -distlib==0.3.6 +distlib==0.3.7 docutils==0.19 dominate==2.8.0 entrypoints==0.4 exceptiongroup==1.1.2 -execnet==1.9.0 -fastjsonschema==2.17.1 -feynman==2.0.2 +execnet==2.0.2 +fastjsonschema==2.18.0 +feynman==2.1.0 filelock==3.12.2 fonttools==4.38.0 fqdn==1.5.1 @@ -78,7 +78,7 @@ jupyterlab==3.6.5 jupyterlab-code-formatter==2.2.1 jupyterlab-myst==1.2.0 jupyterlab-pygments==0.2.2 -jupyterlab-server==2.23.0 +jupyterlab-server==2.24.0 jupyterlab-widgets==3.0.8 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -109,27 +109,27 @@ packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.11.1 -pathvalidate==3.0.0 +pathvalidate==3.1.0 pexpect==4.8.0 pickleshare==0.7.5 pillow==9.5.0 pkgutil-resolve-name==1.3.10 -platformdirs==3.8.1 +platformdirs==3.9.1 pluggy==1.2.0 pre-commit==2.21.0 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 pybtex==0.24.0 pybtex-docutils==1.0.2 pycparser==2.21 -pydantic==2.0.2 -pydantic-core==2.1.2 +pydantic==2.1.1 +pydantic-core==2.4.0 pydata-sphinx-theme==0.13.3 pygithub==1.59.0 pygments==2.15.1 -pyjwt==2.7.0 +pyjwt==2.8.0 pynacl==1.5.0 pyparsing==3.1.0 pyproject-api==1.5.3 @@ -142,7 +142,7 @@ python-dateutil==2.8.2 python-gitlab==3.15.0 python-json-logger==2.0.7 pytz==2023.3 -pyyaml==6.0 +pyyaml==6.0.1 pyzmq==25.1.0 qtconsole==5.4.3 qtpy==2.3.1 @@ -150,7 +150,7 @@ requests==2.31.0 requests-toolbelt==1.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -ruff==0.0.277 +ruff==0.0.280 send2trash==1.8.2 six==1.16.0 sniffio==1.3.0 @@ -188,18 +188,18 @@ typed-ast==1.5.5 typepy==1.3.1 types-docutils==0.20.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-pyyaml==6.0.12.10 -types-setuptools==68.0.0.1 +types-python-dateutil==2.8.19.14 +types-pyyaml==6.0.12.11 +types-setuptools==68.0.0.3 typing-extensions==4.7.1 uri-template==1.3.0 -urllib3==2.0.3 -virtualenv==20.23.1 +urllib3==2.0.4 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -wheel==0.40.0 +wheel==0.41.0 widgetsnbextension==4.0.8 wrapt==1.15.0 y-py==0.5.9 diff --git a/.constraints/py3.8.txt b/.constraints/py3.8.txt index 7a4801fc..4e9bbf53 100644 --- a/.constraints/py3.8.txt +++ b/.constraints/py3.8.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.8.txt --strip-extras setup.py +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.8.txt --strip-extras # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -12,50 +12,50 @@ argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 arrow==1.2.3 asttokens==2.2.1 -async-lru==2.0.2 +async-lru==2.0.3 attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 -certifi==2023.5.7 +certifi==2023.7.22 cffi==1.15.1 cfgv==3.3.1 chardet==5.1.0 -charset-normalizer==3.1.0 -click==8.1.4 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 comm==0.1.3 contourpy==1.1.0 coverage==7.2.7 -cryptography==41.0.1 +cryptography==41.0.2 cycler==0.11.0 -dataproperty==1.0.0 +dataproperty==1.0.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 deprecated==1.2.14 -distlib==0.3.6 +distlib==0.3.7 docutils==0.19 dominate==2.8.0 exceptiongroup==1.1.2 -execnet==1.9.0 +execnet==2.0.2 executing==1.2.0 -fastjsonschema==2.17.1 -feynman==2.0.2 +fastjsonschema==2.18.0 +feynman==2.1.0 filelock==3.12.2 -fonttools==4.40.0 +fonttools==4.41.1 fqdn==1.5.1 greenlet==2.0.2 -identify==2.5.24 +identify==2.5.26 idna==3.4 imagesize==1.4.1 -importlib-metadata==6.7.0 -importlib-resources==5.12.0 +importlib-metadata==6.8.0 +importlib-resources==6.0.0 iniconfig==2.0.0 -ipykernel==6.24.0 +ipykernel==6.25.0 ipython==8.12.2 ipython-genutils==0.2.0 ipywidgets==8.0.7 @@ -64,8 +64,8 @@ jedi==0.18.2 jinja2==3.1.2 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.18.0 -jsonschema-specifications==2023.6.1 +jsonschema==4.18.4 +jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-cache==0.6.1 jupyter-client==8.3.0 @@ -75,11 +75,11 @@ jupyter-events==0.6.3 jupyter-lsp==2.2.0 jupyter-server==2.7.0 jupyter-server-terminals==0.4.4 -jupyterlab==4.0.2 +jupyterlab==4.0.3 jupyterlab-code-formatter==2.2.1 jupyterlab-myst==2.0.1 jupyterlab-pygments==0.2.2 -jupyterlab-server==2.23.0 +jupyterlab-server==2.24.0 jupyterlab-widgets==3.0.8 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -97,13 +97,12 @@ mypy==1.4.1 mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 -nbclassic==1.0.0 nbclient==0.7.4 -nbconvert==7.6.0 -nbformat==5.9.0 +nbconvert==7.7.3 +nbformat==5.9.1 nest-asyncio==1.5.6 nodeenv==1.8.0 -notebook==6.5.4 +notebook==7.0.0 notebook-shim==0.2.3 numpy==1.23.5 overrides==7.3.1 @@ -111,15 +110,15 @@ packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.11.1 -pathvalidate==3.0.0 +pathvalidate==3.1.0 pexpect==4.8.0 pickleshare==0.7.5 pillow==10.0.0 pkgutil-resolve-name==1.3.10 -platformdirs==3.8.1 +platformdirs==3.9.1 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -127,12 +126,12 @@ pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.2 pycparser==2.21 -pydantic==2.0.2 -pydantic-core==2.1.2 +pydantic==2.1.1 +pydantic-core==2.4.0 pydata-sphinx-theme==0.13.3 pygithub==1.59.0 pygments==2.15.1 -pyjwt==2.7.0 +pyjwt==2.8.0 pynacl==1.5.0 pyparsing==3.0.9 pyproject-api==1.5.3 @@ -144,17 +143,17 @@ python-dateutil==2.8.2 python-gitlab==3.15.0 python-json-logger==2.0.7 pytz==2023.3 -pyyaml==6.0 +pyyaml==6.0.1 pyzmq==25.1.0 qtconsole==5.4.3 qtpy==2.3.1 -referencing==0.29.1 +referencing==0.30.0 requests==2.31.0 requests-toolbelt==1.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.8.8 -ruff==0.0.277 +rpds-py==0.9.2 +ruff==0.0.280 send2trash==1.8.2 six==1.16.0 sniffio==1.3.0 @@ -177,7 +176,7 @@ sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -sqlalchemy==2.0.18 +sqlalchemy==2.0.19 stack-data==0.6.2 sympy==1.12 tabledata==1.3.1 @@ -192,21 +191,21 @@ traitlets==5.9.0 typepy==1.3.1 types-docutils==0.20.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-pyyaml==6.0.12.10 -types-setuptools==68.0.0.1 +types-python-dateutil==2.8.19.14 +types-pyyaml==6.0.12.11 +types-setuptools==68.0.0.3 typing-extensions==4.7.1 uri-template==1.3.0 -urllib3==2.0.3 -virtualenv==20.23.1 +urllib3==2.0.4 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -wheel==0.40.0 +wheel==0.41.0 widgetsnbextension==4.0.8 wrapt==1.15.0 -zipp==3.15.0 +zipp==3.16.2 # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/.constraints/py3.9.txt b/.constraints/py3.9.txt index 7166edbb..8ce5bc22 100644 --- a/.constraints/py3.9.txt +++ b/.constraints/py3.9.txt @@ -2,7 +2,7 @@ # This file is autogenerated by pip-compile with Python 3.9 # by the following command: # -# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.9.txt --strip-extras setup.py +# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.9.txt --strip-extras # accessible-pygments==0.0.4 alabaster==0.7.13 @@ -12,50 +12,50 @@ argon2-cffi==21.3.0 argon2-cffi-bindings==21.2.0 arrow==1.2.3 asttokens==2.2.1 -async-lru==2.0.2 +async-lru==2.0.3 attrs==23.1.0 babel==2.12.1 backcall==0.2.0 beautifulsoup4==4.12.2 -black==23.3.0 +black==23.7.0 bleach==6.0.0 cachetools==5.3.1 -certifi==2023.5.7 +certifi==2023.7.22 cffi==1.15.1 cfgv==3.3.1 chardet==5.1.0 -charset-normalizer==3.1.0 -click==8.1.4 +charset-normalizer==3.2.0 +click==8.1.6 colorama==0.4.6 comm==0.1.3 contourpy==1.1.0 coverage==7.2.7 -cryptography==41.0.1 +cryptography==41.0.2 cycler==0.11.0 -dataproperty==1.0.0 +dataproperty==1.0.1 debugpy==1.6.7 decorator==5.1.1 defusedxml==0.7.1 deprecated==1.2.14 -distlib==0.3.6 +distlib==0.3.7 docutils==0.19 dominate==2.8.0 exceptiongroup==1.1.2 -execnet==1.9.0 +execnet==2.0.2 executing==1.2.0 -fastjsonschema==2.17.1 -feynman==2.0.2 +fastjsonschema==2.18.0 +feynman==2.1.0 filelock==3.12.2 -fonttools==4.40.0 +fonttools==4.41.1 fqdn==1.5.1 greenlet==2.0.2 -identify==2.5.24 +identify==2.5.26 idna==3.4 imagesize==1.4.1 -importlib-metadata==6.7.0 -importlib-resources==5.12.0 +importlib-metadata==6.8.0 +importlib-resources==6.0.0 iniconfig==2.0.0 -ipykernel==6.24.0 +ipykernel==6.25.0 ipython==8.14.0 ipython-genutils==0.2.0 ipywidgets==8.0.7 @@ -64,8 +64,8 @@ jedi==0.18.2 jinja2==3.1.2 json5==0.9.14 jsonpointer==2.4 -jsonschema==4.18.0 -jsonschema-specifications==2023.6.1 +jsonschema==4.18.4 +jsonschema-specifications==2023.7.1 jupyter==1.0.0 jupyter-cache==0.6.1 jupyter-client==8.3.0 @@ -75,11 +75,11 @@ jupyter-events==0.6.3 jupyter-lsp==2.2.0 jupyter-server==2.7.0 jupyter-server-terminals==0.4.4 -jupyterlab==4.0.2 +jupyterlab==4.0.3 jupyterlab-code-formatter==2.2.1 jupyterlab-myst==2.0.1 jupyterlab-pygments==0.2.2 -jupyterlab-server==2.23.0 +jupyterlab-server==2.24.0 jupyterlab-widgets==3.0.8 kiwisolver==1.4.4 latexcodec==2.0.1 @@ -97,13 +97,12 @@ mypy==1.4.1 mypy-extensions==1.0.0 myst-nb==0.17.2 myst-parser==0.18.1 -nbclassic==1.0.0 nbclient==0.7.4 -nbconvert==7.6.0 -nbformat==5.9.0 +nbconvert==7.7.3 +nbformat==5.9.1 nest-asyncio==1.5.6 nodeenv==1.8.0 -notebook==6.5.4 +notebook==7.0.0 notebook-shim==0.2.3 numpy==1.23.5 overrides==7.3.1 @@ -111,14 +110,14 @@ packaging==23.1 pandocfilters==1.5.0 parso==0.8.3 pathspec==0.11.1 -pathvalidate==3.0.0 +pathvalidate==3.1.0 pexpect==4.8.0 pickleshare==0.7.5 pillow==10.0.0 -platformdirs==3.8.1 +platformdirs==3.9.1 pluggy==1.2.0 pre-commit==3.3.3 -prometheus-client==0.17.0 +prometheus-client==0.17.1 prompt-toolkit==3.0.39 psutil==5.9.5 ptyprocess==0.7.0 @@ -126,12 +125,12 @@ pure-eval==0.2.2 pybtex==0.24.0 pybtex-docutils==1.0.2 pycparser==2.21 -pydantic==2.0.2 -pydantic-core==2.1.2 +pydantic==2.1.1 +pydantic-core==2.4.0 pydata-sphinx-theme==0.13.3 pygithub==1.59.0 pygments==2.15.1 -pyjwt==2.7.0 +pyjwt==2.8.0 pynacl==1.5.0 pyparsing==3.0.9 pyproject-api==1.5.3 @@ -143,17 +142,17 @@ python-dateutil==2.8.2 python-gitlab==3.15.0 python-json-logger==2.0.7 pytz==2023.3 -pyyaml==6.0 +pyyaml==6.0.1 pyzmq==25.1.0 qtconsole==5.4.3 qtpy==2.3.1 -referencing==0.29.1 +referencing==0.30.0 requests==2.31.0 requests-toolbelt==1.0.0 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 -rpds-py==0.8.8 -ruff==0.0.277 +rpds-py==0.9.2 +ruff==0.0.280 send2trash==1.8.2 six==1.16.0 sniffio==1.3.0 @@ -176,7 +175,7 @@ sphinxcontrib-htmlhelp==2.0.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==1.0.3 sphinxcontrib-serializinghtml==1.1.5 -sqlalchemy==2.0.18 +sqlalchemy==2.0.19 stack-data==0.6.2 sympy==1.12 tabledata==1.3.1 @@ -191,21 +190,21 @@ traitlets==5.9.0 typepy==1.3.1 types-docutils==0.20.0.1 types-pkg-resources==0.1.3 -types-python-dateutil==2.8.19.13 -types-pyyaml==6.0.12.10 -types-setuptools==68.0.0.1 +types-python-dateutil==2.8.19.14 +types-pyyaml==6.0.12.11 +types-setuptools==68.0.0.3 typing-extensions==4.7.1 uri-template==1.3.0 -urllib3==2.0.3 -virtualenv==20.23.1 +urllib3==2.0.4 +virtualenv==20.24.2 wcwidth==0.2.6 webcolors==1.13 webencodings==0.5.1 websocket-client==1.6.1 -wheel==0.40.0 +wheel==0.41.0 widgetsnbextension==4.0.8 wrapt==1.15.0 -zipp==3.15.0 +zipp==3.16.2 # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c2b63f1..dea11f5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,9 @@ on: jobs: doc: uses: ComPWA/actions/.github/workflows/ci-docs.yml@v1 + permissions: + pages: write + id-token: write with: specific-pip-packages: ${{ inputs.specific-pip-packages }} pytest: diff --git a/.github/workflows/pr-linting.yml b/.github/workflows/pr-linting.yml index 9ee6fe93..e37819b9 100644 --- a/.github/workflows/pr-linting.yml +++ b/.github/workflows/pr-linting.yml @@ -18,9 +18,8 @@ jobs: steps: - uses: docker://agilepathway/pull-request-label-checker:latest with: - any_of: | - Bug,✨ Feature,⚠️ Interface,📝 Docs,🔨 Maintenance,🖱️ DX,📖 Analysis, - 📖 Software,📖 Theory + any_of: >- + 🐛 Bug,✨ Feature,⚙️ Enhancement,⚠️ Interface,❗ Behavior,📝 Docs,🔨 Maintenance,🖱️ DX none_of: ❌ Won't fix,💫 Good first issue repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68ca368f..50e0ba37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,7 +38,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.0.189 + rev: 0.0.192 hooks: - id: check-dev-files args: @@ -64,17 +64,17 @@ repos: - --fix - repo: https://github.com/psf/black - rev: 23.3.0 + rev: 23.7.0 hooks: - id: black - repo: https://github.com/asottile/blacken-docs - rev: 1.14.0 + rev: 1.15.0 hooks: - id: blacken-docs - repo: https://github.com/sirosen/check-jsonschema - rev: 0.23.2 + rev: 0.23.3 hooks: - id: check-jsonschema name: Check project inventory YAML files @@ -84,7 +84,7 @@ repos: args: ["--schemafile", "./docs/software/project-inventory-schema.json"] - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v6.31.0 + rev: v6.31.1 hooks: - id: cspell @@ -144,26 +144,26 @@ repos: - id: prettier - repo: https://github.com/ComPWA/mirrors-pyright - rev: v1.1.316 + rev: v1.1.318 hooks: - id: pyright - repo: https://github.com/asottile/pyupgrade - rev: v3.8.0 + rev: v3.9.0 hooks: - id: pyupgrade args: - --py37-plus - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.277 + rev: v0.0.280 hooks: - id: ruff args: - --fix - repo: https://github.com/ComPWA/mirrors-taplo - rev: v0.8.0 + rev: v0.8.1 hooks: - id: taplo diff --git a/.vscode/settings.json b/.vscode/settings.json index fda29aa4..6944319e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -39,6 +39,7 @@ "git.rebaseWhenSync": true, "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], "livePreview.defaultPreviewPath": "docs/_build/html", + "mypy-type-checker.args": ["--config-file", "pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", "myst.preview.extensions": ["amsmath", "colon_fence", "dollarmath", "tasklist"], "python.analysis.autoImportCompletions": false, diff --git a/docs/conf.py b/docs/conf.py index 2f4548cd..2f0df179 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,6 +5,7 @@ https://www.sphinx-doc.org/en/master/usage/configuration.html """ # pyright: reportMissingImports=false +from __future__ import annotations import dataclasses import os @@ -12,14 +13,10 @@ import sys from datetime import datetime from functools import lru_cache -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import TYPE_CHECKING, Any import sphinxcontrib.bibtex.plugin # type: ignore[import] from docutils import nodes -from docutils.nodes import Node as docutils_Node -from docutils.nodes import system_message -from docutils.parsers.rst.states import Inliner -from pybtex.database import Entry from pybtex.plugin import register_plugin from pybtex.richtext import BaseText, Tag, Text from pybtex.style.formatting.unsrt import Style as UnsrtStyle @@ -34,10 +31,16 @@ sentence, words, ) -from sphinx.application import Sphinx -from sphinx.util.typing import RoleFunction from sphinxcontrib.bibtex.style.referencing.author_year import AuthorYearReferenceStyle +if TYPE_CHECKING: + from docutils.nodes import Node as docutils_Node + from docutils.nodes import system_message + from docutils.parsers.rst.states import Inliner + from pybtex.database import Entry + from sphinx.application import Sphinx + from sphinx.util.typing import RoleFunction + if sys.version_info < (3, 8): from importlib_metadata import PackageNotFoundError from importlib_metadata import version as get_package_version @@ -316,7 +319,7 @@ def print_once(message: str) -> None: # Add roles to simplify external links -def setup(app: Sphinx) -> Dict[str, Any]: +def setup(app: Sphinx) -> dict[str, Any]: app.add_role( "wiki", wikilink("https://en.wikipedia.org/wiki/%s"), @@ -334,9 +337,9 @@ def role( # noqa: PLR0913 text: str, lineno: int, inliner: Inliner, - options: Optional[Dict] = None, - content: Optional[List[str]] = None, - ) -> Tuple[List[docutils_Node], List[system_message]]: + options: dict | None = None, + content: list[str] | None = None, + ) -> tuple[list[docutils_Node], list[system_message]]: output_text = text output_text = output_text.replace("_", " ") url = pattern % (text,) @@ -353,7 +356,7 @@ def role( # noqa: PLR0913 class NoCommaReferenceStyle( AuthorYearReferenceStyle # pyright: ignore[reportUntypedBaseClass] ): - author_year_sep: Union["BaseText", str] = " " + author_year_sep: BaseText | str = " " sphinxcontrib.bibtex.plugin.register_plugin( diff --git a/pyproject.toml b/pyproject.toml index 8f9eceb9..77b49f9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -196,6 +196,10 @@ task-tags = ["cspell"] "T201", ] "setup.py" = ["D100"] +"src/pwa_pages/project_inventory.py" = [ + "FA100", + "UP00", +] "tests/*" = [ "D", "INP001", diff --git a/src/pwa_pages/project_inventory.py b/src/pwa_pages/project_inventory.py index 71412506..8bfc3b6e 100644 --- a/src/pwa_pages/project_inventory.py +++ b/src/pwa_pages/project_inventory.py @@ -29,7 +29,7 @@ def to_html_table( min_percentage: float = 2.5, hide_columns: Optional[Iterable[str]] = None, ) -> str: - header_to_formatters: Dict[str, Callable[[Project], str]] = { # noqa: FA100 + header_to_formatters: Dict[str, Callable[[Project], str]] = { "Project": _create_project_entry, "Collaboration": partial(_format_collaboration, inventory=inventory), "Since": _fetch_first_commit_year if fetch else lambda _: "", diff --git a/src/pwa_pages/repo/__init__.py b/src/pwa_pages/repo/__init__.py index 4309d539..b8c2ab63 100644 --- a/src/pwa_pages/repo/__init__.py +++ b/src/pwa_pages/repo/__init__.py @@ -1,7 +1,7 @@ """Get information about a GitHub and GitLab repositories.""" +from __future__ import annotations -from datetime import datetime -from typing import Dict, List, Optional, Union +from typing import TYPE_CHECKING import attr @@ -9,21 +9,24 @@ from ._github import GithubRepository, extract_github_repo_name, get_github_repo from ._gitlab import GitlabProject, get_gitlab_repo, split_gitlab_repo_url +if TYPE_CHECKING: + from datetime import datetime + @attr.s(frozen=True, auto_attribs=True) class Repo: name: str url: str full_name: str - _languages: Dict[str, float] + _languages: dict[str, float] first_commit: datetime latest_commit: datetime @property - def languages(self) -> List[str]: + def languages(self) -> list[str]: return list(self._languages) - def filter_languages(self, min_percentage: float) -> List[str]: + def filter_languages(self, min_percentage: float) -> list[str]: return [ language for language, percentage in self._languages.items() @@ -31,7 +34,7 @@ def filter_languages(self, min_percentage: float) -> List[str]: ] -def get_repo(url: str) -> Optional[Repo]: +def get_repo(url: str) -> Repo | None: repo = _fetch_repository(url) if isinstance(repo, GithubRepository): return Repo( @@ -56,7 +59,7 @@ def get_repo(url: str) -> Optional[Repo]: def _fetch_repository( url: str, -) -> Optional[Union[GitlabProject, GithubRepository]]: +) -> GitlabProject | GithubRepository | None: if extract_github_repo_name(url): return get_github_repo(url) gitlab_tuple = split_gitlab_repo_url(url) diff --git a/src/pwa_pages/repo/_github.py b/src/pwa_pages/repo/_github.py index 49376522..0347206d 100644 --- a/src/pwa_pages/repo/_github.py +++ b/src/pwa_pages/repo/_github.py @@ -1,14 +1,17 @@ +from __future__ import annotations + import os import re -from datetime import datetime from functools import lru_cache -from typing import TYPE_CHECKING, Dict, Optional +from typing import TYPE_CHECKING from dateutil.parser import parse as parse_date from github import Github -from github.Repository import Repository as GithubRepository +from github.Repository import Repository as GithubRepository # noqa: TCH002 if TYPE_CHECKING: + from datetime import datetime + from github.Commit import Commit @@ -64,7 +67,7 @@ def get_last_modified(repo: GithubRepository) -> datetime: @lru_cache() -def get_languages(repo: GithubRepository) -> Dict[str, float]: +def get_languages(repo: GithubRepository) -> dict[str, float]: languages = repo.get_languages() total_lines = sum(languages.values()) return { @@ -73,7 +76,7 @@ def get_languages(repo: GithubRepository) -> Dict[str, float]: @lru_cache() -def __get_github(token: Optional[str] = None) -> Github: +def __get_github(token: str | None = None) -> Github: if token is None: token = os.environ.get("GITHUB_TOKEN") return Github(login_or_token=token) diff --git a/src/pwa_pages/repo/_gitlab.py b/src/pwa_pages/repo/_gitlab.py index 136a00e4..2b7b3c6c 100644 --- a/src/pwa_pages/repo/_gitlab.py +++ b/src/pwa_pages/repo/_gitlab.py @@ -1,12 +1,17 @@ +from __future__ import annotations + import re -from datetime import datetime from functools import lru_cache -from typing import Optional, Tuple +from typing import TYPE_CHECKING from dateutil.parser import parse as parse_date from gitlab import Gitlab -from gitlab.v4.objects import Project as GitlabProject -from gitlab.v4.objects import ProjectCommitManager +from gitlab.v4.objects import Project as GitlabProject # noqa: TCH002 + +if TYPE_CHECKING: + from datetime import datetime + + from gitlab.v4.objects import ProjectCommitManager @lru_cache() @@ -15,7 +20,7 @@ def get_gitlab_repo(server_url: str, project_path: str) -> GitlabProject: return gitlab.projects.get(project_path) -def split_gitlab_repo_url(url: str) -> Optional[Tuple[str, str]]: +def split_gitlab_repo_url(url: str) -> tuple[str, str] | None: match = re.match(r"^(https?://)([^/]*gitlab[^/]+)/(.*)$", url) if match is None: return None