Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle both single and double quotes in extras#64

Merged
FredHappyface merged 1 commit intoFHPythonUtils:masterfrom
arunkumarpandian:bugfix/extra-deps
Nov 27, 2023
Merged

Handle both single and double quotes in extras#64
FredHappyface merged 1 commit intoFHPythonUtils:masterfrom
arunkumarpandian:bugfix/extra-deps

Conversation

Copy link

arunkumarpandian commented Nov 16, 2023 *
edited
Loading

Purpose of This Pull Request

Please check the relevant option by placing an "X" inside the brackets:

  • Documentation update
  • Bug fix
  • New feature
  • Other (please explain):

Overview of Changes

The current logic only accounts for single quotes instead of handling both ' (single quotes) and " (double quotes) when parsing the extras specification. For example, when parsing the extras for typer, all optional extras are also being included by default as a dependency.

e.g.

>> with open('test-reqs.txt') as f: f.read() ... 'typer'">>>> from licensecheck.get_deps import getReqs
>>> getReqs("requirements:test-reqs.txt", [])
{'MKDOCS', 'TYPING-EXTENSIONS', 'PYTEST-COV', 'PYTEST-SUGAR', 'COLORAMA', 'MKDOCS-MATERIAL', 'FLAKE8', 'PILLOW', 'MDX-INCLUDE', 'SHELLINGHAM', 'COVERAGE', 'CLICK', 'AUTOFLAKE', 'TYPER', 'MYPY', 'ISORT', 'BLACK', 'RICH', 'PYTEST', 'PRE-COMMIT', 'PYTEST-XDIST', 'CAIROSVG'}
>>> with open('test-reqs.txt') as f: f.read()
...
'typer'

And, with the proposed fix:

>> >>> with open('test-reqs.txt') as f: f.read() ... 'typer'">>>> from licensecheck.get_deps import getReqs
>>> getReqs("requirements:test-reqs.txt", [])
{'TYPING-EXTENSIONS', 'TYPER', 'CLICK'}
>>>
>>> with open('test-reqs.txt') as f: f.read()
...
'typer'

Related Issue

Fixes #63

Copy link
Member

FredHappyface commented Nov 27, 2023

Thank you so much for this! Looks awesome, I'll merge now

arunkumarpandian reacted with thumbs up emoji

FredHappyface merged commit d18d4f7 into FHPythonUtils:master Nov 27, 2023
arunkumarpandian deleted the bugfix/extra-deps branch November 28, 2023 11:13
Copy link
Author

arunkumarpandian commented Nov 28, 2023

@FredHappyface would it be possible to have a new release sometime soon that we could upgrade to have this fix ? TIA !

Copy link
Member

FredHappyface commented Nov 28, 2023

Yeah of course! I plan on addressing some of the open issues if I can! I must admit I feel like I want to do a lil refactoring but yknow, I kinda want to go outside this weekend lol. So I'll tackle those best I can and aim to get a release sorted by the end of the week

Thank you again for your contribution

arunkumarpandian reacted with heart emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: Handle both single and double quotes in extras specification

2 participants