Comment 2 for bug 1906322

Revision history for this message
Elod Illes (elod-illes) wrote :

The error message says:

"DEPRECATION: Constraints are only allowed to
take the form of a package name and a version specifier. Other forms
were originally permitted as an accident of the implementation, but
were undocumented. The new implementation of the resolver no longer
supports these forms. A possible replacement is replacing the
constraint with a requirement.."

So as I understand the only way is to use the links only as requirement
(links in costraint is completely unsupported).

Currently we are replacing the constraints of packages to *links*, for
those packages which are installed from source [1], to avoid that an
install pulls that package from pypi instead of having it from source.
This link injection causes the above deprecation message.

I've experimented a bit and found that it is enough to just simply
filter out these packages from the upper-constraints.txt. This can be
done because we install the packages from source right after the
constraints file editing (at least this is what I experienced). If I'm
not mistaken, this way, if there is a package dependency that is
available from source, then it is installed already and won't be
reinstalled.

One issue might happen, though, with the following scenario:
* we have two package, both from source
* one depends on the other
* we use the depends-on tag at the package, which is the dependency of
  the other package
In this case we *might* reinstall the package from pypi... but I'm not
sure.

Anyway, I've uploaded some Work In Progress patch [2], which shows that
the filtering is enough, as far as I see. In this way we can use latest
pip, as we are not using links anymore.

Any opinion about this idea and possible drawbacks?

[1] https://opendev.org/openstack/devstack/src/commit/5dff8186027cf109369d20a57cdadd50a73fac74/inc/python#L381-L386
[2] https://review.opendev.org/q/I6929b0f971ea72e5d7b77d85219db069431c48d3