Skip to content
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

Correctly handle trailing whitespace on URL requirements #642

Merged
merged 2 commits into from
Dec 14, 2022

Conversation

pradyunsg
Copy link
Member

Traceback (most recent call last):
  File "generate.py", line 38, in <module>
    req = Requirement(raw_req)
  File "/home/ichard26/programming/oss/black-deps-ci/venv/lib/python3.8/site-packages/packaging/requirements.py", line 37, in __init__
    raise InvalidRequirement(str(e)) from e
packaging.requirements.InvalidRequirement: Expected end or semicolon (after URL and whitespace)
    aiohttp @ https://github.com/aio-libs/aiohttp/archive/master.zip 
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

heh I did not expect packaging to become stricter on terminating whitespace

Reported by @ichard26 over Discord (if you're on the PyPA discord: https://discord.com/channels/803025117553754132/803025117995073578/1052081745446567986)

Copy link
Member

@ichard26 ichard26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

The input is permitted to end, after trailing whitespace.
This is logically equivalent and has a more linear flow.
@pradyunsg pradyunsg force-pushed the handle-trailing-whitespace-on-urls branch from a22fb16 to 21026b3 Compare December 14, 2022 09:51
@pradyunsg pradyunsg enabled auto-merge (rebase) December 14, 2022 09:51
@pradyunsg pradyunsg merged commit 97db717 into pypa:main Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants