Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Python dependencies with pip-compile do not respect 'ignored_versions' #1559

Open
JimNero009 opened this issue Dec 6, 2019 · 2 comments
Labels
F: dependency-ignores Allow excluding certain versions L:python:pip-compile Python packages via pip-compile T: bug 🐞 Something isn't working

Comments

@JimNero009
Copy link
Contributor

JimNero009 commented Dec 6, 2019

Hello!
Found an issue today with the running of the pip package manager. On our internal fork, we are passing in 'ignored_versions' to the update checker in order to prevent major bumps of libraries. For the most part, this works great. However, I've found that in the case of bumping a python project that uses a setup.py with pip-compile, the ignored versions are not properly taken into account.

I have traced the issue to this line: https://github.com/dependabot/dependabot-core/blob/master/python/lib/dependabot/python/update_checker/pip_compile_version_resolver.rb#L79

In this line, pip-compile is run against one dependency without any version restrictions. This can (and does, in the case where the update checker has an ignored_versions property) generate situations where the value of an update_checker's 'latest_version' (which correctly filters with ignored_versions) is a version that is semantically before it's 'latest_resolvable_version' (which is what the pip-compile command ultimately generates). It is the 'latest_resolvable_version' that is ultimately used as the version to bump to, hence the bug.

There is a way to pass restrictions to the pip-compile command, though (see 'updating requirements' in https://pypi.org/project/pip-tools/), so this situation should be rectifiable. However, I'm not sure how best to change the syntax of 'versions to ignore' (which might be something like >=7.0.0) and 'restrictions on this update' (which would be something like <7.0.0) in the general case.

@rebelagentm rebelagentm added T: bug 🐞 Something isn't working L: python:pip Python packages via pip labels Dec 6, 2019
@JimNero009
Copy link
Contributor Author

Here's how I've fixed it for the time being in our internal fork -- would love to hear what you think! #1566

@stale stale bot added the stale label Feb 9, 2020
@stale stale bot closed this as completed Feb 16, 2020
@deivid-rodriguez
Copy link
Contributor

We closed the linked PR since we got there late and the OP lost interest in the mean time, but this seems like a valid issue so let's keep it open.

@deivid-rodriguez deivid-rodriguez added F: dependency-ignores Allow excluding certain versions L:python:pip-compile Python packages via pip-compile and removed L: python:pip Python packages via pip stale labels Feb 22, 2023
@dependabot dependabot deleted a comment from stale bot Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F: dependency-ignores Allow excluding certain versions L:python:pip-compile Python packages via pip-compile T: bug 🐞 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants