On 2026-09-28 21:36:07 +0900 (+0900), Stephen J. Turnbull wrote: [...]
From pip 25.1.1 help install:
-c, --constraint <file> Constrain versions using the given constraints file. This option can be used multiple times.
I expect this will be the same format as a requirements file but I've never used it. I expect that this will override any constraints from an "-r requirements.txt" etc, but whether that means it will relax existing constraints I'm not sure. I haven't used it.
Yes, it takes the exact same formatting and contents as a requirements.txt file, the effective difference is that it only overrides version selection (if possible) for packages that are being installed but doesn't tell pip to install any new packages even if they're listed in that file.
It was originally added by OpenStack contributors because, in the days before pip's modern dep solver, we needed a way to force various projects in OpenStack to test with subsets of the same pre-solved dependencies (both direct and transitive) in order to provide coinstallability guarantees for them.
For the current SQLAlchemy case it should work fine, just note that it can't override any dependency to a version that results in no viable solver solution for the set of packages being installed.
Jeremy Stanley