Skip to content

Commit

Permalink
Fix publishing on PyPI (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored Mar 5, 2024
1 parent 4da3bbf commit 824efc9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
Expand All @@ -19,7 +19,7 @@ jobs:

- name: Verify Package Version vs Tag Version
run: |
PKG_VER="$(grep -oP 'version = "\K[^"]+' pyproject.toml)"
PKG_VER="$(grep -oP '^version = "\K[^"]+' pyproject.toml)"
TAG_VER="${GITHUB_REF##*/}"
echo "Package version is $PKG_VER" >&2
echo "Tag version is $TAG_VER" >&2
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ghga_service_commons"
version = "3.0.4"
version = "3.0.3"
description = "A library that contains common functionality used in services of GHGA"
readme = "README.md"
authors = [
Expand Down
12 changes: 9 additions & 3 deletions src/ghga_service_commons/api/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""Functionality for testing FastAPI-based APIs."""

import socket
from typing import Any, Callable
from typing import Any, Callable, Generic, TypeVar

import httpx

Expand All @@ -29,7 +29,10 @@ def get_free_port() -> int:
return int(sock.getsockname()[1])


class AsyncTestClient(httpx.AsyncClient):
TApp = TypeVar("TApp", bound=Callable[..., Any])


class AsyncTestClient(httpx.AsyncClient, Generic[TApp]):
"""Client for testing ASGI apps in the context of a running async event loop.
Usage: ```
Expand All @@ -52,8 +55,11 @@ async def test_index():
```
"""

def __init__(self, app: Callable[..., Any]):
app: TApp

def __init__(self, app: TApp):
"""Initialize with ASGI app."""
self.app = app # make the application available to tests as well
super().__init__(
transport=httpx.ASGITransport(app=app), base_url="http://localhost:8080"
)

0 comments on commit 824efc9

Please sign in to comment.