Skip to content

Commit 809452d

Browse files
authored
Fix/tests (#57)
* Fix linter * Fix docs linter * Fix stacklevel in warnings * Update pre-commits * Fix linkcheck 403 * Remove unused `jinja2` requirement * Use new GA features * Upgrade PETSc python version * Drop Python3.7 support * Remove `pip install petsc slepc` * Enable and switch to `tox-conda` * Install libenchant, use fetch-depth=0
1 parent 651b0ba commit 809452d

16 files changed

Lines changed: 201 additions & 274 deletions

.github/workflows/ci.yml

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,32 @@ on:
1212
branches:
1313
- main
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
1520
jobs:
1621
lint:
1722
runs-on: ubuntu-latest
1823
steps:
1924
- uses: actions/checkout@v3
20-
with:
21-
fetch-depth: 0
2225
- name: Set up Python
2326
uses: actions/setup-python@v4
2427
with:
25-
python-version: 3.8
28+
python-version: '3.10'
2629

2730
- uses: actions/cache@v3
2831
with:
2932
path: ~/.cache/pre-commit
3033
key: precommit-${{ env.pythonLocation }}-${{ hashFiles('**/.pre-commit-config.yaml') }}
31-
restore-keys: |
32-
precommit-${{ env.pythonLocation }}-
3334

3435
- name: Install dependencies
3536
run: |
36-
sudo apt install pandoc
37+
sudo apt-get update -y
38+
sudo apt install libenchant-2-dev pandoc
3739
python -m pip install --upgrade pip
38-
pip install tox
40+
python -m pip install tox
3941
4042
- name: Linting
4143
run: |
@@ -47,80 +49,41 @@ jobs:
4749
fail-fast: false
4850
max-parallel: 5
4951
matrix:
50-
python: [3.7, 3.9]
52+
python: ['3.8', '3.10', '3.11']
5153
os: [ubuntu-latest]
52-
use_slepc: [false]
54+
slepc: ['noslepc']
5355
include:
5456
- os: ubuntu-latest
55-
python: 3.8
56-
use_slepc: true
57-
- os: macos-latest
58-
python: 3.9
59-
# TODO(michalk8): enable this in the future (problem/missing mpif90)
60-
use_slepc: false
57+
python: '3.9'
58+
slepc: 'slepc'
6159
- os: macos-latest
62-
python: 3.8
63-
use_slepc: false
64-
env:
65-
# make sure to pin this in tox.ini as well
66-
PC_VERSION: 3.18.0 # PETSc version
67-
SC_VERSION: 3.18.0 # SLEPc version
60+
python: '3.10'
61+
slepc: 'slepc'
6862

6963
steps:
7064
- uses: actions/checkout@v3
71-
with:
72-
fetch-depth: 0
7365
- name: Set up Python ${{ matrix.python }}
7466
uses: actions/setup-python@v4
7567
with:
7668
python-version: ${{ matrix.python }}
7769

78-
- name: Export environment variables
79-
if: matrix.use_slepc == true
80-
run: |
81-
echo "PETSC_DIR=$HOME/petsc-$PC_VERSION" >> $GITHUB_ENV
82-
echo "SLEPC_DIR=$HOME/slepc-$SC_VERSION" >> $GITHUB_ENV
83-
echo "PETSC_ARCH=arch-$RUNNER_OS-c-opt" >> $GITHUB_ENV
84-
- name: Install PETSc/SLEPc dev dependencies
85-
if: matrix.use_slepc == true
86-
run: |
87-
./.scripts/ci/install_dependencies.sh
88-
89-
- name: Get pip cache dir
90-
id: pip-cache-dir
91-
run: |
92-
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
93-
- name: Restore pip cache
94-
uses: actions/cache@v3
95-
with:
96-
path: ${{ steps.pip-cache-dir.outputs.dir }}
97-
key: pip-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/requirements.txt') }}
98-
9970
- name: Install pip dependencies
10071
run: |
10172
python -m pip install --upgrade pip
102-
pip install tox tox-gh-actions codecov
103-
104-
- name: Restore PETSc/SLEPc tox cache
105-
if: matrix.use_slepc == true
106-
uses: actions/cache@v3
107-
with:
108-
path: .tox
109-
key: tox-${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/install_dependencies.sh', '**/requirements.txt', '**/setup.py', '**/tox.ini') }}
73+
pip install tox codecov
11074
11175
- name: Test
11276
run: |
113-
tox -vv
77+
tox -e py${{ matrix.python }}-${{ matrix.slepc }} -vv
11478
env:
11579
PLATFORM: ${{ matrix.os }}
116-
USE_SLEPC: ${{ matrix.use_slepc }}
11780

11881
- name: Upload coverage
11982
uses: codecov/codecov-action@v3
12083
with:
12184
files: ./coverage.xml
12285
flags: unittests
123-
name: ${{ matrix.os }}-${{ matrix.python }}-{{ matrix.use_slepc }}
86+
name: ${{ matrix.os }}-${{ matrix.python }}-${{ matrix.slepc }}
12487
env_vars: OS,PYTHON
12588
fail_ci_if_error: false
12689
verbose: true
@@ -131,12 +94,10 @@ jobs:
13194
runs-on: ubuntu-latest
13295
steps:
13396
- uses: actions/checkout@v3
134-
with:
135-
fetch-depth: 0
13697
- name: Set up Python
13798
uses: actions/setup-python@v4
13899
with:
139-
python-version: 3.8
100+
python-version: '3.10'
140101
- name: Install pypa/build
141102
run: |
142103
python -m pip install --upgrade pip
@@ -146,9 +107,10 @@ jobs:
146107
python -m build --sdist --wheel --outdir dist/
147108
148109
- name: Publish package on PyPI
149-
uses: pypa/gh-action-pypi-publish@master
110+
uses: pypa/gh-action-pypi-publish@release/v1
150111
with:
151112
user: __token__
152113
password: ${{ secrets.PYPI_PASSWORD }}
153114
skip_existing: true
115+
verify-metadata: true
154116
verbose: true

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ default_stages:
77
minimum_pre_commit_version: 2.9.0
88
repos:
99
- repo: https://github.com/pre-commit/mirrors-mypy
10-
rev: v1.0.1
10+
rev: v1.3.0
1111
hooks:
1212
- id: mypy
13-
additional_dependencies: [numpy==1.20.0, scipy>=1.6.0]
13+
additional_dependencies: [numpy>=1.20.0, scipy>=1.6.0]
1414
- repo: https://github.com/psf/black
15-
rev: 23.1.0
15+
rev: 23.3.0
1616
hooks:
1717
- id: black
1818
additional_dependencies: [toml]
@@ -28,7 +28,7 @@ repos:
2828
- id: yesqa
2929
additional_dependencies: [flake8-tidy-imports, flake8-docstrings, flake8-rst-docstrings, flake8-comprehensions, flake8-bugbear, flake8-logging-format, flake8-blind-except, flake8-builtins, flake8-pytest-style, flake8-string-format]
3030
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
31-
rev: v2.7.0
31+
rev: v2.9.0
3232
hooks:
3333
- id: pretty-format-yaml
3434
args: [--autofix, --indent, '4', --preserve-quotes]
@@ -61,7 +61,7 @@ repos:
6161
- id: flake8
6262
additional_dependencies: [flake8-tidy-imports, flake8-docstrings, flake8-rst-docstrings, flake8-comprehensions, flake8-bugbear, flake8-logging-format, flake8-blind-except, flake8-builtins, flake8-pytest-style, flake8-string-format]
6363
- repo: https://github.com/myint/autoflake
64-
rev: v2.0.1
64+
rev: v2.1.1
6565
hooks:
6666
- id: autoflake
6767
args: [--in-place, --remove-all-unused-imports, --remove-unused-variable, --ignore-init-module-imports]
@@ -77,7 +77,7 @@ repos:
7777
- id: blacken-docs
7878
additional_dependencies: [black==23.1.0]
7979
- repo: https://github.com/asottile/pyupgrade
80-
rev: v3.3.1
80+
rev: v3.4.0
8181
hooks:
8282
- id: pyupgrade
8383
args: [--py3-plus, --py37-plus]

.scripts/ci/install_dependencies.sh

Lines changed: 0 additions & 55 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"sphinx.ext.autosummary",
4646
"sphinx.ext.mathjax",
4747
"sphinx_autodoc_typehints",
48-
"sphinx_last_updated_by_git",
4948
"sphinx_copybutton",
5049
"typed_returns",
5150
"nbsphinx",
@@ -115,7 +114,11 @@
115114

116115
# linkcheck
117116
linkcheck_anchors = False # problem with specifying lines on GitHub in `acknowledgments.rst`
118-
linkcheck_ignore = ["https://doi.org/10.1021/acs.jctc.8b00079", "https://pubs.acs.org/doi/abs/10.1021/acs.jctc.8b00079"]
117+
linkcheck_ignore = [
118+
"https://doi.org/10.1021/acs.jctc.8b00079",
119+
"https://pubs.acs.org/doi/abs/10.1021/acs.jctc.8b00079",
120+
"https://doi.org/10.1063/1.5064530",
121+
]
119122

120123
# Add any paths that contain custom static files (such as style sheets) here,
121124
# relative to this directory. They are copied after the builtin static files,

docs/source/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Installation
22
============
3-
*pyGPCCA* requires Python >= 3.6 to run. If any problems arise, please consult the
3+
*pyGPCCA* requires Python >= 3.8 to run. If any problems arise, please consult the
44
`Troubleshooting`_ section.
55

66
Methods

docs/source/spelling_wordlist.txt

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,42 @@
1-
scipy
2-
docstring
1+
Eq
2+
Fackeldey
3+
Freie
4+
G-PCCA
5+
GPCCA
6+
Konstantin
7+
Perron
8+
Reuter
9+
Röblitz
10+
Schur
11+
Sikorski
12+
Universitaet
13+
Zenodo
14+
Zuse
15+
brandts
16+
clusterings
17+
coarsegrain
318
conda
4-
pygpcca
5-
pyGPCCA
19+
conformational
20+
cubically
21+
decompositions
22+
docstring
623
gpcca
7-
GPCCA
8-
G-PCCA
9-
minChi
24+
graining
25+
intersphinx
1026
krylov
11-
brandts
12-
Schur
13-
schur
14-
microstate
15-
microstates
27+
macOS
1628
macrostate
1729
macrostates
18-
graining
19-
coarsegrain
20-
clusterings
21-
Freie
22-
Universitaet
23-
macOS
24-
Fackeldey
25-
Röblitz
26-
Sikorski
27-
Zuse
30+
metastable
31+
microstate
32+
microstates
33+
minChi
2834
mypy
2935
numpy
30-
Zenodo
31-
Konstantin
36+
optimality
37+
orthonormal
3238
pre
33-
intersphinx
39+
pyGPCCA
40+
pygpcca
41+
schur
42+
scipy

0 commit comments

Comments
 (0)