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鈥檒l 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 meret.behrens@tngtech.com

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.

Here are two more locations that probably need to be adapted:

spdx_tools >= 0.7.0a3

spdx_tools >= 0.7.0a3

@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:
nexB/aboutcode-toolkit#515
nexB/container-inspector#49
nexB/fetchcode#87
nexB/debian-inspector#34
nexB/typecode#30
nexB/plugincode#8
nexB/commoncode#50
nexB/extractcode#45
nexB/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 <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
@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 <pombredanne@nexb.com>
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 nexB: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