Skip to content

chore: update minimum python version to 3.9 #138

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

Conversation

matiasdaloia
Copy link
Contributor

@matiasdaloia matiasdaloia commented Jul 15, 2025

Summary by CodeRabbit

  • Chores
    • Updated the minimum required Python version to 3.9 across documentation, configuration files, and workflows.
    • Updated workflow files to use Python 3.9 for testing, linting, and publishing.
    • Updated the project version to 1.29.0.
    • Added a changelog entry for version 1.29.0.

@matiasdaloia matiasdaloia self-assigned this Jul 15, 2025
@matiasdaloia matiasdaloia added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Jul 15, 2025
Copy link

coderabbitai bot commented Jul 15, 2025

Walkthrough

The minimum required Python version for the project was raised from 3.7 (or 3.8/3.10 in some places) to 3.9 across all documentation, configuration, and CI workflow files. Related version strings, linter targets, and workflow triggers were updated for consistency. The project version was incremented to 1.29.0, and changelogs were updated accordingly. Additionally, type annotations in src/scanoss/cyclonedx.py were refined from json to dict.

Changes

File(s) Change Summary
.github/workflows/container-local-test.yml
.github/workflows/container-publish-ghcr.yml
.github/workflows/lint.yml
.github/workflows/python-local-test.yml
.github/workflows/python-publish-pypi.yml
.github/workflows/python-publish-testpypi.yml
.github/workflows/version-tag.yml
Updated Python version in CI workflows from 3.10.x/3.8 to 3.9.x; minor syntax and formatting adjustments; updated tag patterns and string formatting.
CHANGELOG.md Added entry for version 1.29.0 (2025-07-15) documenting the Python 3.9 minimum requirement.
PACKAGE.md
README.md
docs/source/index.rst
Updated documentation to state Python 3.9+ as the minimum requirement.
pyproject.toml Changed Ruff linter target version from py37 to py39.
setup.cfg Increased minimum required Python version from 3.7 to 3.9.
src/scanoss/init.py Updated __version__ from '1.28.3' to '1.29.0'.
src/scanoss/cyclonedx.py Changed type annotations and docstrings from json to dict for parse and produce_from_json methods.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CI Workflow
    participant Python Environment

    User->>CI Workflow: Trigger workflow (push, tag, etc.)
    CI Workflow->>Python Environment: Set up Python 3.9.x
    Python Environment-->>CI Workflow: Python 3.9.x ready
    CI Workflow->>CI Workflow: Run build, lint, test, or publish steps
Loading

Poem

🐇
A hop to Python three-point-nine,
Our code now shines, robust and fine!
Docs and workflows all aligned,
The changelog marks the upward climb.
With version bumps and checks anew,
This rabbit cheers the work you do!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a406ab2 and cec64a7.

