-
Notifications
You must be signed in to change notification settings - Fork 34
Handle both single and double quotes in extras#64
Handle both single and double quotes in extras#64FredHappyface merged 1 commit intoFHPythonUtils:masterfrom
Conversation
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.
>>> 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:
>>> 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
|
Thank you so much for this! Looks awesome, I'll merge now |
|
@FredHappyface would it be possible to have a new release sometime soon that we could upgrade to have this fix ? TIA ! |
|
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 |