Repository navigation
Trunk-based releases: build on main, publish from a GitHub Release - #57
Merged
Merged
Conversation
…lease
- build.yml (replaces main.yml): tests on Python 3.10-3.13 with pytest, then builds and checks the
sdist and wheel as a 0.0.0.devN+gSHA artifact; the `build` job is the required check.
- publish.yml: a GitHub Release v{semver} published by tomasr78 builds the tag with the tag's version,
tests the installed wheel and uploads to PyPI with Trusted Publishing (same file and pypi environment,
so the existing trusted publisher still matches). Never re-uploads an existing version.
- Packaging moved to pyproject.toml; __version__ is a placeholder written from the tag.
- Tests ported from nose to pytest; new mocked tests run without network, the old ones are `live`.
- Actions pinned to SHAs, upload-artifact v7, weekly Dependabot for actions.
- RELEASING.md and CHANGELOG.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
Package metadata must enforce the documented Python 3.10 minimum to prevent installers selecting unsupported releases.
1 open issue
What changed in this PR
Moves the Python SDK to trunk-based releases: changes to main build artifacts, while published GitHub Releases trigger PyPI publishing.
Changes:
- Separates build validation from guarded Trusted Publishing.
- Migrates packaging to
pyproject.toml. - Replaces nose with pytest, adds mocked tests, and documents releasing.
| File | Description |
|---|---|
| tests/utils.py | Removes obsolete unittest helper. |
| tests/test_convertapi.py | Migrates live tests to pytest. |
| tests/test_client.py | Adds mocked client tests. |
| tests/conftest.py | Adds configuration restoration and live-test fixtures. |
| test-requirements.txt | Updates test dependencies. |
| setup.py | Removes legacy packaging script. |
| setup.cfg | Removes legacy packaging configuration. |
| requirements.txt | Removes redundant dependency declaration. |
| RELEASING.md | Documents release procedures and safeguards. |
| README.md | Updates installation, requirements, and development guidance. |
| pyproject.toml | Defines packaging metadata and pytest configuration. |
| convertapi/__init__.py | Introduces a build-time version placeholder. |
| CHANGELOG.md | Records packaging and release changes. |
| .gitignore | Ignores pytest cache. |
| .github/workflows/publish.yml | Adds release validation and isolated PyPI publishing. |
| .github/workflows/main.yml | Removes the previous build workflow. |
| .github/workflows/build.yml | Adds test matrix and artifact validation. |
| .github/dependabot.yml | Enables weekly action updates. |
Review effort: Balanced
| license-files = ["LICENSE.txt"] | ||
| authors = [{ name = "Tomas Rutkauskas", email = "support@convertapi.com" }] | ||
| keywords = ["convert", "api", "client", "conversion"] | ||
| dependencies = ["requests>=2.4.2"] |
Contributor
Author
There was a problem hiding this comment.
Deliberately not adding requires-python in a patch release: 2.0.0 declared no minimum, and a floor would quietly pin 3.8/3.9 users to 2.0.0 without the 2.0.1 fix. The README now states the tested versions instead of a minimum (#58). A minimum belongs in a minor release.
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.

Moves the Python SDK to the same release flow as https://github.com/ConvertAPI/convertapi-library-dotnet:
mainis the only branch, merging builds, and a GitHub Releasev{semver}publishes.Build (
build.yml, replacesmain.yml) — on every PR and push tomain:teston Python 3.10, 3.11, 3.12, 3.13 with pytest (was 3.7/3.9 with nose, which no longer runs on current Python);build(the required check): passes only if every test job passed, then builds the sdist and wheel as0.0.0.dev{run}+g{sha}, runstwine check --strict, installs the wheel in a clean venv and uploads it as an artifact. Nothing is published.Publish (
publish.yml, same file name andpypienvironment, so the existing PyPI trusted publisher still matches) — on a published GitHub Release:tomasr78(checked in both jobs);v2.0.1,v2.1.0-rc.1→2.1.0rc1), the pre-release tick, that a stable tag is onmain, and that PyPI has never had the version;convertapi/__init__.py, builds, tests the installed wheel;id-token: write), PEP 740 attestations, neverskip-existing.Other
setup.py/setup.cfg→pyproject.toml; the PyPI page now shows the README and project links; the wheel ispy3-none-anyinstead ofpy2.py3.live, and skipped unlessCONVERT_API_SECRETis set (the repository has no such secret, so they had not run in CI). New mocked tests (responses) cover the request/response handling without network.RELEASING.md,CHANGELOG.md, README updated (pytest,main, badge).Repository settings done alongside:
masterrenamed tomain; rulesets formain(PR, merge commits only,buildrequired, admin bypass),v*tags admin-only andv*tags pattern-checked;pypienvironment limited tov*tags; squash and rebase merging off.🤖 Generated with Claude Code