-
Notifications
You must be signed in to change notification settings - Fork 18
Support python 3.13 #95
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughRepository-wide upgrade to Python 3.13: updated runtime declarations (Binder, RTD), CI workflows, and documentation. Read the Docs OS moved to ubuntu-24.04. Project metadata bumped to 1.0.1 with widened Python range. requirements.txt saw extensive dependency refreshes and removals, including dropping a git-based dependency. Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
📖 Documentation Preview The documentation for this PR has been built and is available at: This preview will be updated automatically when you push new commits to this PR. Preview built from commit: |
📖 Documentation Preview The documentation for this PR has been built and is available at: This preview will be updated automatically when you push new commits to this PR. Preview built from commit: |
📖 Documentation Preview The documentation for this PR has been built and is available at: This preview will be updated automatically when you push new commits to this PR. Preview built from commit: |
There was a problem hiding this 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)
.github/workflows/execute_notebooks.yml (1)
49-85
: Missing “verify-changed-files” and no add/commit step — push will never happenYou reference steps.verify-changed-files.outputs.changed but never set it, and there’s no git add/commit before push. As written, this never pushes executed notebooks.
- name: Configure git run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" + - name: Detect changes + id: verify-changed-files + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + else + echo "changed=false" >> "$GITHUB_OUTPUT" + fi + + - name: Commit executed notebooks + if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name != 'pull_request' + run: | + git add -A + git commit -m "Execute notebooks [skip ci]" || echo "No changes to commit" + - name: Push changes if: steps.verify-changed-files.outputs.changed == 'true' && github.event_name != 'pull_request' run: | git push origin ${{ github.ref_name }}
🧹 Nitpick comments (4)
.github/workflows/execute_notebooks.yml (1)
30-35
: Use actions/setup-python v5 for Python 3.13 and future-proofingsetup-python@v5 is the current major and provides updated toolcache handling and Node20 runtime. Recommend bumping.
- - name: Set up Python - uses: actions/setup-python@v4 + - name: Set up Python + uses: actions/setup-python@v5 with: python-version: '3.13' cache: 'pip'.github/workflows/static.yml (1)
38-43
: Upgrade to setup-python v5 and enable pip cacheAlign with other workflows and speed builds.
- - name: Set up python - uses: actions/setup-python@v4 + - name: Set up python + uses: actions/setup-python@v5 with: python-version: '3.13' + cache: 'pip'.readthedocs.yaml (1)
4-7
: RTD Py3.13 on Ubuntu 24.04 is fine; check heavy deps compatibilityWith Python 3.13 on RTD, some heavy packages (e.g., rdkit) may lack wheels and fail the build.
Mitigations:
- Use rdkit-pypi as a first attempt in docs/requirements.txt.
- Mock optional imports in conf.py to avoid installing heavy libs.
- Gate notebooks that depend on RDKit or pre-execute and include outputs.
requirements.txt (1)
29-33
: CairoSVG stack may require system libraries on RTD/CI.cairocffi/cairosvg/tinycss2 often need system packages (cairo, pango, libffi, freetype). With RTD OS set to ubuntu-24.04, confirm build images have these preinstalled or add apt packages in RTD config.
I can propose an RTD v2 config snippet with apt_packages if builds fail.
Also applies to: 267-272, 299-303
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.binder/runtime.txt
(1 hunks).github/workflows/ci.yml
(1 hunks).github/workflows/execute_notebooks.yml
(1 hunks).github/workflows/static.yml
(1 hunks).readthedocs.yaml
(1 hunks)README.md
(1 hunks)docs/Installation.rst
(1 hunks)pyproject.toml
(2 hunks)requirements.txt
(6 hunks)
🧰 Additional context used
🪛 LanguageTool
.binder/runtime.txt
[grammar] ~1-~1: Passe das Symbol an
Context: python-3.13
(QB_NEW_DE_OTHER_ERROR_IDS_REPLACEMENT_OTHER)
⏰ 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: execute-notebooks
🔇 Additional comments (14)
.github/workflows/execute_notebooks.yml (1)
46-47
: RDKit via pip on Python 3.13 is brittle; add a resilient install or alternative sourceManylinux wheels for rdkit on Py3.13 lag. Builds often fail in CI. Add a fallback to rdkit-pypi, or consider excluding it from this workflow if not strictly required.
- pip install ipykernel rdkit cairosvg pymzml + # RDKit can be problematic on Py3.13; try prebuilt wheels first, fallback, or skip if optional + pip install ipykernel cairosvg pymzml + pip install rdkit-pypi || pip install rdkit || echo "RDKit unavailable on Py3.13; skipping"Please confirm notebooks do not hard-require RDKit execution for this workflow; if they do, consider pinning a known-good version or switching to conda for this job.
.github/workflows/static.yml (1)
44-49
: Add apt-get update and harden RDKit install for Py3.13Ensure apt indices are fresh, and make RDKit install resilient.
- name: Install dependencies run: | - sudo apt install pandoc - pip install -r requirements.txt - pip install ipykernel rdkit cairosvg pymzml + sudo apt-get update + sudo apt-get install -y pandoc + pip install -r requirements.txt + pip install ipykernel cairosvg pymzml + # RDKit wheels for 3.13 may be missing; try alternatives or skip if docs don't require it + pip install rdkit-pypi || pip install rdkit || echo "RDKit unavailable on Py3.13; continuing without it" pip install .If documentation sections require RDKit (e.g., nbsphinx runs), consider gating those pages or mocking imports to avoid build failures on RTD/GHA.
docs/Installation.rst (1)
13-14
: LGTM: Update to Python 3.13The installation snippet now matches the repo-wide Python 3.13 target.
README.md (1)
41-44
: LGTM: Conda environment updated to Python 3.13Matches other tooling updates in this PR.
.binder/runtime.txt (1)
1-1
: Verify Binder supports python-3.13 for this repoBinder base images can lag new Python versions. If 3.13 isn’t available, launches will fail.
Please try launching the Binder link and, if it fails, temporarily revert to python-3.12 or supply a full environment.yml to guarantee solver availability.
.github/workflows/ci.yml (1)
10-12
: Matrix addition looks good; align with requires-python upper boundYou advertise requires-python <=3.14 in pyproject, but CI doesn’t test 3.14. Either add 3.14 (or 3.14-dev) to the matrix or change requires-python to "<3.14" until supported.
matrix: os: [ubuntu-latest, windows-latest] # note mac-latest tests fail due to slight differences in images - python-version: ["3.12", "3.13"] + python-version: ["3.12", "3.13"] # add "3.14-dev" when wheels available, or tighten requires-python to "<3.14"pyproject.toml (2)
10-10
: Version bump to 1.0.1 — OKNo issues spotted with the metadata increment.
22-24
: Classifiers updated — OKAdding 3.12 and 3.13 classifiers matches the rest of the PR.
requirements.txt (6)
2-2
: Header correctly targets Python 3.13.Autogenerated note aligns with the PR’s goal. No action needed.
25-26
: bleach[css] extras and css/tinycss2 pins look consistent.Using bleach[css] and pinning cssselect2/tinycss2/webencodings is expected with pip-compile. No issues spotted.
Also applies to: 267-272, 299-303
72-83
: Jupyter/IPython/Plotly stack versions look coherent for Python 3.13.ipykernel/ipython/prompt-toolkit pins align; pydata-sphinx-theme and pygments also consistent. Proceed.
Also applies to: 174-176, 188-199
113-116
: Manual Verification Required: Confirm cp313 Wheels for Compiled Dependencies
I attempted to run the automated wheel-availability check, but the output was incomplete and inconclusive. Please manually verify on PyPI that the exact pinned versions in requirements.txt include Python 3.13 (cp313) wheels (or abi3 wheels) for all key compiled dependencies. Without these, installs will fall back to source builds and are likely to fail.Packages to check (with their pinned versions from requirements.txt):
- numpy == 2.1.2
- matplotlib == 3.10.5
- pillow
- psutil
- pyzmq
- cffi
- regex
- rdkit
This also applies to the same groups of lines elsewhere in requirements.txt (lines 138–145, 165–171, 180–181, 216–220, 226–227, 272–276, 35–36). Ensure each one ships a cp313 wheel (or compatible abi3 wheel) for all supported platforms.
174-176
: Plotly v6 Upgrade: Sanity‐check all downstream usagesPlotly 6.x introduces breaking changes vs 5.x. Your codebase includes many Plotly references—please review and update as needed:
• In pyopenms_viz/_plotly/core.py:
- plotly.graph_objects as go
- plotly.graph_objs.Figure
- plotly.subplots.make_subplots
• In pyopenms_viz/testing/PlotlySnapshotExtension.py:- plotly.io.to_json
• In docs/conf.py and gallery scripts:- import plotly.io as pio
- references to plotly.js v2.x in notebooks under nbs/
• In notebooks (*.ipynb
) and Sphinx galleries:- ensure
Figure.show()
, default templates, and I/O methods still workCheck for renamed functions, changed defaults, removed APIs (e.g., template behavior,
write_html
options), and adjust imports or call signatures accordingly.
228-229
: No security advisories affecting pinned versionsBoth pinned versions already include the relevant CVE fixes—no further action needed:
- requests 2.32.4 contains the fix for CVE-2024-47081 and is not vulnerable.
- urllib3 2.5.0 ships the patches for CVE-2025-50181 and CVE-2025-50182 and is not vulnerable.
"Topic :: Scientific/Engineering :: Chemistry", | ||
] | ||
requires-python = ">=3.10, <=3.13" | ||
requires-python = ">=3.10, <=3.14" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Re-evaluate requires-python upper bound vs CI coverage
You allow installation on 3.14 but do not test it in CI. Either:
- Add 3.14 (or 3.14-dev) to CI matrices, or
- Change to "<3.14" until you officially support it.
-requires-python = ">=3.10, <=3.14"
+# Option A: tighten until CI covers 3.14
+requires-python = ">=3.10, <3.14"
Alternatively, add Python 3.14 to classifiers and CI once available.
🏁 Script executed:
#!/bin/bash
# Search for python-version entries in GitHub Actions workflows to verify CI coverage
grep -R "python-version" -n .github/workflows
Length of output: 554
Re-evaluate requires-python upper bound vs CI coverage
Our GitHub Actions only run on Python 3.12 and 3.13, but pyproject.toml
currently allows installation on 3.14. Please choose one of the following:
• Tighten the upper bound until we add CI for 3.14:
- requires-python = ">=3.10, <=3.14"
+ requires-python = ">=3.10, <3.14"
• Or add Python 3.14 (or 3.14-dev) to your CI matrices in:
– .github/workflows/ci.yml
(matrix.python-version)
– .github/workflows/static.yml
– .github/workflows/execute_notebooks.yml
– (and any other workflow using python-version
)
Once CI passes on 3.14, don’t forget to update your PyPI classifiers to include it.
rdkit==2025.3.5 | ||
# via pyopenms_viz (pyproject.toml) | ||
referencing==0.36.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High risk: rdkit pin may not have Python 3.13 wheels on PyPI.
RDKit wheels on PyPI have historically been limited/inconsistent across OS/architectures. If cp313 wheels aren’t published for 2025.3.5, installs will fail (CI/RTD/users).
Actions:
- Verify the exact version exists on PyPI and ships cp313 wheels for Linux/macOS/Windows.
- If not, consider: using conda for rdkit, switching to rdkit-pypi (community wheels), or gating rdkit behind an extra/optional dependency for pip-only installs.
I can help draft extras/platform markers or a docs note with conda-first guidance if needed.
🤖 Prompt for AI Agents
In requirements.txt around lines 220 to 222, the pinned rdkit==2025.3.5 may not
publish cp313 wheels on PyPI causing installs to fail for Python 3.13; verify on
PyPI that rdkit 2025.3.5 ships cp313 wheels for Linux/macOS/Windows and if it
does not, remove or replace the direct pip pin by one of these fixes: (1) remove
rdkit from the main requirements and document a conda-first installation (or add
a conda environment file) so users install RDKit via conda, (2) replace with
rdkit-pypi (community wheels) and test cp313 availability, or (3) make rdkit an
optional extra or use platform/marker-specific requirement lines so pip-only
installs don’t fail; update README/installation docs to reflect the chosen
approach and add CI matrix checks for Python 3.13 to ensure installs succeed.
In theory this should work however, the ci tests will likely have to be updated because they are all visual tests and thus very specific to all the versions that they were created with. I am ok if you want to update 3.13 to be supported however we should keep the testing at 3.12 for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See note above. I am not sure if I am ready to bump everything to 3.13 yet since all the tests are specific for 3.12. Since these are visual snapshots they are very sensitive to version changes.
In theory 3.13 should work though so if we want to just bump that up on PyPI I'm fine with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep this as is for testing purposes.
os: ubuntu-24.04 | ||
tools: | ||
python: "3.12" | ||
python: "3.13" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would keep testing at 3.12 for now, see above
matrix: | ||
os: [ubuntu-latest, windows-latest] # note mac-latest tests fail due to slight differences in images | ||
python-version: ["3.12"] | ||
python-version: ["3.12", "3.13"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would keep testing at 3.13 for now, see above
Summary by CodeRabbit
Chores
Documentation