Parse environment markers when auto installing.#889
Merged
mark-edgeworth merged 1 commit intoARMmbed:masterfrom May 3, 2019
Merged
Parse environment markers when auto installing.#889mark-edgeworth merged 1 commit intoARMmbed:masterfrom
mark-edgeworth merged 1 commit intoARMmbed:masterfrom
Conversation
The following change in Mbed OS added an environment marker to the python requirements file: https://github.com/ARMmbed/mbed-os/pull/10096/files#diff-b4ef698db8ca845e5845c4618278f29aR24 Mbed CLI did not know how to parse this, so a warning was always generated. This change now parses the "platform_system" marker, and adds a mechanism to add more if needed in the future.
cmonr
approved these changes
May 2, 2019
Contributor
cmonr
left a comment
There was a problem hiding this comment.
👍
I like it. Just a non-blocking question.
| missing.append(pkg) | ||
| line_parts = line.split(";") | ||
|
|
||
| for line_part in line_parts[1:]: |
Contributor
Author
There was a problem hiding this comment.
A python requirements file looks like this:
pyusb>=1.0.0,<2.0.0
hidapi>=0.7.99,<0.8.0;platform_system!="Linux"
line_parts for the first line would look like: ["pyusb>=1.0.0,<2.0.0"].
For the second one, it would look like ["hidapi>=0.7.99,<0.8.0", "platform_system!=\"Linux\""].
So the [1:] only selects what comes after the first ;, if there is one, which is the environment markers that we're trying to parse.
|
code caters for the cases I can know of, welcome improvement. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The following change in Mbed OS added an environment marker to
the python requirements file:
https://github.com/ARMmbed/mbed-os/pull/10096/files#diff-b4ef698db8ca845e5845c4618278f29aR24
Mbed CLI did not know how to parse this, so a warning was always
generated. This change now parses the "platform_system" marker, and
adds a mechanism to add more if needed in the future.
This fixes #888.
@teetak01 Jimmy is unavailable for the month April, can you review please?