diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b547460..0e7e80e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,6 +19,23 @@ jobs: with: python-version: "3.10" - run: pip install build + - name: Verify tag matches package version + run: | + TAG="${{ github.event.release.tag_name }}" + TAG_VERSION="${TAG#v}" + PKG_VERSION=$(python -c " + import ast, pathlib + tree = ast.parse(pathlib.Path('src/triggerdev/_version.py').read_text()) + for node in ast.walk(tree): + if isinstance(node, ast.Assign): + for target in node.targets: + if isinstance(target, ast.Name) and target.id == '__version__': + print(ast.literal_eval(node.value)) + ") + if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then + echo "::error::Tag version ($TAG_VERSION) does not match _version.py ($PKG_VERSION)" + exit 1 + fi - run: python -m build - uses: actions/upload-artifact@v4.6.0 with: diff --git a/README.md b/README.md index 3dad6cd..ff1f393 100644 --- a/README.md +++ b/README.md @@ -126,8 +126,8 @@ with Client() as client: ## Contributing -Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. +Contributions are welcome. See [CONTRIBUTING.md](https://github.com/mehmetkr/triggerdev-python/blob/main/CONTRIBUTING.md) for guidelines. ## License -[MIT](LICENSE) +[MIT](https://github.com/mehmetkr/triggerdev-python/blob/main/LICENSE) diff --git a/tests/conftest.py b/tests/conftest.py index cd88081..6186522 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,9 +2,7 @@ from __future__ import annotations -import httpx2 import pytest -import respx from triggerdev import Client @@ -19,17 +17,6 @@ def api_key() -> str: return "tr_dev_sk_test_1234" -@pytest.fixture() -def respx_mock() -> respx.MockRouter: - with respx.mock(assert_all_called=False) as router: - yield router - - @pytest.fixture() def client(api_key: str, base_url: str) -> Client: return Client(api_key=api_key, base_url=base_url) - - -@pytest.fixture() -def mock_response() -> httpx2.Response: - return httpx2.Response(200, json={"id": "run_1234"})