Skip to content

Conversation

@gijzelaerr
Copy link
Owner

Summary

  • Fix mock.patch compatibility with Python 3.11+
  • Switch all CI/CD workflows to use uv
  • Update Python versions: drop 3.9, add 3.14
  • Update dependencies and add tox-uv

Changes

Test fixes

  • tests/test_client.py and test_server.py: Use mock.patch.object() with cache_clear()

CI/CD modernization

  • All workflow files use astral-sh/setup-uv@v5
  • Replace pip with uv pip install

Python versions

  • Supported: 3.10, 3.11, 3.12, 3.13, 3.14

Configuration

  • pyproject.toml: requires-python >= 3.10, added tox-uv
  • tox.ini: Updated envlist
  • requirements-dev.txt: Regenerated

🤖 Generated with Claude Code

gijzelaerr and others added 12 commits December 28, 2025 13:44
- 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]>
gijzelaerr and others added 2 commits December 29, 2025 11:56
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]>
@gijzelaerr gijzelaerr merged commit a8dc6fd into master Dec 29, 2025
72 checks passed
@gijzelaerr gijzelaerr mentioned this pull request Dec 29, 2025
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.

3 participants