Skip to content

Commit ddd4577

Browse files
yiyunliuclaude
andcommitted
CI: install [ml] extras + exclude web/ from mypy
predicators.yml broke after this branch slimmed setup.py's install_requires. The base install no longer pulls torch / scipy / imageio / the pretrained-model SDKs (those moved to [ml]), but slim predicators/utils.py still imports them at module top — so any test collecting `from predicators import utils` hit ModuleNotFoundError on imageio in unit-tests, lint, and static-type-checking. Fix: - predicators.yml: change `pip install -e .` to `pip install -e .[ml]` in unit-tests, static-type-checking, and lint jobs. yapf/isort/ docformatter don't import predicators so they stay slim. - mypy.ini: add `web` to the top-level `exclude` regex. Without this mypy treats `./setup.py` and `./web/app/setup.py` as the same module "setup" and bails out with "Duplicate module named setup" before checking anything else. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent af66758 commit ddd4577

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/predicators.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
restore-keys: |
2525
pip-${{ matrix.python-version }}-
2626
- run: |
27-
pip install -e .
27+
pip install -e .[ml]
2828
pip install pytest-cov==2.12.1 pytest-split
2929
- name: Pytest (group ${{ matrix.group }}/8)
3030
run: |
@@ -84,7 +84,7 @@ jobs:
8484
pip-${{ matrix.python-version }}-
8585
- name: Install dependencies
8686
run: |
87-
pip install -e .
87+
pip install -e .[ml]
8888
pip install mypy==1.8.0
8989
- name: Mypy
9090
run: |
@@ -109,7 +109,7 @@ jobs:
109109
pip-${{ matrix.python-version }}-
110110
- name: Install dependencies
111111
run: |
112-
pip install -e .
112+
pip install -e .[ml]
113113
pip install pytest-pylint==0.18.0
114114
- name: Pylint
115115
run: |

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
strict_equality = True
33
disallow_untyped_calls = True
44
warn_unreachable = True
5-
exclude = (predicators/envs/assets|venv|prompts|logs)
5+
exclude = (predicators/envs/assets|venv|prompts|logs|web)
66

77
[mypy-predicators.*]
88
disallow_untyped_defs = True

0 commit comments

Comments
 (0)