Support multi-file version constraints - #546
Conversation
✅ Deploy Preview for conda-lock ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
6467847 to
5484a88
Compare
|
Please don't be shy about cleaning up the existing code if you're so inclined. |
👍 Although the draft is not me being shy, but rather clumsily trying to make it work at all. ;-) |
7f44116 to
aabc8b9
Compare
|
Status update: Versions seem to work. I'm having issues however when a Real world example: This would work (Also when split across files) The following doesn't work: |
|
Very nice. Any idea why the build number is problematic? |
aac263b to
06a2cff
Compare
Apparently in a conda The commit I pushed now deals with that by (ab-?)using It's working nicely for my real world usage to work around the issue in #386. So now I guess we need some more tests, but I'm optimistic that the current solution is a nice improvement. :) |
5593f32 to
d632ad9
Compare
Until conda/conda#11612 is resolved we do a simplified version of combining build strings. This is a change in behavior as previously package version constraings would simply be overwritten instead of combined.
d632ad9 to
2dc54e9
Compare
|
@maresb I think this is now good enough for a first review. The tests aimed at the |
|
Thanks @knedlsepp! I will try to review this soon. Once I get to it, I hope to release it as v2.6.0. |
maresb
left a comment
There was a problem hiding this comment.
Thanks @knedlsepp! I have a bunch of minor feedback.
This looks like it will be tricky to merge due to breaking changes. I wonder if we could coordinate with @srilman to have this alongside categories.
| build = self._merge_matchspecs( | ||
| self.build, other.build, combine_constraints=False | ||
| ) |
There was a problem hiding this comment.
I spent pretty long in confusion here. Rather than use combine_constraints I think it would be better to have a separate functions here, like _merge_version and _merge_build. I have far less qualms about wildcard tricks for build numbers.
Also I think you can get rid of the surrounding try/except block: just raise the exception directly in _merge_build.
There was a problem hiding this comment.
Also I think you can get rid of the surrounding try/except block: just raise the exception directly in _merge_build.
The surrounding try/except block adds the package names to the exception, which is convenient for the user to figure out which package has conflicting builds. Otherwise the error message would only contain the build ids
We need to keep the "# type: ignore" because otherwise we get the following error in mypy: - conda_lock/src_parser/aggregation.py:42: error: Argument 1 to "merge" of "VersionedDependency" has incompatible type "VersionedDependency | URLDependency | VCSDependency | None"; expected "VersionedDependency | None" [arg-type] - conda_lock/src_parser/aggregation.py:42: error: Argument 1 to "merge" of "URLDependency" has incompatible type "VersionedDependency | URLDependency | VCSDependency | None"; expected "URLDependency | None" [arg-type] - conda_lock/src_parser/aggregation.py:42: error: Argument 1 to "merge" of "VCSDependency" has incompatible type "VersionedDependency | URLDependency | VCSDependency | None"; expected "VCSDependency | None" [arg-type]
|
Thanks for the review. I did apply your suggestions. Still need to look closer into the |
Description
This adds support for multi-file version constraints.
Prior work: #300