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

feat: allow brackets when parsing library names #154

Closed

Conversation

rgraber
Copy link
Contributor

@rgraber rgraber commented Nov 10, 2021

Description:

Updates the regex used to match library names to allow brackets for things like pyjwt[crypto]

JIRA:

ARCHBOM-1772

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

@@ -43,7 +43,7 @@ echo -e "rules:
constraint_files = set()

# groups \"my-package-name<=x.y.z,...\" into (\"my-package-name\", \"<=x.y.z,...\")
requirement_line_regex = re.compile(r\"([a-zA-Z0-9-_.]+)([<>=][^#\s]+)?\")
requirement_line_regex = re.compile(r\"([a-zA-Z0-9-_.\[\]]+)([<>=][^#\s]+)?\")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
requirement_line_regex = re.compile(r\"([a-zA-Z0-9-_.\[\]]+)([<>=][^#\s]+)?\")
requirement_line_regex = re.compile(r\"([a-zA-Z0-9\-_.\[\],]+)([<>=][^#\s]+)?\")

There can be more than one extra in the list, so we should have a comma as well. And probably want to escape this hyphen, even though it shouldn't cause trouble at the moment (since there's a range just before it).

Copy link
Contributor

Choose a reason for hiding this comment

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

Theoretically, there could also be whitespace around that comma or probably even the brackets. I don't see any instances of that in our code, though. 🤔

@nedbat
Copy link
Contributor

nedbat commented Aug 8, 2023

Looks like this was handled by #377.

@nedbat nedbat closed this Aug 8, 2023
@timmc-edx timmc-edx deleted the rsgraber/update-setup-py-better-package-regex branch August 8, 2023 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants