Skip to content

Declare runtime dependencies in pyproject.toml - #113

Merged
abearab merged 1 commit into
ArcInstitute:mainfrom
albertlieyingadrian:declare-runtime-deps
Nov 13, 2026
Merged

abearab merged 1 commit into
ArcInstitute:mainfrom
albertlieyingadrian:declare-runtime-deps

Conversation

@albertlieyingadrian

Copy link
Copy Markdown
Contributor

Fixes #112.

What's wrong

[tool.poetry.dependencies] lists only python, so pip install ScreenPro2 (the README's install command) installs none of the packages the code imports. import screenpro and screenpro --help then fail with ModuleNotFoundError: No module named 'pandas'.

Fix

Declare every third-party package that screenpro/ imports, with pins taken from environment.yml and from what those pins require:

Package Constraint Why
pandas <2.0 same as environment.yml
matplotlib <3.7 same as environment.yml
polars >0.20 same as environment.yml
numpy <2.0 pandas 1.5 is built against numpy 1.x
pydeseq2 <0.5 0.5 requires pandas>=2.2 (as the issue notes)
pyarrow <26 pyarrow 26 raises ImportError: pyarrow requires NumPy 2.0 or newer at import
python >=3.9,<3.12 pandas 1.5.3 has no 3.12 wheels, so installs on 3.12 try to build it from source and fail
scipy, bokeh, anndata, scanpy, biobear, statsmodels, scikit-learn, simple_colors, adjustText unpinned imported by the package

I left out packages in environment.yml that nothing in screenpro/ imports (seaborn, numba, igraph/leidenalg, watermark, pytest).

Verification

  • Clean Python 3.11 venv with pip install . from this branch: resolves to pandas 1.5.3, numpy 1.26.4, matplotlib 3.6.3, pydeseq2 0.4.12, pyarrow 25.0.1, scanpy 1.11.0, anndata 0.11.4, polars 2.1.0. import screenpro works, screenpro --help prints usage, and pytest tests passes 4/4.
  • Without the pyarrow<26 cap, pyarrow 26 gets installed and the two test_fastq2count tests fail with the NumPy 2 ImportError above.
  • Resolution also works for Python 3.9 and 3.10.
  • The built wheel's METADATA now has a Requires-Dist line for each package and Requires-Python: >=3.9,<3.12.

environment.yml still allows python<=3.12 and leaves pydeseq2 unpinned (points 1 and 2 in the issue). I kept this PR to pyproject.toml, but I'm happy to align environment.yml here or in a follow-up if you'd like.

@abearab, could you take a look when you have a moment?

pip install ScreenPro2 installed no dependencies, so importing the
package or running the screenpro CLI failed with ModuleNotFoundError.
List every package the code imports, with the pins environment.yml
already uses (pandas<2, matplotlib<3.7) plus the ones those pins imply
(numpy<2, pydeseq2<0.5, pyarrow<26, Python <3.12).

Fixes ArcInstitute#112

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates pyproject.toml to restrict the Python version to >=3.9,<3.12 and explicitly defines several package dependencies. The review feedback identifies a likely typo in the pyarrow version constraint (suggesting <16 instead of <26 to prevent compatibility issues with NumPy 2.0) and recommends replacing wildcard constraints (*) with minimum version requirements to ensure stability.

Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
@abearab
abearab merged commit fe461d1 into ArcInstitute:main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pip install ScreenPro2 installs no runtime dependencies; environment.yml pins also fail to resolve

2 participants