Skip to content

Commit 6547eab

Browse files
committed
Merge remote-tracking branch 'github/main' into 100-extend-to-chemprop-205
# Conflicts: # requirements_chemprop.txt
2 parents 9075b41 + 3ab8aa0 commit 6547eab

128 files changed

Lines changed: 7258 additions & 1083 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/linting.yml

Lines changed: 68 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,42 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414
- name: Set up Python
15-
uses: actions/setup-python@v3
15+
uses: astral-sh/setup-uv@v5
1616
with:
17-
python-version: "3.11"
17+
python-version: "3.13"
1818
- name: Install dependencies
1919
run: |
20-
python -m pip install --upgrade pip
21-
pip install $(find . -name "requirement*" -type f -printf ' -r %p')
22-
pip install pylint
20+
uv sync --all-extras
21+
uv pip install torch --index-url https://download.pytorch.org/whl/cpu
2322
- name: Analysing the code with pylint
2423
run: |
25-
pylint -d C0301,R0913,W1202 $(git ls-files '*.py') --ignored-modules "rdkit" --max-positional-arguments 10
24+
uv run pylint -d C0301,R0913,W1202 $(git ls-files '*.py') --ignored-modules "rdkit" --max-positional-arguments 10
2625
mypy:
2726
runs-on: ubuntu-latest
2827
steps:
2928
- uses: actions/checkout@v3
3029
- name: Set up Python
31-
uses: actions/setup-python@v3
30+
uses: astral-sh/setup-uv@v5
3231
with:
33-
python-version: "3.11"
32+
python-version: "3.13"
3433
- name: Install dependencies
3534
run: |
36-
python -m pip install --upgrade pip
37-
pip install mypy
38-
mypy . || exit_code=$?
39-
mypy --install-types --non-interactive
35+
uv run mypy . || exit_code=$?
36+
uv run mypy --install-types --non-interactive
4037
- name: Analysing the code with mypy
4138
run: |
42-
mypy --ignore-missing-imports --disallow-any-generics --disallow-untyped-defs --no-implicit-optional --disallow-incomplete-defs .
39+
uv run mypy --ignore-missing-imports --disallow-any-generics --disallow-untyped-defs --no-implicit-optional --disallow-incomplete-defs .
4340
pydocstyle:
4441
runs-on: ubuntu-latest
4542
steps:
4643
- uses: actions/checkout@v3
4744
- name: Set up Python
4845
uses: actions/setup-python@v3
4946
with:
50-
python-version: "3.11"
47+
python-version: "3.13"
5148
- name: Install dependencies
5249
run: |
53-
python -m pip install --upgrade pip
54-
pip install pydocstyle
50+
python -m pip install pydocstyle
5551
- name: Analysing the code with pydocstyle
5652
run: |
5753
pydocstyle .
@@ -63,46 +59,28 @@ jobs:
6359
- name: Set up Python
6460
uses: actions/setup-python@v3
6561
with:
66-
python-version: "3.11"
62+
python-version: "3.13"
6763
- name: Install dependencies
6864
run: |
69-
python -m pip install --upgrade pip
70-
pip install docsig
65+
python -m pip install docsig
7166
- name: Analysing the code with docsig
7267
run: |
7368
docsig --check-class-constructor --check-dunders --check-protected-class-methods --check-nested --check-overridden --check-protected .
7469
75-
black:
76-
runs-on: ubuntu-latest
77-
steps:
78-
- uses: actions/checkout@v3
79-
- name: Set up Python
80-
uses: actions/setup-python@v3
81-
with:
82-
python-version: "3.11"
83-
- name: Install dependencies
84-
run: |
85-
python -m pip install --upgrade pip
86-
pip install black[jupyter]
87-
- name: Analysing the code with black
88-
run: |
89-
black --check .
90-
9170
flake8:
9271
runs-on: ubuntu-latest
9372
steps:
9473
- uses: actions/checkout@v3
9574
- name: Set up Python
9675
uses: actions/setup-python@v3
9776
with:
98-
python-version: "3.11"
77+
python-version: "3.13"
9978
- name: Install dependencies
10079
run: |
101-
python -m pip install --upgrade pip
102-
pip install flake8
80+
python -m pip install flake8
10381
- name: Analysing the code with flake8
10482
run: |
105-
flake8 --extend-ignore=D203,E203,E501,W503 .
83+
flake8 --extend-ignore=D203,E203,E501,W503 --extend-exclude .venv .
10684
10785
interrogate:
10886
runs-on: ubuntu-latest
@@ -111,11 +89,10 @@ jobs:
11189
- name: Set up Python
11290
uses: actions/setup-python@v3
11391
with:
114-
python-version: "3.11"
92+
python-version: "3.13"
11593
- name: Install dependencies
11694
run: |
117-
python -m pip install --upgrade pip
118-
pip install interrogate
95+
python -m pip install interrogate
11996
- name: Analysing the code with interrogate
12097
run: |
12198
interrogate --ignore-overloaded-functions -vv .
@@ -127,46 +104,66 @@ jobs:
127104
- name: Set up Python
128105
uses: actions/setup-python@v3
129106
with:
130-
python-version: "3.11"
107+
python-version: "3.13"
131108
- name: Install dependencies
132109
run: |
133-
python -m pip install --upgrade pip
134-
pip install bandit
110+
python -m pip install bandit
135111
- name: Analysing the code with bandit
136112
run: |
137-
bandit -r --skip=B404,B603,B602 .
113+
bandit -r --skip=B404,B603,B602 -c pyproject.toml .
138114
139-
isort:
115+
pyright:
140116
runs-on: ubuntu-latest
141117
steps:
142118
- uses: actions/checkout@v3
143119
- name: Set up Python
144-
uses: actions/setup-python@v3
120+
uses: astral-sh/setup-uv@v5
145121
with:
146-
python-version: "3.11"
147-
- name: Install dependencies
122+
python-version: "3.13"
123+
- name: Analysing the code with pyright
148124
run: |
149-
python -m pip install --upgrade pip
150-
pip install isort
151-
- name: Analysing the code with isort
125+
uv run --all-extras pyright .
126+
127+
ruff:
128+
runs-on: ubuntu-latest
129+
steps:
130+
- uses: actions/checkout@v3
131+
- name: Set up Python
132+
uses: astral-sh/setup-uv@v5
133+
with:
134+
python-version: "3.13"
135+
- name: Analysing the code with ruff
136+
run: |
137+
uv run ruff check --config pyproject.toml
138+
139+
ruff-format:
140+
runs-on: ubuntu-latest
141+
steps:
142+
- uses: actions/checkout@v3
143+
- name: Set up Python
144+
uses: astral-sh/setup-uv@v5
145+
with:
146+
python-version: "3.13"
147+
- name: Analysing the code with ruff
152148
run: |
153-
isort --profile black --check-only .
149+
uvx ruff format --check
154150
155151
test_basis:
156152
needs:
157153
- pylint
158154
- mypy
159155
- pydocstyle
160156
- docsig
161-
- black
162157
- flake8
163158
- interrogate
164159
- bandit
165-
- isort
160+
- ruff
161+
- ruff-format
162+
- pyright
166163
runs-on: ubuntu-latest
167164
strategy:
168165
matrix:
169-
python-version: ["3.10", "3.11", "3.12"]
166+
python-version: ["3.11", "3.12", "3.13"]
170167
steps:
171168
- uses: actions/checkout@v3
172169
- name: Set up Python ${{ matrix.python-version }}
@@ -189,39 +186,37 @@ jobs:
189186
needs:
190187
- test_basis
191188
runs-on: ubuntu-latest
189+
strategy:
190+
matrix:
191+
python-version: ["3.11", "3.12", "3.13"]
192192
steps:
193193
- uses: actions/checkout@v3
194-
- name: Set up Python 3.11
195-
uses: actions/setup-python@v3
194+
- name: Set up Python ${{ matrix.python-version }}
195+
uses: astral-sh/setup-uv@v5
196196
with:
197-
python-version: "3.11"
197+
python-version: ${{ matrix.python-version }}
198198
- name: Install package
199199
run: |
200-
python -m pip install --upgrade pip
201-
pip install coverage
202-
pip install torch
203-
pip install .[chemprop]
200+
uv sync --all-extras
201+
uv pip install torch --index-url https://download.pytorch.org/whl/cpu
204202
- name: Run unit-tests for chemprop
205203
run: |
206204
# Run only the chemprop test suite.
207-
coverage run --source=molpipeline,tests -m unittest discover test_extras/test_chemprop
205+
uv run coverage run --source=molpipeline,tests -m unittest discover test_extras/test_chemprop
208206
# Create a coverage report. Fail if the coverage is below 85%. Include only chemprop files in the report.
209-
coverage report --fail-under=85 --include="*chemprop*","*/*chemprop*/*"
207+
uv run coverage report --fail-under=85 --include="*chemprop*","*/*chemprop*/*"
210208
211209
test_notebooks:
212210
needs:
213211
- test_basis
214212
runs-on: ubuntu-latest
215213
steps:
216214
- uses: actions/checkout@v3
217-
- name: Set up Python 3.11
218-
uses: actions/setup-python@v3
219-
with:
220-
python-version: "3.11"
215+
- name: Set up Python 3.13
216+
uses: astral-sh/setup-uv@v5
221217
- name: Install package
222218
run: |
223-
python -m pip install --upgrade pip
224-
pip install .[notebooks]
219+
uv sync --all-extras
225220
- name: Run unit-tests for notebooks
226221
run: |
227-
python test_extras/test_notebooks/test_notebooks.py --continue-on-failure
222+
uv run python test_extras/test_notebooks/test_notebooks.py --continue-on-failure

