Skip to content

Chore | Add support for python 3.13 #310

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

angelofenoglio
Copy link
Contributor

@angelofenoglio angelofenoglio commented Jul 29, 2025

What?

  • Support python 3.13

Summary by CodeRabbit

  • Documentation

    • Updated docs and setup instructions to list Python 3.13.x as a supported version and to show installation/virtualenv examples for Python 3.13.
  • Chores

    • Updated CI/release workflows and test matrices to include Python 3.13 and refreshed action versions.
    • Updated package metadata and compatibility entries to declare Python 3.13 support (replacing prior 3.9 default references).

Copy link
Contributor

coderabbitai bot commented Jul 29, 2025

Warning

Rate limit exceeded

@angelofenoglio has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b1836cd and 387940f.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/release-pypi-build-push-package.yml (1 hunks)
  • .github/workflows/release-pypi-build-push-test-package.yml (1 hunks)
  • .github/workflows/tests-integration.yaml (1 hunks)
  • .github/workflows/tests-unit.yml (2 hunks)
  • README.md (3 hunks)
  • pyproject.toml (2 hunks)

Walkthrough

Added Python 3.13 support across the project by updating GitHub Actions workflows (release, test, integration, unit), expanding test matrices, and updating README and pyproject.toml to declare Python 3.13 compatibility.

Changes

Cohort / File(s) Change Summary
CI: Release workflows
.github/workflows/release-pypi-build-push-package.yml, .github/workflows/release-pypi-build-push-test-package.yml
Bumped actions versions (checkout v2→v4, setup-python v2→v5) and updated python-version from 3.9 to 3.13. No other logic changed.
CI: Test matrices
.github/workflows/tests-integration.yaml, .github/workflows/tests-unit.yml
Added Python 3.13 to the test matrices (previously tested 3.9–3.12). No other workflow steps changed.
Docs: README
README.md
Updated system requirements and installation/virtualenv examples to reference Python 3.13 (pyenv and venv examples renamed/adjusted).
Project metadata
pyproject.toml
Added Python 3.13 classifier and expanded [tool.poetry.dependencies] python spec to allow ~3.13.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant Repo as Repository
    participant GH as GitHub Actions
    participant Tests as Test Matrix
    participant Docs as README/pyproject

    Dev->>Repo: Push CI/docs metadata changes
    Repo->>GH: Trigger workflows (release, unit, integration)
    GH->>Tests: Run jobs across Python versions (3.9,3.10,3.11,3.12,3.13)
    Dev->>Docs: Update README and pyproject.toml to include 3.13
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • exequielrafaela
  • Franr
  • diego-ojeda-binbash

Poem

"A rabbit hops to version new,
Three point thirteen—let tests ensue.
Workflows, docs, and metadata sprout,
Pipelines hum and checks run out.
🐇 Small hop, big leap—code’s all set to view."

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/add-support-for-python-3.13

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.
  • 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.

Support

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

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 generate unit tests to generate unit tests for 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.

@angelofenoglio angelofenoglio force-pushed the chore/add-support-for-python-3.13 branch from 8480c90 to dc32855 Compare July 29, 2025 20:23
@coveralls
Copy link
Collaborator

coveralls commented Jul 29, 2025

Pull Request Test Coverage Report for Build 16888289585

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.007%) to 61.145%

Files with Coverage Reduction New Missed Lines %
leverage/modules/credentials.py 1 54.52%
modules/credentials.py 1 54.52%
Totals Coverage Status
Change from base Build 16887675125: 0.007%
Covered Lines: 2610
Relevant Lines: 4136

💛 - Coveralls

Copy link
Contributor

@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: 2

🔭 Outside diff range comments (1)
README.md (1)

131-133: Wrong virtual-env name breaks the setup instructions

The snippet still refers to the old leverage_py_39_venv, which no longer exists in the steps above.

-pyenv local leverage_py_39_venv
+pyenv local leverage_py_313_venv   # or leverage_py_312_venv if you keep the 3.12 example
♻️ Duplicate comments (1)
README.md (1)

115-116: Verify patch-level availability before publishing

pyenv install 3.13.3 will break newcomers if 3.13.3 hasn’t been released yet (final 3.13 might ship as 3.13.0). Consider using a placeholder (3.13.x) or a released tag.

🧹 Nitpick comments (5)
.github/workflows/tests-unit.yml (1)

10-10: Matrix expanded 👍 – but coverage upload still tied to 3.9.

Adding 3.13 is great. However, the Coveralls step later on is gated by
if: matrix.python-version == '3.9'. This means coverage will not be
reported for the brand-new interpreter.

Two quick options:

  1. Switch the condition to '3.13' so the latest version drives the badge.
  2. Remove the if and let only the first job (via matrix.include or needs) upload once.

Otherwise the badge may hide interpreter-specific gaps.

pyproject.toml (2)

20-22: Classifier order/value looks fine – minor nit: keep them sorted to avoid merge churn:

     "Programming Language :: Python :: 3.9",
     "Programming Language :: Python :: 3.10",
     "Programming Language :: Python :: 3.11",
     "Programming Language :: Python :: 3.12",
     "Programming Language :: Python :: 3.13",

30-30: Simplify the Python version constraint for maintainability.

Enumerating every minor line means another commit each time Python ships.
Poetry understands range syntax, so the same intent can be expressed as:

-python = "~3.9 || ~3.10 || ~3.11 || ~3.12 || ~3.13"
+python = ">=3.9,<4.0"

This still excludes 3.8 and earlier but automatically admits 3.14+ when you’re ready.

.github/workflows/tests-integration.yaml (1)

28-28: Avoid pinning patch versions in the test matrix.

actions/setup-python resolves 3.13 to the latest available patch.
Hard-coding 3.13.3 risks CI breakage the moment a patch disappears or the cache misses.

-        python-version: ['3.9.15', '3.10.8', '3.11.8', '3.12.7', '3.13.3']
+        python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

This keeps the matrix current with zero maintenance.

README.md (1)

120-124: Example still pins to 3.12 – switch to 3.13 or make version-agnostic

To be consistent with the new 3.13 support you just added, either:

  1. Update the heading and command to use 3.13.x, or
  2. Replace the concrete version with a placeholder to avoid future churn.
