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

How to selectively upgrade dependencies? #19

Open
brettdh opened this issue Aug 29, 2018 · 4 comments
Open

How to selectively upgrade dependencies? #19

brettdh opened this issue Aug 29, 2018 · 4 comments

Comments

@brettdh
Copy link

brettdh commented Aug 29, 2018

Per @techalchemy 's comment on this (now locked) issue: pypa/pipenv#966 (comment)

To those who have been waiting patiently for a fix, please do try the resolver mentioned above— we are eager to see if it meets your needs. It implements proper backtracking and resolution and shouldn’t handle this upgrade strategy

I would love to help test this out, but it's not clear to me from the docs here how to test the workflow where I only want to upgrade dependencies (and their dependencies) that are necessary to the current operation (e.g. upgrading a top-level dependency). Does passa also support --selective-upgrade or --keep-outdated, or is there some other way of achieving similar behavior?

@uranusjr
Copy link
Member

I believe it already does it by default. PinReuseProvider (used by the upgrade command by default) tries to reuse the versions specified in Pipfile.lock, and does not change them if possible. Try it out and see if it works as you’d expect (I can’t be 100% sure whether my understanding of this issue fits yours), and report anything that seems wrong to you.

@brettdh
Copy link
Author

brettdh commented Aug 29, 2018

Interesting. 🤔

That's great to hear, but I was sort of expecting that a resolver used by pipenv would have to also support the upgrade-everything workflow, per discussions on that same issue.

I imagine, though, since you mentioned "by default" a couple times, there's a way to override this to eagerly upgrade everything?

@uranusjr
Copy link
Member

uranusjr commented Aug 29, 2018

Yeah there are currently two “strategies” you can choose from the command line, “eager” and “only-if-needed”.

https://github.com/sarugaku/passa/blob/master/src/passa/cli/upgrade.py#L25

If you don’t choose one, only-if-needed is used (hence “by default”). The difference if that say if package A depends on B, passa upgrade A only upgrades A (unless the new version requires an upgrade of B), while passa upgrade A --strategy=eager also tries to upgrade B.

(The idea is borrowed from pip install --upgrade; it has a similar flag.)

@uranusjr
Copy link
Member

The reminds me, there really needs some write up on how the whole system is designed…

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

No branches or pull requests

2 participants