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
22 changes: 10 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,31 @@ name: Publish
on:
workflow_dispatch:
push:
branches: ["main"]
tags:
- '*'

jobs:
test:

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

run:
runs-on: windows-latest
environment:
name: pypi
url: https://pypi.org/p/memobj
permissions:
id-token: write
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Update pip
run: python -m pip install -U pip
- name: Set up Poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: poetry install
run: uv sync --all-groups
- name: Build
run: poetry build
run: uv build
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1.10
uses: uv publish
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install -U pip
- name: Set up Poetry
uses: abatilo/actions-poetry@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install dependencies
run: poetry install
run: uv sync --all-groups
- name: Run tests
run: poetry run pytest
run: uv run pytest
8 changes: 6 additions & 2 deletions memobj/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
import struct
import operator
from enum import Enum
from typing import Callable
from typing import Callable, Generic, TypeVar


class ValueWaiter[T]:
# TODO: remove when dropping 3.11 support
T = TypeVar("T")


class ValueWaiter(Generic[T]):
def __init__(self, callback: Callable[[], T]):
"""A utility class to wait for changes from a callable

Expand Down
Loading