.github/xai_example.png

135 KB
Loading

.pre-commit-config.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
exclude: |
2+
(?x)(
3+
^notebooks/|
4+
^$
5+
)
6+
fail_fast: false
7+
default_stages: [pre-commit, pre-push]
8+
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v5.0.0
11+
hooks:
12+
- id: check-case-conflict
13+
- id: check-merge-conflict
14+
- id: end-of-file-fixer
15+
- id: mixed-line-ending
16+
- id: trailing-whitespace
17+
exclude_types: [tsv]
18+
args: [--markdown-linebreak-ext=md]
19+
20+
- repo: https://github.com/commitizen-tools/commitizen
21+
rev: v3.29.1
22+
hooks:
23+
- id: commitizen
24+
stages: [commit-msg]
25+
26+
- repo: https://github.com/astral-sh/ruff-pre-commit
27+
rev: v0.11.2
28+
hooks:
29+
- id: ruff-format
30+
types_or: [python, pyi, jupyter]
31+
- id: ruff
32+
types_or: [python, pyi, jupyter]
33+
args: [ --fix, --exit-non-zero-on-fix, --config, ruff.toml]
34+
35+
36+
- repo: https://github.com/pre-commit/mirrors-prettier
37+
rev: v4.0.0-alpha.8
38+
hooks:
39+
- id: prettier
40+
types:
41+
- ts
42+
- javascript
43+
- yaml
44+
- markdown
45+
- json
46+
47+
- repo: https://github.com/RobertCraigie/pyright-python
48+
rev: v1.1.398
49+
hooks:
50+
- id: pyright
51+
args: [-p, pyproject.toml]
52+
verbose: true
53+
54+
- repo: https://github.com/PyCQA/flake8
55+
rev: 7.0.0
56+
hooks:
57+
- id: flake8
58+
additional_dependencies:
59+
- docsig==0.69.3
60+
args:
61+
- --extend-ignore=D203,E203,E501,F401,W5
62+
- "--sig-check-class-constructor"
63+
- "--sig-check-dunders"
64+
- "--sig-check-protected-class-methods"
65+
- "--sig-check-nested"
66+
- "--sig-check-overridden"
67+
- "--sig-check-protected"

DEVELOPMENT.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Development-Guidelines
2+
## Pre-commit Hooks
3+
Before committing any changes, make sure to enable the pre-commit hooks.
4+
This will help you to automatically format your code and check for any linting issues.
5+
You can enable the pre-commit hooks by running the following command:
6+
```bash
7+
pre-commit install
8+
```
9+
In case you want to run the pre-commit hooks manually, you can do so by running:
10+
```bash
11+
pre-commit run --all-files
12+
```
13+
> **_NOTE:_** Be aware that the code in its current state does not comply with the pre-commit hooks.
14+
> Hence, you might encounter errors in sections that are not related to your changes.
15+
> This is intended to slowly improve the code quality over time.
16+
> If fixing the errors would cause a massive overhead, you can ignore them via the `--no-verify` flag when committing.

0 commit comments

Comments
 (0)