Skip to content

[Code scan] Add direct test-runner dependencies to the test extra #362

Description

@njzjz

Found by Codex global repository scan of deepmodeling/dpgen2 at commit 2679611a3704f5c2646c8cb353e34177518db758.

The test extra only installs two packages:

dpgen2/pyproject.toml

Lines 59 to 62 in 2679611

test = [
'fakegaussian>=0.0.3',
'dpgui',
]

CI has to install additional test-runner dependencies separately:

- name: Install dependencies
run: |
pip install -e .[test]
pip install mock coverage pytest
- name: Test
run: SKIP_UT_WITH_DFLOW=0 DFLOW_DEBUG=1 coverage run --source=./dpgen2 -m unittest -v -f && coverage report

The tests import packages that are not in the test extra, including mock, pytest, and jsonpickle:

import jsonpickle

This makes pip install -e .[test] insufficient for contributors to run the advertised tests locally.

Suggested fix: add direct test dependencies to the test extra and simplify CI to install the package with that extra only.

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions