-
-
Notifications
You must be signed in to change notification settings - Fork 257
Modernize CI/CD: switch to uv, fix Python 3.11+ compatibility #576
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Use mock.patch.object() instead of string-based mock.patch() - Add cache_clear() call before mocking load_library - Fixes AttributeError in TestLibraryIntegration tests The string-based mock.patch() path resolution changed in Python 3.11+ (using pkgutil.resolve_name()), which can fail to find attributes that were imported into a module from elsewhere. See: python/cpython#117860 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Replace pip with uv across all GitHub Actions workflows - Use astral-sh/setup-uv@v5 action for uv installation - Update Python versions: drop 3.9 (EOL Oct 2025), add 3.14 - Update platform images to ubuntu-24.04 where appropriate - Update pyproject.toml: requires-python >= 3.10 - Update tox.ini: py310-py314, use python3.13 for tools - Update CLAUDE.md documentation to reflect new versions Benefits of uv: - Significantly faster package installation - Better dependency resolution - Modern Python packaging tool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Remove macos-13 from all workflow matrices (runner images retired) - Update remaining publish workflows to use uv instead of pip - Add Python 3.14 to publish workflow matrices - Fix Windows Python versions (3.10-3.14) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The macos-14 runner is ARM64, so we need cross-compile flags to build x86_64 binaries for the universal binary. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
/usr/local/lib doesn't exist on macos-14 runners; use a local path instead and copy the result to snap7/lib/. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
uv automatically creates/uses .venv, so we can remove the explicit `uv venv venv` steps and use `uv run` for execution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
uv pip install doesn't auto-create venv, so we need explicit uv venv before uv pip install. Still simplified by using default .venv path and uv run for execution. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
uv run syncs the project from pyproject.toml, which rebuilds the package from source without the bundled library. Using .venv/bin/pytest directly avoids this issue. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Use uv run for most workflows (cleaner syntax) - Keep .venv/bin/pytest for wheel test jobs (with comment explaining why uv run would rebuild from source and lose the bundled snap7 library) - Replace requirements-dev.txt with uv.lock (generated with Python 3.10) - Simplify tox.ini to use extras instead of requirements file - Remove requirements-dev tox environment (no longer needed) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
--no-project prevents uv from discovering and syncing the project, avoiding the rebuild that would lose the bundled snap7 library. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Add UV caching to all workflows for faster dependency installs - Add concurrency control to cancel in-progress runs on new pushes - Fix artifact name conflicts by using unique names per platform - Delete redundant mypy.yml (already runs in pre-commit) - Add Python 3.14 to ARM64 test matrix - Fix pyproject.toml: [lint] -> [tool.ruff.lint] - Fix Makefile: correct .venv path in clean, remove dead code - Update pre-commit hooks to latest versions - Fix S7DataItem deprecation warning for Python 3.19 compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update README.rst: Python 3.9+ -> 3.10+ - Update CLAUDE.md: Python 3.9+ -> 3.10+ - Update doc/introduction.rst: Python 3.7+ -> 3.10+, snap7 1.1.0 -> 1.4.2 - Fix Makefile: uv run pip -> uv pip for sphinx-build target 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
nikteliy
approved these changes
Dec 29, 2025
Replace deprecated license classifier with modern SPDX format:
- Remove "License :: OSI Approved :: MIT License" classifier
- Change license = {text = "MIT License"} to license = "MIT"
See: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
The SPDX string format (license = "MIT") requires setuptools >= 69.0.0, but the manylinux build containers use Python 3.8 with older setuptools. Revert to table format while keeping the deprecated classifier removed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes
Test fixes
CI/CD modernization
Python versions
Configuration
🤖 Generated with Claude Code