📒 Files selected for processing (1)
  • src/scanoss/cyclonedx.py (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/scanoss/cyclonedx.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🔭 Outside diff range comments (1)
setup.cfg (1)

26-38: Drop the importlib_resources back-port & add an explicit Python 3.9 classifier

Now that the minimum supported version is 3.9, the importlib_resources back-port is no longer required (it’s in the stdlib as importlib.resources).
Removing it trims one dependency and avoids shipping redundant code.
While touching the metadata, consider adding Programming Language :: Python :: 3.9 under the classifiers block for clarity.

@@
 python_requires = >=3.9
@@
-    importlib_resources
+    # importlib.resources is built-in from 3.9
+
@@ classifiers =
     Programming Language :: Python :: 3
+    Programming Language :: Python :: 3.9
🧹 Nitpick comments (9)
PACKAGE.md (1)

140-142: Ensure ancillary version references remain consistent across the doc

The Python-version bump on L141 is correct. However, the CLI snippet above (L64) still shows Ver: 1.6.1, which diverges from the new 1.29.0 in src/scanoss/__init__.py. Please sweep the file (and other docs) for stale version strings to avoid confusing users.

-64 | SCANOSS Python CLI. Ver: 1.6.1, License: MIT, Fast Winnowing: True
+64 | SCANOSS Python CLI. Ver: 1.29.0, License: MIT, Fast Winnowing: True
.github/workflows/container-local-test.yml (1)

26-32: Consider a test matrix instead of a single Python version

Changing the runtime to 3.9.x aligns with your new minimum requirement, but CI now provides zero coverage for newer CPython releases (3.10-3.12). Bugs that surface only on newer interpreters will go undetected at release time. A simple matrix keeps confidence high:

    strategy:
      matrix:
        python-version: ["3.9", "3.10", "3.11", "3.12"]
.github/workflows/python-local-test.yml (1)

22-26: Same single-version limitation applies here

Only testing on 3.9.x may hide incompatibilities with newer interpreters. Recommend introducing a version matrix (see previous comment).

.github/workflows/container-publish-ghcr.yml (1)

30-34: Align publish workflow with broader CI strategy

Same remark as other workflows: limiting the build host to 3.9.x reduces early detection of issues on upcoming Python versions. A matrix (or at least 3.9 + latest) is advisable.

CHANGELOG.md (1)

12-15: Clarify the impact of dropping < 3.9 support
Mention explicitly that Python 3.7/3.8 are no longer supported so downstream users understand the breaking nature of the change.

.github/workflows/version-tag.yml (1)

21-26: Quoting numeric fetch-depth is unnecessary
actions/checkout expects an integer; keep it numeric for readability:

-          fetch-depth: "0"
+          fetch-depth: 0

No functional change, purely style.

.github/workflows/python-publish-testpypi.yml (2)

4-4: Trigger block is valid but uncommon
on: [workflow_dispatch] works, yet the rest of your workflows use expanded YAML mapping style. Consider aligning formats for consistency.


68-69: Verify test matrix on 3.9 only
If you intend to continue validating on 3.10/3.11, add a matrix; otherwise 👍.

.github/workflows/python-publish-pypi.yml (1)

53-53: Left-over commented line
If skip-existing is intentionally disabled, delete the line to avoid confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 589259c and a406ab2.

📒 Files selected for processing (14)
  • .github/workflows/container-local-test.yml (1 hunks)
  • .github/workflows/container-publish-ghcr.yml (3 hunks)
  • .github/workflows/lint.yml (1 hunks)
  • .github/workflows/python-local-test.yml (1 hunks)
  • .github/workflows/python-publish-pypi.yml (5 hunks)
  • .github/workflows/python-publish-testpypi.yml (5 hunks)
  • .github/workflows/version-tag.yml (1 hunks)
  • CHANGELOG.md (2 hunks)
  • PACKAGE.md (1 hunks)
  • README.md (1 hunks)
  • docs/source/index.rst (1 hunks)
  • pyproject.toml (1 hunks)
  • setup.cfg (1 hunks)
  • src/scanoss/__init__.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (14)
pyproject.toml (1)

9-10: LGTM – Ruff target bumped correctly
The linter will now assume 3.9 syntax and built-ins. No issues spotted.

docs/source/index.rst (1)

38-38: Docs in sync with runtime requirement
Requirement line updated to 3.9 – looks good.

README.md (1)

27-27: README reflects new minimum version
Change is correct and consistent with the rest of the PR.

.github/workflows/lint.yml (1)

20-20: CI matrix narrowed to 3.9 – double-check other jobs

The linter job now runs on 3.9; make sure all remaining workflows (test, build, publish) were updated in lock-step so the whole pipeline still exercises the supported range.

src/scanoss/__init__.py (1)

25-25: Version bump looks good

__version__ correctly reflects the planned 1.29.0 release.

.github/workflows/container-publish-ghcr.yml (1)

7-9: Quoting style change: no functional issue

Switching to double quotes for the tag glob is benign; both quoting styles are valid in YAML.

CHANGELOG.md (1)

611-612: Broken link anchor – remove leading “v”
Previous anchors omit the “v” prefix (e.g. [1.28.2]). Use the same pattern or update every reference to stay consistent.

.github/workflows/version-tag.yml (1)

24-27: Ensure repository scripts run on 3.9
The repo previously ran on 3.10; verify any 3.10-only syntax (match/case, str.removeprefix, etc.) doesn’t exist in tools/get_next_version.sh or other invoked scripts.

.github/workflows/python-publish-testpypi.yml (2)

18-18: Downgraded runner Python – double-check wheel metadata
Confirm that make dist builds wheels with Requires-Python >=3.9 so TestPyPI metadata matches the new minimum.


59-60: Whitespace cleanup looks good
Correctly removed extraneous spaces around the array literal.

.github/workflows/python-publish-pypi.yml (4)

8-9: Quote pattern for tags – OK
Switching to double quotes is harmless; matches YAML spec.


19-19: Wheel metadata must declare >=3.9
Same as TestPyPI workflow – ensure pyproject.toml/setup.cfg now declare the higher minimum.


65-66: Needs array tidy-up looks good
The compact form is clearer.


73-74: Same Python version caveat as above
Verify package install & runtime succeed under 3.9.

@matiasdaloia matiasdaloia merged commit 0862aa1 into main Jul 15, 2025
4 checks passed
@matiasdaloia matiasdaloia deleted the bugfix/mdaloia/132-python-3738-incompatibility-tuple-and-json-used-as-type-hint branch July 15, 2025 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.7/3.8 Incompatibility: tuple[...] and json used as type hint
1 participant