-
Notifications
You must be signed in to change notification settings - Fork 18
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
Proposal: pins/run_constrained support #145
Comments
As I understand this will not affect transitive dependencies. name: foo
pins:
- pytest ==6.2.5
- pytest-mock ==3.0.0
- pytest-lazy-fixture ==0.6.0
dependencies:
- pytest-lazy-fixture As I see it will respect |
Good point. From your example, with the original proposal, it would generate: # environment.yml
name: foo
dependencies:
- pytest-lazy-fixture ==0.6.0 And indeed We should resolve/find that Not sure how to tackle this in an efficient manner though. 🤔 |
pins = ... # {package: version_spec, ...}
dependencies = ... # {package, [version_spec, version_spec, ...], ...}
updated_pins_in_deps =True
while updated_pins_in_deps:
updated_pins_in_deps = False
new_dependencies = conda_solve(dependencies)
transitive_deps = set(new_dependencies) - set(dependencies)
for dep in transitive_deps:
if dep in pins:
updated_pins_in_deps = True
dependencies[dep].append(pins.pop(dep)) |
Unless I'm missing something, we need to do a full blown solve of the environment, correct? Because the same package might have different dependencies depending on its version (say If the only solution is in that direction, then probably best to rethink the whole solution with lock files in mind (or even scrap this idea altogether in favor of using full lock files). |
I think so. That or fetching the repo data and parsing it, that could be more performant but we will need to handle channel priority and that kind of conda configurations. |
Unless I'm mistaken, it is not just a matter of parsing versions, we do need to solve the full environment in order to obtain a reliable list of versions and dependencies. For example, if I depend on package Just to make it clear that we are no longer in the realm of "just list some packages and pin them according to a list of pins", we do need to solve the full environment in order to produce a reliable list of dependencies. For that reason I think we need to rethink this in terms of lock files, possibly going straight to a lock file solution, instead of this which would be an interim solution. |
You are right, do get it done properly we need the actual solve. |
Thanks for the inputs @prusse-martin, I'll close this then. 👍 |
Problem
To ensure all projects use the same "blessed" versions, we use a strategy where we include other
devenv.yml
files which exist solely to specify package versions, for example:With the other files being:
The purpose here is to make sure we are using the same versions, without putting all dependencies in
eden/environment.devenv.yml
, as that would bloat all environments that include it.This works, but it has some problems:
devenv.yml
files, which makes it difficult to update versions as often there are conflicts, and we need to hunt down the offending pins.devenv.yml
files, we put a lot of packages in the same file because they are often related, but that's not always true or convenient. For example, when we includepytest.devenv.yml
above, we will getpytest-lazy-fixture
whether we use it or not.Proposal
We add a new section in the
devenv.yml
files, namedpins
. This contains a number of packages and pins (mandatory), which will be used when processing thedependencies
of the chain ofdevenv.yml
files. Any dependency indevenv
files which has a pin in thepins
section, will be pinned accordingly in the finalenvironment.yml
file generated.For example, we can have pins directly into
eden/environment.devenv.yml
, which is included by all other projects:pins
doesn't mean that dependency will be included, but if any of thedependencies
include a package inpins
which is not itself pinned, then it will be pinned accordingly.Having a pin file, all
dependencies
sections indevenv.yml
files can now leave things unpinned, with the pin being managed by thepins
section.Notes
Dependencies with pins
If a
dependencies
section specifies a pinned package, then the generated file will contain both pins:In this example the generated
environment.yml
will contain the entryartifacts_cache: >=2.4.0, ==3.0.0
, which conda will be able to solve. If they conflict for, conda will fail as expected.Multiple
pins
It is possible to have multiple
pins
sections in a chain ofdevenv.yml
files, we should error out if differentpin
sections try to pin the same library (this from the POV ofconda-devenv
, we probably should have a singlepins
section in one file).Usage in
eden
We probably will have a separate
pins.devenv.yml
file, to avoid pollutingeden/environment.devenv
:What about "lock files"
Locking is a different use case/concern, and does not conflict with this proposal.
(note: much of the ideas and solutions here were result from discussions with @tadeu)
The text was updated successfully, but these errors were encountered: