Skip to content

Commit fdccecd

Browse files
authored
always use maturin for the uv commands in Makefile (#1622)
1 parent ed15f6c commit fdccecd

File tree

3 files changed

+29
-62
lines changed

3 files changed

+29
-62
lines changed

Makefile

-24
Original file line numberDiff line numberDiff line change
@@ -40,56 +40,32 @@ install-rust-coverage:
4040
.PHONY: build-dev
4141
build-dev:
4242
@rm -f python/pydantic_core/*.so
43-
ifneq ($(USE_MATURIN),)
4443
uv run maturin develop --uv
45-
else
46-
uv pip install --force-reinstall -v -e . --config-settings=build-args='--profile dev'
47-
endif
4844

4945
.PHONY: build-prod
5046
build-prod:
5147
@rm -f python/pydantic_core/*.so
52-
ifneq ($(USE_MATURIN),)
5348
uv run maturin develop --uv --release
54-
else
55-
uv pip install -v -e .
56-
endif
5749

5850
.PHONY: build-profiling
5951
build-profiling:
6052
@rm -f python/pydantic_core/*.so
61-
ifneq ($(USE_MATURIN),)
6253
uv run maturin develop --uv --profile profiling
63-
else
64-
uv pip install --force-reinstall -v -e . --config-settings=build-args='--profile profiling'
65-
endif
6654

6755
.PHONY: build-coverage
6856
build-coverage:
6957
@rm -f python/pydantic_core/*.so
70-
ifneq ($(USE_MATURIN),)
7158
RUSTFLAGS='-C instrument-coverage' uv run maturin develop --uv --release
72-
else
73-
RUSTFLAGS='-C instrument-coverage' uv pip install -v -e .
74-
endif
7559

7660
.PHONY: build-pgo
7761
build-pgo:
7862
@rm -f python/pydantic_core/*.so
7963
$(eval PROFDATA := $(shell mktemp -d))
80-
ifneq ($(USE_MATURIN),)
8164
RUSTFLAGS='-Cprofile-generate=$(PROFDATA)' uv run maturin develop --uv --release
82-
else
83-
RUSTFLAGS='-Cprofile-generate=$(PROFDATA)' uv pip install --force-reinstall -v -e .
84-
endif
8565
pytest tests/benchmarks
8666
$(eval LLVM_PROFDATA := $(shell rustup run stable bash -c 'echo $$RUSTUP_HOME/toolchains/$$RUSTUP_TOOLCHAIN/lib/rustlib/$$(rustc -Vv | grep host | cut -d " " -f 2)/bin/llvm-profdata'))
8767
$(LLVM_PROFDATA) merge -o $(PROFDATA)/merged.profdata $(PROFDATA)
88-
ifneq ($(USE_MATURIN),)
8968
RUSTFLAGS='-Cprofile-use=$(PROFDATA)/merged.profdata' uv run maturin develop --uv --release
90-
else
91-
RUSTFLAGS='-Cprofile-use=$(PROFDATA)/merged.profdata' uv pip install --force-reinstall -v -e .
92-
endif
9369
@rm -rf $(PROFDATA)
9470

9571

pyproject.toml

+21-36
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
[build-system]
2-
requires = [
3-
'maturin>=1,<2',
4-
'typing-extensions >=4.6.0,!=4.7.0'
5-
]
2+
requires = ['maturin>=1,<2', 'typing-extensions >=4.6.0,!=4.7.0']
63
build-backend = 'maturin'
74

85
[project]
96
name = 'pydantic_core'
107
description = "Core functionality for Pydantic validation and serialization"
118
requires-python = '>=3.9'
12-
authors = [
13-
{name = 'Samuel Colvin', email = 's@muelcolvin.com'}
14-
]
9+
authors = [{ name = 'Samuel Colvin', email = 's@muelcolvin.com' }]
1510
classifiers = [
1611
'Development Status :: 3 - Alpha',
1712
'Programming Language :: Python',
@@ -32,23 +27,18 @@ classifiers = [
3227
'Operating System :: MacOS',
3328
'Typing :: Typed',
3429
]
35-
dependencies = [
36-
'typing-extensions >=4.6.0,!=4.7.0'
37-
]
38-
dynamic = [
39-
'description',
40-
'license',
41-
'readme',
42-
'version'
43-
]
30+
dependencies = ['typing-extensions >=4.6.0,!=4.7.0']
31+
dynamic = ['description', 'license', 'readme', 'version']
4432

4533
[project.urls]
4634
Homepage = 'https://github.com/pydantic/pydantic-core'
4735
Funding = 'https://github.com/sponsors/samuelcolvin'
4836
Source = 'https://github.com/pydantic/pydantic-core'
4937

5038
[dependency-groups]
39+
dev = ["maturin"]
5140
testing = [
41+
{ include-group = "dev" },
5242
'backports.zoneinfo; python_version < "3.9"',
5343
'coverage',
5444
'dirty-equals',
@@ -70,26 +60,18 @@ testing = [
7060
'tzdata',
7161
'typing_extensions',
7262
]
73-
linting = [
74-
'griffe',
75-
'pyright',
76-
'ruff',
77-
'mypy',
78-
]
79-
wasm = [
80-
'typing_extensions',
81-
'maturin>=1,<2',
82-
'ruff',
83-
]
63+
linting = [{ include-group = "dev" }, 'griffe', 'pyright', 'ruff', 'mypy']
64+
wasm = [{ include-group = "dev" }, 'typing_extensions', 'ruff']
8465
codspeed = [
8566
# codspeed is only run on CI, with latest version of CPython
8667
'pytest-codspeed; python_version == "3.13" and implementation_name == "cpython"',
8768
]
8869

8970
all = [
90-
{ include-group = 'testing' },
91-
{ include-group = 'linting' },
92-
{ include-group = 'wasm' },
71+
{ include-group = "dev" },
72+
{ include-group = 'testing' },
73+
{ include-group = 'linting' },
74+
{ include-group = 'wasm' },
9375
]
9476

9577
[tool.maturin]
@@ -105,9 +87,9 @@ target-version = 'py39'
10587
[tool.ruff.lint]
10688
extend-select = ['Q', 'RUF100', 'C90', 'I', 'UP']
10789
extend-ignore = [
108-
'E721', # using type() instead of isinstance() - we use this in tests
90+
'E721', # using type() instead of isinstance() - we use this in tests
10991
]
110-
flake8-quotes = {inline-quotes = 'single', multiline-quotes = 'double'}
92+
flake8-quotes = { inline-quotes = 'single', multiline-quotes = 'double' }
11193
mccabe = { max-complexity = 13 }
11294
isort = { known-first-party = ['pydantic_core', 'tests'] }
11395

@@ -130,10 +112,13 @@ timeout = 30
130112
xfail_strict = true
131113
# min, max, mean, stddev, median, iqr, outliers, ops, rounds, iterations
132114
addopts = [
133-
'--benchmark-columns', 'min,mean,stddev,outliers,rounds,iterations',
134-
'--benchmark-group-by', 'group',
135-
'--benchmark-warmup', 'on',
136-
'--benchmark-disable', # this is enable by `make benchmark` when you actually want to run benchmarks
115+
'--benchmark-columns',
116+
'min,mean,stddev,outliers,rounds,iterations',
117+
'--benchmark-group-by',
118+
'group',
119+
'--benchmark-warmup',
120+
'on',
121+
'--benchmark-disable', # this is enable by `make benchmark` when you actually want to run benchmarks
137122
]
138123

139124
[tool.coverage.run]

uv.lock

+8-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)