Skip to content

Re-pip-compile all requirements files#1204

Open
mhucka wants to merge 13 commits intomainfrom
update-requirements
Open

Re-pip-compile all requirements files#1204
mhucka wants to merge 13 commits intomainfrom
update-requirements

Conversation

@mhucka
Copy link
Contributor

@mhucka mhucka commented Feb 23, 2026

This PR updates some dependencies as well as the scripts used to produce the various environment files, and updates the environment files themselves.

  • dev_tools/requirements/deps/runtime.txt needs to set some constraints on versions of some dependencies because higher versions of those dependencies require Python 3.11, which is incompatible with our goal of maintaining Python 3.10 compatibility (for now)
  • dev_tools/requirements/re-pip-compile-in-docker.sh needed an addition to prevent it including a certain Python package that is incompatible with Python 3.11+
  • dev_tools/requirements/Dockerfile didn't do a pip update -U pip, but should; while at it, I added some options to pip to silence irrelevant warnings so that the logs are less noisy

Note to reviewers: all of the .txt requirements files under dev_tools/requirements/envs/ and dev_tools/requirements/max_compat/ are solely the output of running dev_tools/requirements/re-pip-compile-in-docker.sh.

This is considered best practice and its lack is flagged by the
Dockerfile linter.
Another good practice to follow is to update `pip` itself.
Contourpy is a transitive dependency. Version 1.3.3 needs Python 3.11.
Something is bringing in version 1.3.3 even if I declare this package as
unsafe at `pip-compile` time using the `--unsafe-package` argument. So
far the only solution I've found is to put a version contraint in our
requirements input file.
The package backports.asyncio.runner is a transitive dependency that
should only be installed for Python < 3.11. It doesn't need to be in the
requirements files we produce, and conversely, letting `pip-compile`
include it leads to installation failures with some Python versions. We
can tell `pip-compile` to omit it and this solves the problem.

sympy

# Transitive dependency. Versions 1.3.3+ require Python 11. Constraining it
Copy link
Contributor

Choose a reason for hiding this comment

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

11 -> 3.11

Comment on lines +138 to +139
pip==26.0.1
# via pip-tools
Copy link
Contributor

Choose a reason for hiding this comment

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

This pip specification should be omitted. It is likely coming from the --unsafe-packageoption in run-pip-compiles.py which perpip-compile --help` replaces the default (distribute, pip, setuptools) packages.

Comment on lines +106 to +107
"--unsafe-package",
"backports.asyncio.runner",
Copy link
Contributor

Choose a reason for hiding this comment

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

This introduces pip to the generated requirements. Is this truly needed?

uv pip compile --universal --python-version=3.10 deps/format.txt ...

seems to be able to resolve the dependencies with this version guard:

backports-asyncio-runner==1.2.0 ; python_full_version < '3.11'

Copy link
Contributor

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

I think we should avoid pinning to a specific pip version; this seems to be a side effect of using the --unsafe-package option.

Can we avoid using that option? uv pip compile seems to be able to condition backports.asyncio.runner by Python version.

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.

2 participants