Skip to content

Commit d457694

Browse files
committed
docs: add a reference page for CLI utilities
Signed-off-by: Henry Schreiner <[email protected]>
1 parent bdf5a4a commit d457694

File tree

10 files changed

+105
-8
lines changed

10 files changed

+105
-8
lines changed

docs/about/changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
4+
## Version 0.11.3
5+
6+
Fixes:
7+
8+
* fix: add scripts to `_DICT_STR_FIELDS` for dynamic metadata. by @bilke in #1070
9+
10+
CI and testing:
11+
12+
* Officially support Python 3.14, color help @henryiii in #1074
13+
* Remove no-wheel based on virtualenv version by @henryiii in #1071
14+
* Work when `CMAKE_GENERATOR` is set by @henryiii in #1066
15+
* Try a workaround for packit `propose-downstream` by @LecrisUT in #1067
16+
* Update coverage a bit by @henryiii in #1073
17+
18+
Documentation:
19+
20+
* Generate config value reference by @LecrisUT in #1052
21+
* Update and fix projects list by @henryiii in #1075
22+
323
## Version 0.11.2
424

525
This release allows dynamic-metadata to reference other fields, which enables a

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,19 @@
5656
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
5757
# ones.
5858
extensions = [
59+
"conftabs",
5960
"myst_parser",
61+
"sphinx-jsonschema",
6062
"sphinx.ext.autodoc",
6163
"sphinx.ext.intersphinx",
6264
"sphinx.ext.linkcode",
6365
"sphinx.ext.mathjax",
6466
"sphinx.ext.napoleon",
67+
"sphinx_autodoc_typehints",
6568
"sphinx_copybutton",
6669
"sphinx_inline_tabs",
67-
"sphinx_autodoc_typehints",
68-
"conftabs",
69-
"sphinx-jsonschema",
7070
"sphinx_tippy",
71+
"sphinxcontrib.programoutput",
7172
]
7273

7374
# Add any paths that contain templates here, relative to this directory.

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ about/changelog
7474
api/scikit_build_core
7575
schema
7676
reference/configs
77+
reference/cli
7778
```
7879

7980
## Indices and tables

docs/reference/cli.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# CLI Reference
2+
3+
Scikit-build-core has a few integrated CLI tools. These are not guaranteed to be stable between releases yet, but can still be useful to investigate your environment.
4+
5+
## Build utilities
6+
7+
```{program-output} python -m scikit_build_core.build --help
8+
9+
```
10+
11+
### Build requirements
12+
13+
```{program-output} python -m scikit_build_core.build requires --help
14+
15+
```
16+
17+
Example:
18+
19+
```{command-output} python -m scikit_build_core.build requires
20+
:cwd: ../examples/getting_started/c
21+
22+
```
23+
24+
### Project table
25+
26+
27+
```{program-output} python -m scikit_build_core.build project-table --help
28+
29+
```
30+
31+
Example:
32+
33+
```{command-output} python -m scikit_build_core.build project-table
34+
:cwd: ../examples/getting_started/c
35+
36+
```
37+
38+
## Wheel tag
39+
40+
```{program-output} python -m scikit_build_core.builder.wheel_tag --help
41+
42+
```
43+
44+
Example:
45+
46+
```{command-output} python -m scikit_build_core.builder.wheel_tag
47+
48+
```
49+
50+
## File API tools
51+
52+
```{program-output} python -m scikit_build_core.file_api.query --help
53+
54+
```
55+
56+
```{program-output} python -m scikit_build_core.file_api.reply --help
57+
58+
```

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ docs = [
101101
"sphinx-inline-tabs",
102102
"sphinx-jsonschema",
103103
"sphinx-tippy",
104+
"sphinxcontrib-programoutput",
104105
]
105106
wheel-free-setuptools = [
106107
'setuptools>=70.1; python_version>="3.8"',

src/scikit_build_core/build/__main__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@ def get_requires(mode: Literal["sdist", "wheel", "editable"]) -> None:
5050

5151
def main() -> None:
5252
parser = ArgumentParser(
53+
prog="python -m scikit_build_core.build",
5354
allow_abbrev=False,
54-
description="Build backend utilities",
55+
description="Build backend utilities.",
5556
)
5657

5758
subparsers = parser.add_subparsers(help="Commands")

src/scikit_build_core/builder/wheel_tag.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ def as_tags_set(self) -> frozenset[packaging.tags.Tag]:
154154
if __name__ == "__main__":
155155
from .._compat.argparse import ArgumentParser
156156

157-
parser = ArgumentParser(allow_abbrev=False)
157+
parser = ArgumentParser(
158+
prog="scikit_build_core.builder.wheel_tag",
159+
description="Get the computed wheel tag for the current environment.",
160+
allow_abbrev=False,
161+
)
158162
parser.add_argument(
159163
"--archs",
160164
nargs="*",

src/scikit_build_core/file_api/_cattrs_converter.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def load_reply_dir(reply_dir: Path) -> Index:
6969
except ModuleNotFoundError:
7070
rich_print = builtins.print
7171

72-
parser = ArgumentParser(allow_abbrev=False)
72+
parser = ArgumentParser(
73+
allow_abbrev=False,
74+
description="This runs cattrs (required) instead of the built-in converter, for comparison.",
75+
)
7376
parser.add_argument("reply_dir", type=Path, help="Path to the reply directory")
7477
args = parser.parse_args()
7578

src/scikit_build_core/file_api/query.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ def stateless_query(build_dir: Path) -> Path:
2525
if __name__ == "__main__":
2626
from .._compat.argparse import ArgumentParser
2727

28-
parser = ArgumentParser(allow_abbrev=False)
28+
parser = ArgumentParser(
29+
prog="scikit_build_core.file_api.query",
30+
allow_abbrev=False,
31+
description="Write a stateless query to a build directory",
32+
)
2933
parser.add_argument("build_dir", type=Path, help="Path to the build directory")
3034
args = parser.parse_args()
3135

src/scikit_build_core/file_api/reply.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,11 @@ def load_reply_dir(path: Path) -> Index:
119119
except ModuleNotFoundError:
120120
rich_print = builtins.print
121121

122-
parser = ArgumentParser(allow_abbrev=False)
122+
parser = ArgumentParser(
123+
prog="python -m scikit_build_core.file_api.reply",
124+
allow_abbrev=False,
125+
description="Read a query written out to a build directory.",
126+
)
123127
parser.add_argument("reply_dir", type=Path, help="Path to the reply directory")
124128
args = parser.parse_args()
125129

0 commit comments

Comments
 (0)