Skip to content

Commit 05382aa

Browse files
authored
fix: replace project.scripts with poethepoet (#563)
1 parent 45f7fd1 commit 05382aa

File tree

4 files changed

+223
-206
lines changed

4 files changed

+223
-206
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ jobs:
3232
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7
3333
with:
3434
python-version: ${{ matrix.python-version }}
35+
activate-environment: true
3536

3637
- name: Install dependencies
3738
run: uv sync --frozen
3839

3940
- name: Test with pytest
40-
run: uv run cov --frozen
41+
run: poe cov
4142

4243
- name: Run E2E tests with behave
43-
run: uv run e2e --frozen
44+
run: poe e2e
4445

4546
- if: matrix.python-version == '3.13'
4647
name: Upload coverage to Codecov

pyproject.toml

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Homepage = "https://github.com/open-feature/python-sdk"
3131
dev = [
3232
"behave",
3333
"coverage[toml]>=6.5",
34+
"poethepoet>=0.40.0",
3435
"pytest>=9.0.0",
3536
"pytest-asyncio>=1.3.0",
3637
"pre-commit"
@@ -133,12 +134,44 @@ banned-from = ["typing"]
133134
"typing.MutableMapping".msg = "Use collections.abc.MutableMapping instead"
134135
"typing.MutableSequence".msg = "Use collections.abc.MutableSequence instead"
135136

136-
[project.scripts]
137-
# workaround while UV doesn't support scripts directly in the pyproject.toml
138-
# see: https://github.com/astral-sh/uv/issues/5903
139-
test = "scripts.scripts:test"
140-
test-cov = "scripts.scripts:test_cov"
141-
cov-report = "scripts.scripts:cov_report"
142-
cov = "scripts.scripts:cov"
143-
e2e = "scripts.scripts:e2e"
144-
precommit = "scripts.scripts:precommit"
137+
[tool.poe]
138+
executor = "uv"
139+
140+
[tool.poe.tasks]
141+
test = "pytest tests"
142+
test-cov = "coverage run -m pytest tests"
143+
cov-report = "coverage xml"
144+
cov = [
145+
"test-cov",
146+
"cov-report"
147+
]
148+
e2e = [
149+
{ cmd = "git submodule update --init --recursive" },
150+
{ cmd = "cp spec/specification/assets/gherkin/* tests/features/" },
151+
{ cmd = "behave tests/features/" },
152+
{ cmd = "rm tests/features/*.feature" },
153+
]
154+
pre-commit = "pre-commit run -a"
155+
156+
[tool.poe.tasks.test-py310]
157+
cmd = "pytest tests"
158+
executor = { python = "3.10", isolated = true, frozen = true }
159+
160+
[tool.poe.tasks.test-py311]
161+
cmd = "pytest tests"
162+
executor = { python = "3.11", isolated = true, frozen = true }
163+
164+
[tool.poe.tasks.test-py312]
165+
cmd = "pytest tests"
166+
executor = { python = "3.12", isolated = true, frozen = true }
167+
168+
[tool.poe.tasks.test-py313]
169+
cmd = "pytest tests"
170+
executor = { python = "3.13", isolated = true, frozen = true }
171+
172+
[tool.poe.tasks.test-py314]
173+
cmd = "pytest tests"
174+
executor = { python = "3.14", isolated = true, frozen = true }
175+
176+
[tool.poe.tasks.test-all]
177+
parallel = ["test-py310", "test-py311", "test-py312", "test-py313", "test-py314"]

scripts/scripts.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)