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

adapt code to new spdx-tools release #3173

Merged
merged 4 commits into from
Jan 18, 2023

Conversation

meretp
Copy link
Contributor

@meretp meretp commented Dec 8, 2022

With the new release, the checksum class has been renamed, the license class has been moved to its own file, and files are now only allowed at document level.

Signed-off-by: Meret Behrens [email protected]

Fixes #3172

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 📁

Copy link

@nicoweidner nicoweidner left a comment

Choose a reason for hiding this comment

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

@pombredanne
Copy link
Member

@meretp @nicoweidner I pushed spdx-tools 0.7.0rc0 so you should be able to update your PR accordingly.

@meretp meretp force-pushed the python_tools_release branch 2 times, most recently from 50a1233 to 0efa0ff Compare December 28, 2022 10:16
@meretp
Copy link
Contributor Author

meretp commented Dec 28, 2022

@pombredanne I updated the PR accordingly and all tests pass now, so this is ready for review.

@armintaenzertng
Copy link
Contributor

I updated the requirement.txt files of all other nexB repositories that include the spdx-tools dependency to use 0.7.0rc0:
aboutcode-org/aboutcode-toolkit#515
aboutcode-org/container-inspector#49
aboutcode-org/fetchcode#87
aboutcode-org/debian-inspector#34
aboutcode-org/typecode#30
aboutcode-org/plugincode#8
aboutcode-org/commoncode#50
aboutcode-org/extractcode#45
aboutcode-org/purldb#16
All pipeline runs are green except for extractcode, but that seems to be a non-related problem with the typecode dependency that also appears on the main branch.

@meretp
Copy link
Contributor Author

meretp commented Jan 11, 2023

@pombredanne Gentle ping, is there anything else I can do to get this PR merged?
We would really like to have the 0.7.0 release on PyPi for tools-python, as the current release is still the release candidate.

@pombredanne
Copy link
Member

Gentle ping, is there anything else I can do to get this PR merged?
We would really like to have the 0.7.0 release on PyPi for tools-python, as the current release is still the release candidate.

We are all good and this is being merged today

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

@meretp Thanks! see some review nitpickings for your consideration.

setup-mini.cfg Outdated
@@ -103,7 +103,7 @@ install_requires =
pymaven_patch >= 0.2.8
requests >= 2.7.0
saneyaml >= 0.5.2
spdx_tools == 0.7.0a3
spdx_tools >= 0.7.0rc0, ==0.7.*
Copy link
Member

Choose a reason for hiding this comment

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

We avoid using upper cap in setup requirements. We pin instead in requirements files.

Suggested change
spdx_tools >= 0.7.0rc0, ==0.7.*
spdx_tools >= 0.7.0rc0

See https://iscinumpy.dev/post/bound-version-constraints/ and https://caremad.io/posts/2013/07/setup-vs-requirement/ for detailed articles on the topics. ScanCode is both used as an app and as a library. App deps are pinned, library deps are not capped.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since there is currently a big refactoring in the progress, which is breaking the API after 0.7, we think that it is safer to restrict it here. Otherwise we will run into the same race condition with releasing.

Pinning in requirement files was not sufficient to mitigate the breaking changes between 0.7.0a3 and 0.7.0rc0.

setup.cfg Outdated Show resolved Hide resolved
src/formattedcode/output_spdx.py Outdated Show resolved Hide resolved
src/formattedcode/output_spdx.py Outdated Show resolved Hide resolved
src/formattedcode/output_spdx.py Outdated Show resolved Hide resolved
tests/formattedcode/test_output_spdx.py Show resolved Hide resolved
@pombredanne
Copy link
Member

@meretp @maxhbr tell me who needs to own the PyPI account (I need to know the PyPI user id so I can send the invites)

@maxhbr
Copy link
Contributor

maxhbr commented Jan 17, 2023

@meretp @maxhbr tell me who needs to own the PyPI account (I need to know the PyPI user id so I can send the invites)

My account on pypi is maxhbr.

With the new release, the checksum class has been renamed, the license class has been moved to its own file, and files are now only allowed at document level.

Signed-off-by: Meret Behrens <[email protected]>
@meretp
Copy link
Contributor Author

meretp commented Jan 17, 2023

@pombredanne I included your suggested changes in a fix-up commit to squash this before merging. Two tests fail but that seems to be another issue as the latest commit on develop also has these failing tests.
Regarding the comments in setup.cfg: as @maxhbr commented we would really appreciate if we could avoid another race condition with releasing for the changes to come in tools-python.

@pombredanne
Copy link
Member

Regarding the comments in setup.cfg: as @maxhbr commented we would really appreciate if we could avoid another race condition with releasing for the changes to come in tools-python.

No worries, we will be fine now!

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

The test failure is unrelated and fixed in develop. I still prefer a pinned SPDX version for now.

setup-mini.cfg Outdated Show resolved Hide resolved
setup.cfg Outdated Show resolved Hide resolved
Signed-off-by: Philippe Ombredanne <[email protected]>
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thanks! The code looks good and the failure is fixed in develop.
I can merge as is!
I fixed the requirements to be pinned for SPDX tools for now as I do not like stars.

@pombredanne pombredanne merged commit caec256 into aboutcode-org:develop Jan 18, 2023
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.

Update scancode for new spdx-tools release
5 participants