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
27 changes: 6 additions & 21 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,14 @@ runs:
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
- name: install uv
uses: astral-sh/setup-uv@v6
with:
path: ~/.local
key: poetry-0 # increment to reset cache
- name: install Poetry
uses: snok/install-poetry@v1
with:
version: ${{ inputs.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ inputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
version: "0.9.6"
enable-cache: true
- name: install the project
shell: bash
run: poetry install --no-interaction
run: uv sync --locked --all-extras --dev
- name: install just
uses: extractions/setup-just@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ runs:
python-version: ${{ inputs.python-version}}
- name: run tests
shell: bash
run: poetry run just test
run: uv run just test
- name: generate report
if: failure()
shell: bash
run: poetry run coverage html
run: uv run coverage html
- name: upload report
if: failure()
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
path: ~/.cache/pre-commit/
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
- name: lint
run: poetry run just lint
run: uv run just lint
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
packages = [
pkgs.python313
pkgs.just
pkgs.poetry
pkgs.uv
];
};
}
Expand Down
885 changes: 0 additions & 885 deletions poetry.lock

This file was deleted.

47 changes: 23 additions & 24 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
[tool.poetry]
[project]
name = "stateless"
version = "0.5.2"
description = "Statically typed, purely functional effects for Python"
authors = ["suned <sd@dybro-debel.dk>"]
authors = [{ name = "suned", email = "sd@dybro-debel.dk" }]
requires-python = ">=3.10"
readme = "README.md"
dependencies = [
"typing-extensions>=4.8.0,<5",
"cloudpickle>=3.0.0,<4",
]

[tool.poetry.dependencies]
python = "^3.10"
typing-extensions = "^4.8.0"
cloudpickle = "^3.0.0"


[tool.poetry.group.dev.dependencies]
mypy = "^1.6.1"
ipdb = "^0.13.13"
ipython = "^8.17.2"
pytest = "^8"
pyright = "^1.1.336"
pre-commit = "^3.5.0"
ruff = "^0.14.2"
coverage = "^7.3.2"
toml = "^0.10.2"
pytest-benchmark = "^5.2.1"
[dependency-groups]
dev = [
"mypy>=1.6.1,<2",
"ipdb>=0.13.13,<0.14",
"ipython>=8.17.2,<9",
"pytest>=8.2,<8.3",
"pyright>=1.1.336,<2",
"pre-commit>=3.5.0,<4",
"ruff>=0.14.2,<0.15",
"coverage>=7.3.2,<8",
"toml>=0.10.2,<0.11",
"pytest-benchmark>=5.2.1,<5.3"
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.mypy]
disallow_untyped_calls = true
Expand Down Expand Up @@ -56,8 +60,3 @@ exclude_also = [
[tool.coverage.run]
concurrency = ["multiprocessing", "thread"]
source = ["src/"]


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 2 additions & 0 deletions src/stateless/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
ParamSpec,
TypeVar,
cast,
get_origin,
get_type_hints,
overload,
)
Expand Down Expand Up @@ -125,6 +126,7 @@ def handle(f: Callable[[A2], Any]) -> Handler[A2]:
"1 annotated argument."
)
t, *_ = d.values()
t = get_origin(t) or t

def on(ability: A2) -> Any:
if not isinstance(ability, t):
Expand Down
638 changes: 638 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

Loading