Skip to content

Commit 30d5d83

Browse files
authored
fix: always require pathspec (#711)
This adds `pathspec` as a required dependency. It makes the native backend easier to use, and is already there for hatchling, so it's really only an extra dependency for custom plugins and setuptools, so I think it's a valid tradeoff now that pyproject-metadata is vendored. Closes #280. - **chore: remove a few unused pyproject-metadata's** - **fix: always require pathspec** --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent f4d0cd7 commit 30d5d83

File tree

14 files changed

+24
-36
lines changed

14 files changed

+24
-36
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ version = "0.0.1"
112112
```
113113

114114
You can (and should) specify the rest of the entries in `project`, but these are
115-
the minimum to get started. You can also `scikit-build-core[pyproject]` to
116-
pre-load some dependencies if you want; in some cases this might be marginally
117-
faster.
115+
the minimum to get started.
118116

119117
An example `CMakeLists.txt`:
120118

docs/examples/downstream/nanobind_example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if(NOT SKBUILD)
1919
in your environment once and use the following command that avoids
2020
a costly creation of a new virtual environment at every compilation:
2121
=====================================================================
22-
$ pip install nanobind scikit-build-core[pyproject]
22+
$ pip install nanobind scikit-build-core
2323
$ pip install --no-build-isolation -ve .
2424
=====================================================================
2525
You may optionally add -Ceditable.rebuild=true to auto-rebuild when

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def docs(session: nox.Session) -> None:
134134

135135
serve = args.builder == "html" and session.interactive
136136
extra_installs = ["sphinx-autobuild"] if serve else []
137-
session.install("-e.[docs,pyproject]", *extra_installs)
137+
session.install("-e.[docs]", *extra_installs)
138138

139139
session.chdir("docs")
140140

@@ -229,7 +229,7 @@ def downstream(session: nox.Session) -> None:
229229
proj_dir = tmp_dir / "_".join(args.project.split("/"))
230230

231231
session.install("build", "hatch-vcs", "hatchling")
232-
session.install(".[pyproject]", "--no-build-isolation")
232+
session.install(".", "--no-build-isolation")
233233

234234
if proj_dir.is_dir():
235235
session.chdir(proj_dir)

pyproject.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ dependencies = [
3737
"importlib-metadata >=4.13; python_version<'3.8'",
3838
"importlib-resources >=1.3; python_version<'3.9'",
3939
"packaging >=21.3",
40+
"pathspec >=0.10.1",
4041
"tomli >=1.2.2; python_version<'3.11'",
4142
"typing-extensions >=3.10.0; python_version<'3.9'",
4243
]
@@ -46,16 +47,12 @@ dependencies = [
4647

4748
[project.optional-dependencies]
4849
pyproject = [
49-
"pathspec >=0.10.1",
50-
"pyproject-metadata >=0.6.1",
5150
]
5251
test = [
5352
"build >=0.8",
5453
"cattrs >=22.2.0",
55-
"pathspec >=0.10.1",
5654
"pip >=22",
5755
"pybind11 >=2.11",
58-
"pyproject-metadata >=0.5",
5956
"pytest >=7.0", # 7.2+ recommended for better tracebacks with ExceptionGroup
6057
"pytest-subprocess >=1.5",
6158
'setuptools >=43; python_version<"3.9"',
@@ -96,8 +93,6 @@ docs = [
9693
"furo",
9794
"hatchling",
9895
"myst-parser >=0.13",
99-
"pathspec >=0.10.1",
100-
"pyproject-metadata >=0.5",
10196
"setuptools",
10297
"sphinx >=7.0",
10398
"sphinx-autodoc-typehints",

src/scikit_build_core/build/__init__.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ def get_requires_for_build_sdist(
109109
)
110110

111111
return [
112-
"pathspec",
113112
*cmake_requires,
114113
*requires.dynamic_metadata(),
115114
]
@@ -128,7 +127,6 @@ def get_requires_for_build_wheel(
128127
)
129128

130129
return [
131-
"pathspec",
132130
*cmake_requires,
133131
*requires.dynamic_metadata(),
134132
]
@@ -147,7 +145,6 @@ def get_requires_for_build_editable(
147145
)
148146

149147
return [
150-
"pathspec",
151148
*cmake_requires,
152149
*requires.dynamic_metadata(),
153150
]

tests/conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def pep518_wheelhouse(tmp_path_factory: pytest.TempPathFactory) -> Path:
4444
"wheel",
4545
"--wheel-dir",
4646
str(wheelhouse),
47-
f"{BASE}[pyproject]",
47+
f"{BASE}",
4848
],
4949
check=True,
5050
)
@@ -208,10 +208,10 @@ def package_simple_pyproject_ext(
208208
) -> PackageInfo:
209209
package = PackageInfo(
210210
"simple_pyproject_ext",
211-
"6c5bb5f1b6c44f3aab37fc8f768004f644c24001ad0304759a69b754ca6ad46d",
212-
"ba13e4195ae6333459412bc802ba8c02c231cf1c5ee143f6a3392786d80a49b4",
213-
"f1a6050eae910de7cd86830ba97af5e74ff953f9acc2adab47aa9cdf2a3eca91",
214-
"b861db81fd1de6dee4a0d6574af27af54424fbccce12b018644d1db136f218ac",
211+
"5544d96810ce60ac40baf28cf8caf2e1e7e1fa7439b283d3fb52cdc1f87f12ac",
212+
"aaa15c185dc3fbc301dc2fca937cc935442c38e55bc400fbefd424bd6ce92adb",
213+
"ee3a564a37c42df3abdcee3862175baceeb6f6eff0b29931681b424ec5d96067",
214+
"4c1d402621e7f00fce4ce5afdb73a9ba4cc25cd4bb57619113432841f779dd68",
215215
)
216216
process_package(package, tmp_path, monkeypatch)
217217
return package

tests/packages/sdist_config/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["scikit-build-core[pyproject]"]
2+
requires = ["scikit-build-core"]
33
build-backend = "scikit_build_core.build"
44

55
[project]

tests/packages/simple_purelib_package/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["scikit-build-core[pyproject]"]
2+
requires = ["scikit-build-core"]
33
build-backend = "scikit_build_core.build"
44

55
[project]

tests/packages/simple_pyproject_ext/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"scikit_build_core[pyproject]",
3+
"scikit_build_core",
44
"pybind11",
55
]
66
build-backend = "scikit_build_core.build"

tests/packages/simple_pyproject_source_dir/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build-system]
22
requires = [
3-
"scikit_build_core[pyproject]",
3+
"scikit_build_core",
44
"pybind11",
55
]
66
build-backend = "scikit_build_core.build"

0 commit comments

Comments
 (0)