Skip to content

Commit 31a4769

Browse files
committed
[fix:project] Update pyproject.toml and ci.yaml
1 parent 9ed531d commit 31a4769

File tree

2 files changed

+30
-30
lines changed

2 files changed

+30
-30
lines changed

.github/workflows/ci.yml

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ on:
66
pull_request:
77
branches: [ "main" ]
88

9+
permissions:
10+
contents: read
11+
912
jobs:
10-
build-and-test:
13+
validate-and-test:
1114
runs-on: ${{ matrix.os }}
1215
strategy:
1316
fail-fast: false
@@ -19,33 +22,34 @@ jobs:
1922
- name: Check out repository
2023
uses: actions/checkout@v4
2124

25+
- name: Install uv
26+
uses: astral-sh/setup-uv-action@v1
27+
2228
- name: Set up Python ${{ matrix.python-version }}
2329
uses: actions/setup-python@v5
2430
with:
2531
python-version: ${{ matrix.python-version }}
2632

27-
- name: Install uv and dependencies
33+
- name: Cache uv dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.cache/uv
37+
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
38+
restore-keys: |
39+
${{ runner.os }}-uv-${{ matrix.python-version }}-
40+
41+
- name: Install dependencies
42+
run: uv pip install -e ".[dev]"
43+
44+
- name: Run linting and tests
2845
run: |
29-
pip install uv
30-
uv venv
31-
uv pip install -e ".[dev]"
32-
33-
- name: Run linting and formatting check
34-
run: .venv/bin/python -m ruff check src/ tests/ && .venv/bin/python -m ruff format --check src/ tests/
35-
if: runner.os != 'Windows'
36-
- name: Run linting and formatting check (Windows)
37-
run: .\.venv\Scripts\python.exe -m ruff check src/ tests/ ; .\.venv\Scripts\python.exe -m ruff format --check src/ tests/
38-
if: runner.os == 'Windows'
39-
40-
- name: Run tests and generate coverage report
41-
run: .venv/bin/python -m coverage run -m unittest discover tests
42-
if: runner.os != 'Windows'
43-
- name: Run tests and generate coverage report (Windows)
44-
run: .\.venv\Scripts\python.exe -m coverage run -m unittest discover tests
45-
if: runner.os == 'Windows'
46+
make lint
47+
make coverage
48+
shell: bash
4649

4750
- name: Upload coverage reports to Codecov
48-
uses: codecov/codecov-action@v4
51+
uses: codecov/codecov-action@v5
4952
with:
5053
token: ${{ secrets.CODECOV_TOKEN }}
51-
fail_ci_if_error: true
54+
env:
55+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

pyproject.toml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ classifiers = [
1616
"Development Status :: 3 - Alpha",
1717
"Programming Language :: Python :: 3",
1818
"Programming Language :: Python :: 3.11",
19+
"Programming Language :: Python :: 3.12",
1920
"License :: OSI Approved :: MIT License",
2021
"Operating System :: OS Independent",
2122
]
@@ -33,11 +34,12 @@ validate-code = "code_validator.cli:run_from_cli"
3334
[project.optional-dependencies]
3435
dev = [
3536
"ruff>=0.4.0",
36-
"flake8>=7.0.0",
3737
"build",
38-
"twine"
38+
"twine",
39+
"coverage>=7.5.0",
3940
]
4041

42+
4143
[tool.ruff]
4244
line-length = 120
4345
exclude = ["tests/fixtures"]
@@ -49,10 +51,4 @@ mccabe.max-complexity = 15
4951

5052

5153
[tool.ruff.format]
52-
quote-style = "double"
53-
54-
[dependency-groups]
55-
dev = [
56-
"coverage>=7.9.1",
57-
]
58-
54+
quote-style = "double"

0 commit comments

Comments
 (0)