Skip to content
Open
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
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -e .[test]
pip install mock coverage pytest
run: pip install -e .[test]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good change, and it is the strongest possible check on the extra: CI now exercises the declared contract for real instead of papering over it. That is also why the ase gap I noted on pyproject.toml is worth closing in the same PR. Until this line changed, a wrong extra was harmless; from here on it is what CI trusts.

- name: Test
run: SKIP_UT_WITH_DFLOW=0 DFLOW_DEBUG=1 coverage run --source=./dpgen2 -m unittest -v -f && coverage report
- uses: codecov/codecov-action@v7
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ docs = [
"dargs>=0.4.1",
]
test = [
'fakegaussian>=0.0.3',
'coverage',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ase belongs in this list too. tests/op/test_run_caly_model_devi.py imports it at module scope (from ase import Atoms on line 14, from ase.io import write on line 17), unguarded, and unittest discovery reaches that file, so a missing ase is a collection error that takes down the whole run rather than skipping one test. It is declared nowhere in this file and arrives only because fpop, cp2kdata and fakegaussian each require it.

It is genuinely test-only, so this extra is the right place: dpgen2/ has no module-level ase import anywhere. They are all inside functions, or inside the calypso_run_opt_str template string that gets written out as a standalone script.

That makes this the same failure mode as #359, which was accepted and fixed in #385 by declaring the package. It mattered less while CI also ran pip install mock coverage pytest as a safety net; now that this extra is the only contract, an upstream release dropping ase would break the suite with a traceback naming a package this repository never declared.

'dpgui',
'fakegaussian>=0.0.3',
'mock',
'pytest',
]
gui = [
'dpgui',
Expand Down
Loading