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

Upgrade python package detection #3757

Merged
merged 14 commits into from
Jul 1, 2024

Conversation

AyanSinhaMahapatra
Copy link
Contributor

@AyanSinhaMahapatra AyanSinhaMahapatra commented Apr 30, 2024

Fixes #3753

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Reference: #3753
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra changed the title Add basic pyproject.toml parsers #3753 Add pyproject.toml support #3753 May 1, 2024
@AyanSinhaMahapatra AyanSinhaMahapatra changed the title Add pyproject.toml support #3753 Upgrade python package detection Jun 25, 2024
Add parser for pip-inspect.deplock files generated by deplock
which has all the package metadata, i.e. the resolved versions
and the dependency relationships.

Reference: aboutcode-org/scancode.io#1262
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
* Add poetry.lock support
* Add pyproject.toml dependencies support for poetry
* Add pyproject.toml dependencies support for standard python projects
* Add poetry package assembly

Reference: #3753
Reference: #2109
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
AyanSinhaMahapatra and others added 7 commits July 1, 2024 15:30
Replace macos-11 runners with macos-14 runners.

Reference: https://github.com/actions/runner-images?tab=readme-ov-file#available-images
Reference: aboutcode-org/skeleton#89
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Replace deprecated macos CI runners
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Copy link
Member

@keshav-space keshav-space left a comment

Choose a reason for hiding this comment

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

Thanks @AyanSinhaMahapatra. LGTM!
For some reason macos-13 CIs are failing.

The removesuffix attribute is only available from Python 3.9+

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra
Copy link
Contributor Author

AyanSinhaMahapatra commented Jul 1, 2024

We are failing tests in two places:

  1. tests which require linux specific configuration it seems, like rpm. Maybe this is because we don't install them in macos specific cases? Like at c06705c @pombredanne need your input here. [Edit, this might actually be the heisenbug we often get, I forgot about that actually]
  2. @keshav-space you added a removesuffix() method on a string but this is only available python 3.9+ it seems. See https://dev.azure.com/nexB/scancode-toolkit/_build/results?buildId=13829&view=logs&j=3dfa68ff-d50a-53ee-7b58-12d58c76da63&t=1b7369b2-e2fc-5889-2082-a49dded9cbd4&l=7020 and https://stackoverflow.com/questions/66683630/removesuffix-returns-error-str-object-has-no-attribute-removesuffix. I'm not sure why this only fails in macos13 though. 🤔

@keshav-space
Copy link
Member

keshav-space commented Jul 1, 2024

  1. tests which require linux specific configuration it seems, like rpm. Maybe this is because we don't install them in macos specific cases?

Maybe we should skip these tests on macOS?

2. @keshav-space you added a removesuffix() method on a string but this is only available python 3.9+ it seems. See https://dev.azure.com/nexB/scancode-toolkit/_build/results?buildId=13829&view=logs&j=3dfa68ff-d50a-53ee-7b58-12d58c76da63&t=1b7369b2-e2fc-5889-2082-a49dded9cbd4&l=7020 and https://stackoverflow.com/questions/66683630/removesuffix-returns-error-str-object-has-no-attribute-removesuffix. I'm not sure why this only fails in macos13 though. 🤔

Ah, I missed that we're still supporting 3.8 :)

@AyanSinhaMahapatra
Copy link
Contributor Author

Thanks @keshav-space , merging! This seems like the heisenbug, I will deal with this seperately if this persists.

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit bd36c8b into develop Jul 1, 2024
32 of 34 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the improve-pypi-package-detection branch July 1, 2024 16:01
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.

SCTK: Detect pyproject.toml correctly
2 participants