Skip to content

Commit 1da80de

Browse files
authored
Modernize a bit
Signed-off-by: Bradley Reynolds <[email protected]>
1 parent a69031d commit 1da80de

File tree

5 files changed

+730
-107
lines changed

5 files changed

+730
-107
lines changed

.github/workflows/python.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,20 @@ jobs:
5858
- name: Run tests
5959
run: python -m coverage run -m pytest --junitxml=junit.xml -o junit_family=legacy
6060

61+
- name: Create coverage report
62+
if: ${{ !cancelled() }}
63+
run: uv run coverage xml
64+
6165
- name: Upload coverage reports to Codecov
66+
if: ${{ !cancelled() }}
6267
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
63-
env:
64-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
68+
with:
69+
report_type: coverage
70+
use_oidc: true
6571

6672
- name: Upload test results to Codecov
6773
if: ${{ !cancelled() }}
68-
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
74+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
6975
with:
70-
token: ${{ secrets.CODECOV_TOKEN }}
76+
report_type: test_results
77+
use_oidc: true

make.ps1

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

noxfile.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""Noxfile."""
2+
3+
import shutil
4+
from pathlib import Path
5+
6+
import nox
7+
8+
nox.options.default_venv_backend = "none"
9+
nox.options.sessions = ["lints"]
10+
11+
12+
CLEANABLE_TARGETS = [
13+
"./dist",
14+
"./build",
15+
"./.nox",
16+
"./.coverage",
17+
"./.coverage.*",
18+
"./coverage.json",
19+
"./**/.mypy_cache",
20+
"./**/.pytest_cache",
21+
"./**/__pycache__",
22+
"./**/*.pyc",
23+
"./**/*.pyo",
24+
]
25+
26+
27+
@nox.session
28+
def lints(session: nox.Session) -> None:
29+
"""Run lints."""
30+
session.run("prek", "run", "--all-files")
31+
session.run("ruff", "format", ".")
32+
session.run("ruff", "check", "--fix", ".")
33+
session.run("mypy", "--strict", "src/", "packages/", "tests/")
34+
35+
36+
@nox.session
37+
def clean(_: nox.Session) -> None:
38+
"""Clean cache, .pyc, .pyo, and test/build artifact files from project."""
39+
count = 0
40+
for searchpath in CLEANABLE_TARGETS:
41+
for filepath in Path().glob(searchpath):
42+
if filepath.is_dir():
43+
shutil.rmtree(filepath)
44+
else:
45+
filepath.unlink()
46+
count += 1

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = [
77
]
88
license = { text = "MIT" }
99
readme = "README.md"
10-
requires-python = ">=3.12"
10+
requires-python = ">=3.14"
1111
dependencies = [
1212
"pytz",
1313
"darbiadev-utilities",
@@ -21,7 +21,7 @@ repository = "https://github.com/shenanigansd/scratchpad"
2121

2222
[project.optional-dependencies]
2323
dev = [
24-
"pre-commit",
24+
"prek",
2525
"ruff",
2626
"mypy",
2727
]
@@ -47,12 +47,12 @@ packages = []
4747
[tool.ruff]
4848
preview = true
4949
unsafe-fixes = true
50-
target-version = "py312"
50+
target-version = "py314"
5151
line-length = 120
5252

5353
[tool.ruff.lint]
5454
select = ["ALL"]
55-
exclude = ["events", "scratch/discarded"]
55+
exclude = ["events"]
5656
ignore = [
5757
"CPY001", # (Missing copyright notice at top of file) - No license
5858
"ERA001", # (Found commented-out code) - This is a scratchpad, so...

0 commit comments

Comments
 (0)