Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Upload Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive # Initializes and fetches submodules
fetch-depth: 0 # Needed for submodule hashes

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install the liburing
run: |
cd libs
./configure
make
sudo make install

- name: Install the latest version of uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.2"
enable-cache: true

- name: Build release distributions
run: |
uv sync --group dev
uv build -v --sdist

- name: Upload distributions
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} #
run: |
uv run twine upload --verbose --repository testpypi dist/*
File renamed without changes.
13 changes: 11 additions & 2 deletions tests/conftest.py → tests/e2e/loop/conftest.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
import asyncio
import os
import tempfile
from typing import cast

import pytest
import pytest_asyncio

from uringloop.loop import IouringProactorEventLoop, IouringProactorEventLoopPolicy


@pytest.fixture(scope="session", autouse=True)
def event_loop_policy():
@pytest_asyncio.fixture(scope="package", autouse=True)
async def event_loop_policy():
asyncio.set_event_loop_policy(IouringProactorEventLoopPolicy())

# TODO: remove pytest_asyncio warning
@pytest.fixture
def event_loop():
loop = asyncio.get_event_loop()
yield cast(IouringProactorEventLoop, loop)
loop.close()

@pytest.fixture
def unix_socket_path():
with tempfile.TemporaryDirectory() as f:
yield os.path.join(f, "test.sock")
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions tests/e2e/conftest.py → tests/e2e/proactor/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@ async def _run_proactor_task():
await asyncio.sleep(0.1)

task = loop.create_task(_run_proactor_task())

def stop_all_coro_if_raise_exception(task: asyncio.Task[None]):
if task.exception(): # If task failed
# Cancel all other tasks
for t in asyncio.all_tasks(loop):
if t != task and not t.done():
t.cancel()

loop.run_until_complete(loop.shutdown_asyncgens())

# Add failure callback
task.add_done_callback(stop_all_coro_if_raise_exception)

yield proactor

# Cleanup
Expand Down
File renamed without changes.
File renamed without changes.