Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ 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.

```{program-output} python -m scikit_build_core

```

## Build utilities

```{program-output} python -m scikit_build_core.build --help
Expand Down Expand Up @@ -36,7 +40,7 @@ Example:

```

## Wheel tag
## Building environment info

```{program-output} python -m scikit_build_core.builder.wheel_tag --help

Expand Down
40 changes: 40 additions & 0 deletions src/scikit_build_core/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from __future__ import annotations

Check warning on line 1 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L1

Added line #L1 was not covered by tests

from ._logging import rich_print

Check warning on line 3 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L3

Added line #L3 was not covered by tests

__all__ = ["main"]

Check warning on line 5 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L5

Added line #L5 was not covered by tests


def __dir__() -> list[str]:
return __all__

Check warning on line 9 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L8-L9

Added lines #L8 - L9 were not covered by tests


def main() -> None:
rich_print("{blue}A top level CLI is not currently provided for scikit-build-core.")
rich_print("{blue}However, the following modules have CLI utilities:")
rich_print(

Check warning on line 15 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L12-L15

Added lines #L12 - L15 were not covered by tests
" python -m scikit_build_core.build requires {green}Get the build requirements"
)
rich_print(

Check warning on line 18 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L18

Added line #L18 was not covered by tests
" python -m scikit_build_core.build project-table {green}Get the project table (with dynamic metadata)"
)
rich_print(

Check warning on line 21 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L21

Added line #L21 was not covered by tests
" python -m scikit_build_core.builder {green}Info about the system"
)
rich_print(

Check warning on line 24 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L24

Added line #L24 was not covered by tests
" python -m scikit_build_core.builder.wheel_tag {green}Info about the computed wheel tag"
)
rich_print(

Check warning on line 27 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L27

Added line #L27 was not covered by tests
" python -m scikit_build_core.builder.sysconfig {green}Info from sysconfig"
)
rich_print(

Check warning on line 30 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L30

Added line #L30 was not covered by tests
" python -m scikit_build_core.file_api.query {green}Request CMake file API"
)
rich_print(

Check warning on line 33 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L33

Added line #L33 was not covered by tests
" python -m scikit_build_core.file_api.reply {green}Process CMake file API"
)
rich_print()

Check warning on line 36 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L36

Added line #L36 was not covered by tests


if __name__ == "__main__":
main()

Check warning on line 40 in src/scikit_build_core/__main__.py

View check run for this annotation

Codecov / codecov/patch

src/scikit_build_core/__main__.py#L39-L40

Added lines #L39 - L40 were not covered by tests
3 changes: 1 addition & 2 deletions src/scikit_build_core/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,7 @@ def rich_print(
``color=`` argument will set a default color to apply to every argument, and
is available to arguments as ``{color}``.
"""
if color:
kwargs["color"] = _style[color]
kwargs["color"] = _style[color] if color else ""

args_1 = tuple(str(arg) for arg in args)
args_1_gen = (
Expand Down
2 changes: 1 addition & 1 deletion src/scikit_build_core/build/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main() -> None:
description="Build backend utilities.",
)

subparsers = parser.add_subparsers(help="Commands")
subparsers = parser.add_subparsers(required=True, help="Commands")
requires = subparsers.add_parser(
"requires",
help="Get the build requirements",
Expand Down
Loading