Skip to content

Running the tests requires all optional dependencies to be available #772

Open
@mschilli87

Description

@mschilli87

Please make sure these conditions are met

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of pertpy.
  • (optional) I have confirmed this bug exists on the main branch.

Report

Trying to setup a local dev environment to tackle #771, I hit a missing module for a test:

git clone [email protected]:scverse/pertpy.git
cd pertpy
python -m venv .pertpy.venv
./.pertpy.venv/bin/activate
pip install -e ".[dev,test,doc]"
pytest
...
============================================================================================================ test session starts =============================================================================================================
platform linux -- Python 3.12.9, pytest-8.3.5, pluggy-1.6.0
rootdir: /home/planarian/mschilli/src/pertpy
configfile: pyproject.toml
testpaths: tests
plugins: fast-array-utils-1.2.1, jaxtyping-0.3.2
collected 217 items / 1 error / 1 skipped

=================================================================================================================== ERRORS ===================================================================================================================
_________________________________________________________________________________________ ERROR collecting tests/tools/_differential_gene_expression _________________________________________________________________________________________
tests/tools/_differential_gene_expression/conftest.py:6: in <module>
    from pydeseq2.utils import load_example_data
E   ModuleNotFoundError: No module named 'pydeseq2'
============================================================================================================== warnings summary ==============================================================================================================
.pertpy.venv/lib/python3.12/site-packages/jaxopt/__init__.py:59
  <path>/pertpy/.pertpy.venv/lib/python3.12/site-packages/jaxopt/__init__.py:59: DeprecationWarning: JAXopt is no longer maintained. See https://docs.jax.dev/en/latest/ for alternatives.
    warnings.warn(

.pertpy.venv/lib/python3.12/site-packages/_pytest/fixtures.py:1313
  <path>/pertpy/.pertpy.venv/lib/python3.12/site-packages/_pytest/fixtures.py:1313: PytestRemovedIn9Warning: Marks applied to fixtures have no effect
  See docs: https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
    return fixture_marker(fixture_function)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================================== short test summary info ===========================================================================================================
ERROR tests/tools/_differential_gene_expression - ModuleNotFoundError: No module named 'pydeseq2'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================================ 1 skipped, 2 warnings, 1 error in 143.73s (0:02:23) =============================================================================================

I expect confirmed that using

pip install -e ".[dev,test,doc,de]"

to fix fixes that issue but I'd expect pytest to only test features I built or contributing.md to tell me I need to build DE support for tests to work.
Maybe test can also made to depend on de?
I am not familiar with pyproject.toml, pip and pytest beyond basic usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildBuild System and Dependencies

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions