3

Allow requirement markers to be parsed by tetsuo-cpp · Pull Request #99 · di/pip...

 2 years ago
source link: https://github.com/di/pip-api/pull/99
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

@@ -187,16 +187,21 @@ def parse_requirements(

req: Optional[Union[requirements.Requirement, UnparsedRequirement]] = None

known, _ = parser.parse_known_args(line.strip().split())

if known.req:

# We want to stop combining strings before an @ sign with space on either side

Copy link

Contributor

Author

@tetsuo-cpp tetsuo-cpp on Sep 16, 2021

I realise this block of code is weird.

The tests in test_parse_requirements.py are very specific about how package@url should be treated vs package @ url so that's why I've written it like this instead of just doing a str().join(known.req).


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK