Skip to content

Add sdist support - #31

Merged
pombredanne merged 10 commits into
mainfrom
supported_wheels_failure
Jul 20, 2022
Merged

Add sdist support#31
pombredanne merged 10 commits into
mainfrom
supported_wheels_failure

Conversation

@TG1999

@TG1999 TG1999 commented Jun 28, 2022

Copy link
Copy Markdown
Contributor

Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com

@TG1999
TG1999 force-pushed the supported_wheels_failure branch 3 times, most recently from 4766526 to 4acf8ce Compare July 1, 2022 14:39
@AyanSinhaMahapatra

Copy link
Copy Markdown
Member

@TG1999 thanks! This looks great. Btw, which of the issues opened in scancode-toolkit does this fix, all of them? i.e. aboutcode-org/scancode-toolkit#3011 aboutcode-org/scancode-toolkit#3008 aboutcode-org/scancode-toolkit#3009?

@TG1999
TG1999 force-pushed the supported_wheels_failure branch from 4acf8ce to 726d8a8 Compare July 1, 2022 18:43
@TG1999

TG1999 commented Jul 1, 2022

Copy link
Copy Markdown
Contributor Author

@TG1999 thanks! This looks great. Btw, which of the issues opened in scancode-toolkit does this fix, all of them? i.e. nexB/scancode-toolkit#3011 nexB/scancode-toolkit#3008 nexB/scancode-toolkit#3009?

@AyanSinhaMahapatra Yes!
Scope is now not same but based on sections
The files that were not getting parsed previously are getting parsed
And the extracted_requirement is as expected

@TG1999
TG1999 force-pushed the supported_wheels_failure branch 4 times, most recently from 7c99106 to fd73eed Compare July 6, 2022 16:22

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!
IMHO we need some more unit tests and try to see where you can use objects or object attributes rather than dictionaries

Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/_packagedcode/pypi.py
Comment thread src/_packagedcode/pypi.py
Comment thread src/python_inspector/resolution.py Outdated
Comment thread src/python_inspector/resolution.py Outdated
TG1999 added 5 commits July 8, 2022 19:50
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
@pombredanne

Copy link
Copy Markdown
Member

The PR title "Add failing test" is likely outdated now?

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The changes to "src/_packagedcode/pypi.py" should be applied also to ScanCode TK.
You can refine them here alright, but in the end you must add the changes back to SCTK and also have tests in SCTK for the changes. The tests for your "src/_packagedcode/pypi.py" changes should all be in SCTK IMHO.

The current situation where we vendor and copy of pypi.py from SCTK is temporary and we need to be careful to keep the two in sync by hand for now.

@TG1999 TG1999 changed the title Add failing test Add sdist support Jul 11, 2022
@TG1999
TG1999 marked this pull request as draft July 11, 2022 14:01
@TG1999
TG1999 force-pushed the supported_wheels_failure branch 2 times, most recently from e3e4253 to ce9d58a Compare July 11, 2022 16:01
@TG1999
TG1999 marked this pull request as ready for review July 11, 2022 16:04
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
@TG1999
TG1999 force-pushed the supported_wheels_failure branch from ce9d58a to a04a634 Compare July 11, 2022 16:32

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the updates. See some comments for your review.
IMHO we could also use a different design rather than the "Wheel" and "Sdist" formats data you use for now.

Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py
parser.read_file(f)

for section in parser.values():
if section.name == 'options':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You likely want to add also the legacy "setup_requires" and "test_requires" as well as the "python_requires"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@pombredanne can you provide me some sample setup.cfg file with legacy "setup_requires", "test_requires", "python_requires"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See https://github.com/search?l=INI&q="setup_requires"&type=Code and https://github.com/karpierz/QQt/blob/930e22d9612f814fa242b1547ad037037ef6b5c7/setup.cfg
And also https://github.com/search?l=INI&q="test_requires"&type=Code for test_requires

Other notes:

  • use python as a scope for the "python_requires" and use a Package URL of pkg:generic/python such that this is clear that this is not a PyPI package. That way you can spot this special package and scope as needed to use it in your processing
  • make sure these fixes are also applied to setup.py parsing as well as other PyPI metadata ... the important part is mostly for python_requires ... setup/test requires are legacy and could only be seen in setup.py/setup.cfg
  • you need tests also on the SCTK side... you may want to start there instead
  • for setup_requires, use setup as scope.

Comment thread src/_packagedcode/pypi.py
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/python_inspector/resolution.py Outdated
TG1999 added 2 commits July 13, 2022 16:54
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
@TG1999

TG1999 commented Jul 13, 2022

Copy link
Copy Markdown
Contributor Author

@pombredanne

IMHO we could also use a different design rather than the "Wheel" and "Sdist" formats data you use for now

I have changed the design please check if this looks good

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. See my comments for your consideration.

Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py
parser.read_file(f)

for section in parser.values():
if section.name == 'options':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See https://github.com/search?l=INI&q="setup_requires"&type=Code and https://github.com/karpierz/QQt/blob/930e22d9612f814fa242b1547ad037037ef6b5c7/setup.cfg
And also https://github.com/search?l=INI&q="test_requires"&type=Code for test_requires

Other notes:

  • use python as a scope for the "python_requires" and use a Package URL of pkg:generic/python such that this is clear that this is not a PyPI package. That way you can spot this special package and scope as needed to use it in your processing
  • make sure these fixes are also applied to setup.py parsing as well as other PyPI metadata ... the important part is mostly for python_requires ... setup/test requires are legacy and could only be seen in setup.py/setup.cfg
  • you need tests also on the SCTK side... you may want to start there instead
  • for setup_requires, use setup as scope.

Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/python_inspector/resolution.py Outdated
Comment thread src/python_inspector/resolution.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
Comment thread src/python_inspector/utils_pypi.py Outdated
@TG1999
TG1999 force-pushed the supported_wheels_failure branch from 2f31bdf to cbde1d7 Compare July 15, 2022 10:21
@TG1999
TG1999 requested a review from pombredanne July 15, 2022 10:21
@TG1999
TG1999 force-pushed the supported_wheels_failure branch 2 times, most recently from 090db29 to b69630e Compare July 15, 2022 13:56
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
@TG1999
TG1999 force-pushed the supported_wheels_failure branch from b69630e to 2b8134a Compare July 15, 2022 15:39

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!
Please see some nitpickings for your review

Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Comment thread src/_packagedcode/pypi.py Outdated
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Thanks!

@pombredanne
pombredanne merged commit 6dab7e1 into main Jul 20, 2022
@pombredanne
pombredanne deleted the supported_wheels_failure branch July 20, 2022 06:31
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