question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Requirements with (potentially conflicting) options

See original GitHub issue

This is a scenario which may never happen in practice, but for which we need to decide what a reasonable behaviour would look like. The current resolver probably does “something”, but likely by accident of implementation. For the new resolver, though, this question may directly impact the implementation strategy.

Consider if the user has two requirements file something like this:

r1.txt:

foo --install-options option1

r2.txt

foo --install-options option2

and then suppose the user does an install as follows:

$ pip install -r r1.txt -r r2.txt

Basically, we now have two InstallRequirement objects, both for foo, but with different install options. Which one gets installed? How do we choose?

The current resolver appears (from my experiments) to pick the first one (option1). But the new resolver would end up creating a set of Candidate objects for foo - and which set of options should it choose to apply when preparing/building those candidates?

The problem here is very much that the new resolver will do find_matches against both requirements, and get 2 lists of Candidates. We need to merge those lists, as they will basically contain the same candidates. But if we merge, we have to decide which options to keep and which to discard.

I’m inclined to do as the current resolver does and just take the first set of options that the code encounters, but say that this is explicitly “not supported” in the sense that we don’t guarantee any particular behaviour. I doubt it will cause anyone any issues in practice.

Ideally we could detect and warn/error on conflicts, but I don’t know if that’s practical (I chose install options as an easy to describe case, but really any configuration held in an InstallRequirement would have the same issue (markers, the isolated flag, hash options, the wheel cache…).

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
uranusjrcommented, Mar 24, 2020

The prompt would be nicer to have, but IMO it is better to error out than prompt the user if the conflicting options come from a requirements file (the user should fix it), so that would be my choice to implement first.

0reactions
brainwanecommented, Oct 21, 2020

Legacy pip has inconsistent behavior and the new resolver will act differently; we’re moving this to fix post-release, and as we get more user feedback we’ll know more about what to provide errors/notifications about.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Techniques For Managing Conflicting Expectations - PMI
When those expectations conflict, project managers should be wary of potentially dangerous situations. They must address and resolve the conflict, ...
Read more >
Rule 1.7 Conflict of Interest: Current Clients - Comment
Concurrent conflicts of interest can arise from the lawyer's responsibilities to another client, a former client or a third person or from the...
Read more >
Conflicts of Interest Q&A | Tools, Publications & Resources
A conflict of interest disclosure statement is often required by an employer to help identify and avoid any potential conflicts that may exist...
Read more >
Conflicts of Interest Considerations: Corporate Employment
This guidance focuses on potential conflicts of interest that can arise from financial interests that often accompany employment with a corporation.
Read more >
Procedure for Managing Conflicts of Interest - UT System
Approval Process for Plan to Manage Potential Conflicts of Interest ... with the procedures that apply to all sponsorship, license, and option agreements....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found