Skip to content

Commit 16f908e

Browse files
committed
Upgrade pytask-stata to use uv and ty
- Update minimum Python version from 3.8 to 3.9 - Update minimum pytask version from 0.4 to 0.5.2 - Replace tox with uv for dependency management - Replace mypy with ty for ultra-fast type checking - Update CI workflows to use uv and test Python 3.9-3.13 - Remove deprecated ruff rules (ANN101, ANN102) - Update ruff target version to py39 All tests pass (32 passed, 10 skipped)
1 parent 7252c64 commit 16f908e

File tree

4 files changed

+729
-57
lines changed

4 files changed

+729
-57
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ jobs:
2222

2323
steps:
2424
- uses: actions/checkout@v4
25-
- uses: actions/setup-python@v5
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v4
2627
with:
27-
python-version-file: .python-version
28-
allow-prereleases: true
29-
cache: pip
30-
- run: pip install tox-uv
31-
- run: tox -e typing
28+
enable-cache: true
29+
- name: Set up Python
30+
run: uv python install
31+
- run: uv run ty check
3232

3333
run-tests:
3434

@@ -39,22 +39,22 @@ jobs:
3939
fail-fast: false
4040
matrix:
4141
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
42-
python-version: ['3.8', '3.9', '3.10', '3.11']
42+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
4343

4444
steps:
4545
- uses: actions/checkout@v4
46-
- uses: actions/setup-python@v5
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v4
4748
with:
48-
python-version: ${{ matrix.python-version }}
49-
cache: pip
50-
allow-prereleases: true
51-
- run: pip install tox-uv
49+
enable-cache: true
50+
- name: Set up Python ${{ matrix.python-version }}
51+
run: uv python install ${{ matrix.python-version }}
5252

5353
# Unit, integration, and end-to-end tests.
5454

5555
- name: Run unit tests and doctests.
5656
shell: bash -l {0}
57-
run: tox -e test -- -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
57+
run: uv run --group test pytest -m "unit or (not integration and not end_to_end)" --cov=./ --cov-report=xml -n auto
5858

5959
- name: Upload unit test coverage reports to Codecov with GitHub Action
6060
uses: codecov/codecov-action@v4
@@ -63,7 +63,7 @@ jobs:
6363

6464
- name: Run end-to-end tests.
6565
shell: bash -l {0}
66-
run: tox -e test -- -m end_to_end --cov=./ --cov-report=xml -n auto
66+
run: uv run --group test pytest -m end_to_end --cov=./ --cov-report=xml -n auto
6767

6868
- name: Upload end_to_end test coverage reports to Codecov with GitHub Action
6969
uses: codecov/codecov-action@v4

pyproject.toml

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,14 @@ classifiers = [
1414
"Programming Language :: Python :: 3",
1515
"Programming Language :: Python :: 3 :: Only",
1616
]
17-
requires-python = ">=3.8"
18-
dependencies = ["click", "pytask>=0.4"]
17+
requires-python = ">=3.9"
18+
dependencies = ["click", "pytask>=0.5.2"]
1919
dynamic = ["version"]
2020

2121
[project.readme]
2222
file = "README.md"
2323
content-type = "text/markdown"
2424

25-
[project.optional-dependencies]
26-
test = ["pytest", "pytest-cov", "pytest-xdist"]
27-
typing = ["mypy"]
28-
2925
[project.urls]
3026
Homepage = "https://github.com/pytask-dev/pytask-stata"
3127
Documentation = "https://github.com/pytask-dev/pytask-stata"
@@ -36,11 +32,9 @@ Changelog = "https://github.com/pytask-dev/pytask-stata/blob/main/CHANGES.md"
3632
[project.entry-points]
3733
pytask = { pytask_stata = "pytask_stata.plugin" }
3834

39-
[tool.rye]
40-
managed = true
41-
dev-dependencies = [
42-
"tox-uv>=1.8.2",
43-
]
35+
[dependency-groups]
36+
test = ["pytest", "pytest-cov", "pytest-xdist"]
37+
typing = ["ty"]
4438

4539
[tool.hatch.build.hooks.vcs]
4640
version-file = "src/pytask_stata/_version.py"
@@ -59,31 +53,13 @@ source = "vcs"
5953
[tool.hatch.metadata]
6054
allow-direct-references = true
6155

62-
[tool.mypy]
63-
files = ["src", "tests"]
64-
check_untyped_defs = true
65-
disallow_any_generics = true
66-
disallow_incomplete_defs = true
67-
disallow_untyped_defs = true
68-
no_implicit_optional = true
69-
warn_redundant_casts = true
70-
warn_unused_ignores = true
71-
72-
[[tool.mypy.overrides]]
73-
module = "tests.*"
74-
disallow_untyped_defs = false
75-
ignore_errors = true
76-
7756
[tool.ruff]
78-
target-version = "py38"
7957
fix = true
8058
unsafe-fixes = true
8159

8260
[tool.ruff.lint]
8361
select = ["ALL"]
8462
ignore = [
85-
"ANN101",
86-
"ANN102",
8763
"ANN401", # flake8-annotate typing.Any
8864
"COM812", # Comply with ruff-format.
8965
"ISC001", # Comply with ruff-format.

tox.ini

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

0 commit comments

Comments
 (0)