Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: treat Python warnings as errors #697

Merged
merged 4 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/html-macos.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Build HTML on macOS
on: [push, pull_request]
env:
PYTHONWARNINGS: error
PIP: python -m pip
SPHINX: python -m sphinx -W --keep-going --color
jobs:
Expand All @@ -22,11 +23,23 @@ jobs:
run: |
python --version
- name: Install Python package
env:
# There is still a warning with pip version 24, even though this
# is supposed to be fixed: https://github.com/pypa/pip/issues/11975
PYTHONWARNINGS: error,default::DeprecationWarning
run: |
$PIP install .
- name: Install docs dependencies
env:
# There is still a warning with pip version 24, even though this
# is supposed to be fixed: https://github.com/pypa/pip/issues/11975
PYTHONWARNINGS: error,default::DeprecationWarning
run: |
$PIP install -r doc/requirements.txt
- name: Build HTML
env:
# There is a weird warning from jupyter_core (https://github.com/jupyter/jupyter_core/issues/398)
# The other warning will be fixed with https://github.com/spatialaudio/nbsphinx/pull/758
PYTHONWARNINGS: error,default::DeprecationWarning,default:nodes.Node.traverse() is obsoleted by Node.findall():PendingDeprecationWarning
run: |
$SPHINX doc/ _build/html/
13 changes: 13 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Check links in documentation
on: [push, pull_request]
env:
PYTHONWARNINGS: error
APT_INSTALL: sudo apt-get install -y --no-install-recommends
PIP: python -m pip
SPHINX: python -m sphinx -W --keep-going --color
Expand All @@ -23,12 +24,24 @@ jobs:
run: |
python --version
- name: Install Python package
env:
# There is still a warning with pip version 24, even though this
# is supposed to be fixed: https://github.com/pypa/pip/issues/11975
PYTHONWARNINGS: error,default::DeprecationWarning
run: |
$PIP install .
- name: Install docs dependencies
env:
# There is still a warning with pip version 24, even though this
# is supposed to be fixed: https://github.com/pypa/pip/issues/11975
PYTHONWARNINGS: error,default::DeprecationWarning
run: |
$PIP install -r doc/requirements.txt
- name: Check links
env:
# There is a weird warning from jupyter_core (https://github.com/jupyter/jupyter_core/issues/398)
# The other warning will be fixed with https://github.com/spatialaudio/nbsphinx/pull/758
PYTHONWARNINGS: error,default::DeprecationWarning,default:nodes.Node.traverse() is obsoleted by Node.findall():PendingDeprecationWarning
run: |
$SPHINX -d _doctrees/ doc/ _build/linkcheck/ -b linkcheck -q
- name: Upload results
Expand Down