-Create a virtual environment for your project using Python 3.12.7:
+Create a virtual environment for your project using Python 3.13.x:
@@
-pyenv virtualenv 3.12.7 leverage_py_312_venv
+pyenv virtualenv 3.13.x leverage_py_313_venv
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c6516b9 and c823cf5.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .github/workflows/release-pypi-build-push-package.yml (1 hunks)
  • .github/workflows/release-pypi-build-push-test-package.yml (1 hunks)
  • .github/workflows/tests-integration.yaml (1 hunks)
  • .github/workflows/tests-unit.yml (1 hunks)
  • README.md (3 hunks)
  • pyproject.toml (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: the toolbox image tags `1.3.5-0.2.0`, `1.5.0-0.2.0`, and `1.6.0-0.2.0` exist in the registry....
Learnt from: exequielrafaela
PR: binbashar/leverage#289
File: .github/workflows/tests-integration.yaml:28-29
Timestamp: 2024-10-17T16:31:27.570Z
Learning: The toolbox image tags `1.3.5-0.2.0`, `1.5.0-0.2.0`, and `1.6.0-0.2.0` exist in the registry.

Applied to files:

  • .github/workflows/tests-integration.yaml
🔇 Additional comments (1)
README.md (1)

73-76: Supported-version list update LGTM

Adding “Python 3.13.x” keeps the docs aligned with the new CI matrix.

Copy link
Contributor

@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: 1

🔭 Outside diff range comments (2)
.github/workflows/release-pypi-build-push-package.yml (2)

26-31: Wrong env var export and incorrect Poetry PATH

  • export ENV POETRY_VIRTUALENVS_CREATE=false sets a variable named ENV; it doesn’t set POETRY_VIRTUALENVS_CREATE.
  • Poetry installed via the official script is typically at $HOME/.local/bin, not ~/.poetry/bin.
       - name: Install dependencies using Poetry
         run: |
           echo "[INFO] Installing dependencies..."
-          export ENV POETRY_VIRTUALENVS_CREATE=false
-          export PATH="${PATH}:${HOME}/.poetry/bin"
+          export POETRY_VIRTUALENVS_CREATE=false
+          export PATH="$HOME/.local/bin:$PATH"
           poetry install --with=dev

19-25: Ensure Poetry is on PATH and supports Python 3.13

Both Poetry 1.8.2 and 1.8.3 lack a “Programming Language :: Python :: 3.13” classifier, so pinning to 1.8.2 (or 1.8.3) will break under Python 3.13. You should also prepend $HOME/.local/bin to your PATH before invoking poetry.

• Add export PATH="$HOME/.local/bin:$PATH" so the installer’s poetry binary is found.
• Either remove the POETRY_VERSION pin (so the installer grabs the latest release that includes Python 3.13 support)
• Or explicitly pin to the first Poetry release that adds Python 3.13 in its classifiers (e.g. ≥1.9.x once confirmed).

Proposed diff:

       - name: Install Poetry
         run: |
           echo "[INFO] Installing Poetry..."
+          # Make sure the installer’s poetry binary is on PATH
+          export PATH="$HOME/.local/bin:$PATH"
-          curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.8.2 python -
+          # Install latest Poetry (removes pin so Python 3.13 support is included)
+          curl -sSL https://install.python-poetry.org | python -
           echo "[INFO] Configuring Poetry..."
           poetry config virtualenvs.create false  # Prevent poetry from creating a virtual environment
♻️ Duplicate comments (2)
.github/workflows/release-pypi-build-push-package.yml (2)

11-11: actions/checkout@v4 upgrade: LGTM

This aligns with modern runners and prior feedback.


15-17: actions/setup-python@v5 with Python 3.13: LGTM

Matches declared 3.13 support and fixes the actionlint complaint.

🧹 Nitpick comments (1)
.github/workflows/release-pypi-build-push-package.yml (1)

15-17: Speed up installs with built-in Poetry cache

actions/setup-python@v5 supports caching. Recommend enabling it for Poetry.

       - uses: actions/setup-python@v5
         with:
-          python-version: '3.13'
+          python-version: '3.13'
+          cache: 'poetry'
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c823cf5 and b1836cd.

📒 Files selected for processing (3)
  • .github/workflows/release-pypi-build-push-package.yml (1 hunks)
  • .github/workflows/release-pypi-build-push-test-package.yml (1 hunks)
  • README.md (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • README.md
  • .github/workflows/release-pypi-build-push-test-package.yml
🔇 Additional comments (1)
.github/workflows/release-pypi-build-push-package.yml (1)

33-36: Version bump during a published release can desync tag and package

Running make bump-version-ci in a workflow triggered by release: published may produce a commit that no longer matches the released tag. Verify your intended flow (tag -> build -> publish) vs. (bump -> tag -> release).

If the canonical flow is “tag first, then publish,” consider:

  • Removing the bump from this job, or
  • Triggering this pipeline earlier (pre-release) and using the tag created by the bump step.

Comment on lines 12 to 13
with:
ref: master
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Release builds should check out the tag, not master

On release: published, building from master can package the wrong commit. Use the event ref (the tag) or omit ref to default to the triggering ref.

-        with:
-          ref: master
+        with:
+          # Build the exact commit associated with the published release tag
+          ref: ${{ github.ref }}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
with:
ref: master
with:
# Build the exact commit associated with the published release tag
ref: ${{ github.ref }}
🤖 Prompt for AI Agents
.github/workflows/release-pypi-build-push-package.yml lines 12-13: the workflow
currently forces checkout of master which can build the wrong commit for
tag-triggered releases; update the checkout step to use the triggering ref or
omit ref so actions/checkout defaults to it — replace or change the ref value to
use the workflow expression (for example ref: ${{ github.ref }}) or remove the
ref line entirely so the tag that triggered the workflow is checked out.

@angelofenoglio angelofenoglio force-pushed the chore/add-support-for-python-3.13 branch from 9fb2ac5 to 0049202 Compare August 11, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants