Skip to content

Commit 023f72f

Browse files
committed
feat: a couple more command stubs
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 1a7352d commit 023f72f

File tree

5 files changed

+51
-4
lines changed

5 files changed

+51
-4
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
strategy:
4141
fail-fast: false
4242
matrix:
43-
python-version: ["3.8", "3.11", "3.12"]
43+
python-version: ["3.8", "3.12"]
4444
runs-on: [ubuntu-latest, macos-latest, windows-latest]
4545

4646
include:
47-
- python-version: pypy-3.9
47+
- python-version: pypy-3.10
4848
runs-on: ubuntu-latest
4949

5050
steps:

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ configure = "scikit_build_cli.commands.configure:configure"
6767
dynamic-metadata = "scikit_build_cli.commands.dynamic_metadata:dynamic_metadata"
6868
metadata = "scikit_build_cli.commands.metadata:metadata"
6969
install = "scikit_build_cli.commands.install:install"
70+
new = "scikit_build_cli.commands.new:new"
71+
init = "scikit_build_cli.commands.init:init"
7072

7173
[tool.hatch]
7274
version.source = "vcs"

src/scikit_build_cli/commands/init.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
import click
4+
5+
__all__: list[str] = ["init"]
6+
7+
8+
def __dir__() -> list[str]:
9+
return __all__
10+
11+
12+
@click.command()
13+
@click.help_option("--help", "-h")
14+
@click.pass_context
15+
def init(ctx: click.Context) -> None: # noqa: ARG001
16+
"""
17+
Add scikit-build to an existing project
18+
"""
19+
# TODO: Add specific implementations

src/scikit_build_cli/commands/new.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
from __future__ import annotations
2+
3+
import click
4+
5+
__all__: list[str] = ["new"]
6+
7+
8+
def __dir__() -> list[str]:
9+
return __all__
10+
11+
12+
@click.command()
13+
@click.help_option("--help", "-h")
14+
@click.pass_context
15+
def new(ctx: click.Context) -> None: # noqa: ARG001
16+
"""
17+
Start a new project
18+
"""
19+
# TODO: Add specific implementations

tests/test_package.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import importlib.metadata
44

5+
import pytest
56
from click.testing import CliRunner
67

78
import scikit_build_cli
@@ -14,9 +15,15 @@ def test_version() -> None:
1415
)
1516

1617

17-
def test_help_text() -> None:
18+
@pytest.mark.parametrize("flag", ["--help", "-h"])
19+
def test_help_text(flag: str) -> None:
1820
runner = CliRunner()
19-
result = runner.invoke(scikit_build_cli.__main__.skbuild, ["--help"])
21+
result = runner.invoke(scikit_build_cli.__main__.skbuild, [flag])
2022
assert result.exit_code == 0
2123
assert "Run CMake build step" in result.output
2224
assert "Run CMake configure step" in result.output
25+
assert "Get the generated dynamic metadata" in result.output
26+
assert "Run CMake install step" in result.output
27+
assert "Write out the project's metadata" in result.output
28+
assert "Start a new project" in result.output
29+
assert "Add scikit-build to an existing project" in result.output

0 commit comments

Comments
 (0)