Skip to content

Commit 1bd2075

Browse files
committed
♻️ Refactor dependency management in pyproject.toml and Makefile; update CI workflow for improved linting and coverage
1 parent 43ff8cb commit 1bd2075

File tree

4 files changed

+406
-18
lines changed

4 files changed

+406
-18
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ env:
1414
jobs:
1515
lint:
1616
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ['3.12']
21+
1722
steps:
1823
- uses: actions/checkout@v4
1924

2025
- uses: astral-sh/setup-uv@v3
2126
with:
2227
enable-cache: true
2328

24-
- run: uv sync --python 3.12 --frozen --no-dev --group lint
29+
- name: Install dependencies
30+
run: uv sync --python ${{ matrix.python-version }} --group lint --all-extras
2531

2632
- uses: pre-commit/action@v3.0.0
2733
with:
@@ -48,10 +54,12 @@ jobs:
4854
with:
4955
enable-cache: true
5056

51-
- name: Install Extra Dependencies
52-
run: uv sync --frozen --group all --all-extras
57+
- name: Install extra dependencies
58+
run: uv sync --group dev --all-extras
59+
60+
- name: Make coverage directory
61+
run: mkdir coverage
5362

54-
- run: mkdir coverage
5563
- run: uv run --frozen coverage run -m pytest
5664
env:
5765
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ sources = pydantic_extra_types tests
55
.uv:
66
@uv --version || echo 'Please install uv: https://docs.astral.sh/uv/getting-started/installation/'
77

8-
.PHONY: install # Install the package, dependencies, and pre-commit for local development
8+
.PHONY: install ## Install the package, dependencies, and pre-commit for local development
99
install: .uv
1010
uv sync --frozen --group all --all-extras
11-
uv run pre-commit install --install-hooks
11+
uv pip install pre-commit
12+
pre-commit install --install-hooks
1213

1314
.PHONY: rebuild-lockfiles ## Rebuild lockfiles from scratch, updating all dependencies
1415
rebuild-lockfiles: .uv

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies = ['pydantic>=2.5.2','typing-extensions']
4343
dynamic = ['version']
4444

4545
[project.optional-dependencies]
46-
all = [
46+
extra = [
4747
'phonenumbers>=8,<9',
4848
'pycountry>=23',
4949
'semver>=3.0.2',
@@ -72,12 +72,15 @@ dev = [
7272
"pytest-cov>=5.0.0",
7373
]
7474
lint = [
75-
"pre-commit>=3.5.0",
7675
"ruff>=0.7.4",
7776
"mypy>=0.910",
7877
"annotated-types>=0.7.0",
7978
"types-pytz>=2024.1.0.20240417",
8079
]
80+
all = [
81+
{ include-group = 'dev' },
82+
{ include-group = 'lint' },
83+
]
8184

8285
[project.urls]
8386
Homepage = 'https://github.com/pydantic/pydantic-extra-types'

0 commit comments

Comments
 (0)