Skip to content

Commit

Permalink
build: support Python 3.10 (#117)
Browse files Browse the repository at this point in the history
* ci: auto-update pre-commit
* ci: upgrade pinned requirements (automatic)
* ci: use ignore instead of extend-ignore
  nbQA does not take extend-ignore into account

* ci: define Python version in YAML as string
  Defining the Python version as a number (e.g. 3.7) can lead to problems
  later on when you want to use 3.10, because that would be interpreted
  as 3.1.

* ci: print myst-nb error logs with color
  See ComPWA/ampform#170

* ci: update pin_requirements.py script

Co-authored-by: GitHub Action <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
redeboer and github-actions[bot] authored Oct 20, 2021
1 parent 199fc74 commit 523c639
Show file tree
Hide file tree
Showing 18 changed files with 258 additions and 40 deletions.
6 changes: 5 additions & 1 deletion .constraints/pin_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ def perform_replacements(line: str) -> str:
stream.write(new_content)


if "__main__" in __name__:
def main() -> None:
if upgrade_constraints_file():
raise RuntimeError("There were issues running pip-compile")
remove_extras_syntax()


if "__main__" in __name__:
main()
194 changes: 194 additions & 0 deletions .constraints/py3.10.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile --extra=dev --no-annotate --output-file=.constraints/py3.10.txt
#
alabaster==0.7.12
anyio==3.3.4
aquirdturtle-collapsible-headings==3.1.0
argon2-cffi==21.1.0
astroid==2.8.3
attrs==20.3.0
babel==2.9.1
backcall==0.2.0
backports.entry-points-selectable==1.1.0
beautifulsoup4==4.10.0
black==21.9b0
bleach==4.1.0
certifi==2021.10.8
cffi==1.15.0
cfgv==3.3.1
charset-normalizer==2.0.7
click==7.1.2
colorama==0.4.4
coverage==6.0.2
debugpy==1.5.1
decorator==5.1.0
defusedxml==0.7.1
deprecated==1.2.13
distlib==0.3.3
docutils==0.16
entrypoints==0.3
execnet==1.9.0
filelock==3.3.1
flake8==4.0.1
flake8-blind-except==0.2.0
flake8-bugbear==21.9.2
flake8-builtins==1.5.3
flake8-comprehensions==3.7.0
flake8-plugin-utils==1.3.2
flake8-polyfill==1.0.2
flake8-pytest-style==1.5.0
flake8-rst-docstrings==0.2.3
flake8-type-ignore==0.1.0.post2
flake8-use-fstring==1.2
fuzzywuzzy==0.18.0
gitdb==4.0.7
gitpython==3.1.24
gprof2dot==2021.2.21
graphviz==0.17
greenlet==1.1.2
hepunits==2.1.2
identify==2.3.0
idna==3.3
imagesize==1.2.0
importlib-metadata==4.8.1
importlib-resources==5.3.0
iniconfig==1.1.1
ipykernel==6.4.2
ipython==7.28.0
ipython-genutils==0.2.0
ipywidgets==7.6.5
isort==5.9.3
jedi==0.18.0
jinja2==3.0.2
json5==0.9.6
jsonschema==4.1.2
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.0.6
jupyter-console==6.4.0
jupyter-core==4.8.1
jupyter-server==1.11.1
jupyter-server-mathjax==0.2.3
jupyter-sphinx==0.3.2
jupyterlab==3.2.1
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.8.2
jupyterlab-widgets==1.0.2
latexcodec==2.0.1
lazy-object-proxy==1.6.0
livereload==2.6.3
markdown-it-py==1.1.0
markupsafe==2.0.1
matplotlib-inline==0.1.3
mccabe==0.6.1
mdit-py-plugins==0.2.8
mistune==0.8.4
mypy==0.910
mypy-extensions==0.4.3
myst-nb==0.13.1
myst-parser==0.15.2
nbclassic==0.3.2
nbclient==0.5.4
nbconvert==5.6.1
nbdime==3.1.0
nbformat==5.1.3
nest-asyncio==1.5.1
nodeenv==1.6.0
notebook==6.4.5
packaging==21.0
pandocfilters==1.5.0
parso==0.8.2
particle==0.16.1
pathspec==0.9.0
pep517==0.12.0
pep8-naming==0.12.1
pexpect==4.8.0
pickleshare==0.7.5
pip-tools==6.4.0
platformdirs==2.4.0
pluggy==1.0.0
pre-commit==2.15.0
prometheus-client==0.11.0
prompt-toolkit==3.0.20
ptyprocess==0.7.0
py==1.10.0
pybtex==0.24.0
pybtex-docutils==1.0.1
pycodestyle==2.8.0
pycparser==2.20
pydata-sphinx-theme==0.6.3
pydocstyle==6.1.1
pydot==1.4.2
pyflakes==2.4.0
pygments==2.10.0
pylint==2.11.1
pyparsing==2.4.7
pyrsistent==0.18.0
pytest==6.2.5
pytest-cov==3.0.0
pytest-forked==1.3.0
pytest-notebook==0.6.1
pytest-profiling==1.7.0
pytest-xdist==2.4.0
python-constraint==1.4.0
python-dateutil==2.8.2
pytz==2021.3
pyyaml==6.0
pyzmq==22.3.0
qtconsole==5.1.1
qtpy==1.11.2
regex==2021.10.8
requests==2.26.0
requests-unixsocket==0.2.0
restructuredtext-lint==1.3.2
send2trash==1.8.0
six==1.16.0
smmap==4.0.0
sniffio==1.2.0
snowballstemmer==2.1.0
soupsieve==2.2.1
sphinx==4.2.0
sphinx-autobuild==2021.3.14
sphinx-book-theme==0.1.6
sphinx-copybutton==0.4.0
sphinx-panels==0.6.0
sphinx-thebe==0.0.10
sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-hep-pdgref==0.1.4
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphobjinv==2.1
sqlalchemy==1.4.26
terminado==0.12.1
testpath==0.5.0
toml==0.10.2
tomli==1.2.1
tornado==6.1
tox==3.24.4
tqdm==4.62.3
traitlets==5.1.0
types-docutils==0.17.1
types-pkg-resources==0.1.3
types-pyyaml==5.4.12
typing-extensions==3.10.0.2
urllib3==1.26.7
virtualenv==20.8.1
wcwidth==0.2.5
webencodings==0.5.1
websocket-client==1.2.1
wheel==0.37.0
widgetsnbextension==3.5.1
wrapt==1.13.2
zipp==3.6.0

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
4 changes: 2 additions & 2 deletions .constraints/py3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jupyter-core==4.8.1
jupyter-server==1.11.1
jupyter-server-mathjax==0.2.3
jupyter-sphinx==0.3.2
jupyterlab==3.2.0
jupyterlab==3.2.1
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.8.2
jupyterlab-widgets==1.0.2
Expand Down Expand Up @@ -162,7 +162,7 @@ sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-hep-pdgref==0.1.3
sphinxcontrib-hep-pdgref==0.1.4
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
Expand Down
6 changes: 3 additions & 3 deletions .constraints/py3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ isort==5.9.3
jedi==0.18.0
jinja2==3.0.2
json5==0.9.6
jsonschema==4.1.1
jsonschema==4.1.2
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.0.6
Expand All @@ -74,7 +74,7 @@ jupyter-core==4.8.1
jupyter-server==1.11.1
jupyter-server-mathjax==0.2.3
jupyter-sphinx==0.3.2
jupyterlab==3.2.0
jupyterlab==3.2.1
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.8.2
jupyterlab-widgets==1.0.2
Expand Down Expand Up @@ -161,7 +161,7 @@ sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-hep-pdgref==0.1.3
sphinxcontrib-hep-pdgref==0.1.4
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
Expand Down
6 changes: 3 additions & 3 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ isort==5.9.3
jedi==0.18.0
jinja2==3.0.2
json5==0.9.6
jsonschema==4.1.1
jsonschema==4.1.2
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.0.6
Expand All @@ -73,7 +73,7 @@ jupyter-core==4.8.1
jupyter-server==1.11.1
jupyter-server-mathjax==0.2.3
jupyter-sphinx==0.3.2
jupyterlab==3.2.0
jupyterlab==3.2.1
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.8.2
jupyterlab-widgets==1.0.2
Expand Down Expand Up @@ -160,7 +160,7 @@ sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-hep-pdgref==0.1.3
sphinxcontrib-hep-pdgref==0.1.4
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
Expand Down
6 changes: 3 additions & 3 deletions .constraints/py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ isort==5.9.3
jedi==0.18.0
jinja2==3.0.2
json5==0.9.6
jsonschema==4.1.1
jsonschema==4.1.2
jupyter==1.0.0
jupyter-cache==0.4.3
jupyter-client==7.0.6
Expand All @@ -73,7 +73,7 @@ jupyter-core==4.8.1
jupyter-server==1.11.1
jupyter-server-mathjax==0.2.3
jupyter-sphinx==0.3.2
jupyterlab==3.2.0
jupyterlab==3.2.1
jupyterlab-code-formatter==1.4.10
jupyterlab-server==2.8.2
jupyterlab-widgets==1.0.2
Expand Down Expand Up @@ -160,7 +160,7 @@ sphinx-togglebutton==0.2.3
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-bibtex==2.4.1
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-hep-pdgref==0.1.3
sphinxcontrib-hep-pdgref==0.1.4
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
Expand Down
2 changes: 2 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"asdict",
"asdot",
"astuple",
"autoupdate",
"cano",
"celltoolbar",
"codacy",
Expand Down Expand Up @@ -167,6 +168,7 @@
"nbstripout",
"ndarray",
"noqa",
"noreply",
"nrows",
"nsimplify",
"pandoc",
Expand Down
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude =
**/__pycache__
**/_build
/typings/**
extend-ignore =
ignore =
# https://github.com/psf/black#slices
E203
# allowed by black
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: "3.7"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -c .constraints/py3.7.txt .[doc]
sudo apt-get -y install pandoc graphviz
sudo apt-get -y install graphviz pandoc
- name: Build documentation and run notebooks
working-directory: docs
env:
Expand All @@ -35,3 +35,15 @@ jobs:
with:
name: html
path: docs/_build/html
- name: Print error logs with color
if: ${{ failure() }}
# cspell:ignore printf
run: |
for log_file in $(ls docs/_build/html/reports/*); do
for i in $(seq 6); do echo; done
printf '%45s\n' | tr ' ' =
echo "$log_file"
printf '%45s\n' | tr ' ' =
echo
cat "$log_file"
done
2 changes: 1 addition & 1 deletion .github/workflows/ci-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
Loading

0 comments on commit 523c639

Please sign in to comment.