Repository navigation
[Refactor] Modernization: Python 3.10-3.15, ruff, PEP 621 packaging and tag-triggered publishing - #97
Merged
Merged
Conversation
…ed publishing - pyproject.toml uses the standard [project] table. Python 3.8 and 3.9 are EOL and dropped; 3.14 and 3.15 are added (#95). - The CLI's dependencies, click and tabulate, become the `cli` extra (#96). Importing the package no longer imports the CLI. - ruff replaces black, isort, pylint and pydocstyle, and mypy comes off its 2023 pin: pydantic's mypy plugin understands the aliased fields. - The unit tests move out of the package into tests/, so they aren't shipped in the wheel. - CI runs lint and the tests on every supported Python, on PRs and pushes to master. A Publish workflow publishes to PyPI with trusted publishing when a version tag is pushed, after a maintainer approves the `pypi` environment, and dev/release.py prepares and tags releases. CHANGELOG.md moves to the Keep a Changelog format the workflow reads release notes from. - The leftovers of the project template go: Travis, AppVeyor, Scrutinizer, Read the Docs, sniffer, tox, verchew and the bin/ scripts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
19 tasks
A pass/fail per method against staging, like node-anvil's test-client.js. Written against the 5.x client here, so it can be run on a release before and after a change to see which behaviors changed; the transport change updates it to the 6.0 API, and that diff is the list of changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Regenerating the lock had picked up graphql-core 3.3.0, whose AST nodes are immutable. gql 3.6.0b2 assigns to them when it builds the introspection query, so fetching the schema from the API failed with FrozenInstanceError. The old lock had 3.3.0a3, which works. The transport change drops gql, and the pin with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
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
Layer 1 of 4 of the client modernization. The toolchain, packaging and CI, so the client changes in the layers above are built and checked the modern way.
pyproject.tomluses the standard[project]table.clickandtabulatebecome thecliextra, sopip install python-anvilno longer pulls in the CLI's dependencies. Importingpython_anvilno longer imports the CLI.tests/, so they stop shipping in the wheel.pypienvironment, the same shape as node-anvil's.dev/release.pyprepares and tags releases.CHANGELOG.mdmoves to the Keep a Changelog format the workflow reads release notes from.bin/.test-client.pyruns every method against a real environment (staging by default) and prints a PASS, FAIL or SKIP for each, like node-anvil's test-client.js. It is written against the 5.x client here, so it can be run before and after the transport change in [Feature] Modernization: one requests transport with base_url, OAuth, adaptive rate limits and typed errors #98; the diff of the script between the two layers is the list of behavior changes. The 5.x queriesget_castsandget_weldsare expected to FAIL on this layer: the API'scastsandweldsfields are paginated now, which [Feature] Modernization: one requests transport with base_url, OAuth, adaptive rate limits and typed errors #98 fixes.graphql-coreis pinned to 3.3.0a3, the version the old lock had. Regenerating the lock had picked up 3.3.0, whose immutable AST nodes break gql 3.6.0b2's schema fetch withFrozenInstanceError. [Feature] Modernization: one requests transport with base_url, OAuth, adaptive rate limits and typed errors #98 drops gql and the pin.Setup before the first release is in CONTRIBUTING.md under Publishing: a trusted publisher on pypi.org and a
pypienvironment with required reviewers. No secrets.How to verify
make install && make lint && make testpasses on Python 3.10 and 3.15 (verified locally on both)poetry buildproduces a wheel with notests/in it andLICENSE.mdin itimport python_anvilworks andimport python_anvil.cliraises an ImportError pointing atpython-anvil[cli]python_anvil[cli]gives a workinganvil --helppoetry run python dev/release.py prepare 6.0.0 --dry-rundescribes the release branch, bump and changelog rename without changing anythingANVIL_API_KEY=<staging key> make test-clienton this layer runs the 5.x client against staging and prints a result per method (not run here: no staging key in this environment)Breaking Changes
Python 3.8 and 3.9 are no longer supported, and the CLI needs the
cliextra. Both are noted under Unreleased inCHANGELOG.mdfor 6.0.0.Fixes #95
Fixes #96