generated from tweag/project
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
environment_yml_parser: Fix faulty package name/version parsing
The code for extracting the package name from a Conda dependency specifier was overly simplistic: it assumed that any version/build info in the string always started with a "=" character. This is obviously incorrect (e.g. "numpy>=1.23" is a simple counter-example). Fix the parser to look for the same characters that the upstream looks for, when separating package name from version + build info (see https://github.com/conda/conda/blob/aa0fb6f3ae669a5ade575d340555aa6a9f71ef5e/conda/models/match_spec.py#L716 for details). Add a test case copied from the cartopy project to illustrate the correct use of such specifiers, and also add a couple of tests to verify that we properly deal with invalid package names in dependency specifiers (both Conda and Pip) inside an environment.yml file.
- Loading branch information
Showing
2 changed files
with
105 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters