Skip to content

Commit b7e5d07

Browse files
committed
T
1 parent f591725 commit b7e5d07

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

examples/conan_cmake/inject/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ description = "A simple project showing how to use conan with CPPython"
33
name = "cppython-conan-cmake-simple"
44
version = "1.0.0"
55

6-
license = {text = "MIT"}
6+
license = { text = "MIT" }
77

8-
authors = [{name = "Synodic Software", email = "contact@synodic.software"}]
8+
authors = [{ name = "Synodic Software", email = "contact@synodic.software" }]
99

1010
requires-python = ">=3.13"
1111

12-
dependencies = ["cppython[conan, cmake]>=0.1.0"]
12+
dependencies = ["cppython[conan, cmake, git]>=0.9.0"]
1313

1414
[tool.cppython]
1515
generator-name = "cmake"

examples/conan_cmake/simple/pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ description = "A simple project showing how to use conan with CPPython"
33
name = "cppython-conan-cmake-simple"
44
version = "1.0.0"
55

6-
license = {text = "MIT"}
6+
license = { text = "MIT" }
77

8-
authors = [{name = "Synodic Software", email = "contact@synodic.software"}]
8+
authors = [{ name = "Synodic Software", email = "contact@synodic.software" }]
99

1010
requires-python = ">=3.13"
1111

12-
dependencies = ["cppython[conan, cmake]>=0.1.0"]
12+
dependencies = ["cppython[conan, cmake, git]>=0.9.0"]
13+
1314

1415
[tool.cppython]
1516
generator-name = "cmake"

examples/vcpkg_cmake/simple/pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ description = "A simple project showing how to use vcpkg with CPPython"
33
name = "cppython-vcpkg-cmake-simple"
44
version = "1.0.0"
55

6-
license = {text = "MIT"}
6+
license = { text = "MIT" }
77

8-
authors = [{name = "Synodic Software", email = "contact@synodic.software"}]
8+
authors = [{ name = "Synodic Software", email = "contact@synodic.software" }]
99

1010
requires-python = ">=3.13"
1111

12-
dependencies = ["cppython[vcpkg, cmake]>=0.1.0"]
12+
dependencies = ["cppython[vcpkg, cmake, git]>=0.9.0"]
13+
1314

1415
[tool.cppython]
1516
generator-name = "cmake"

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ skip_empty = true
100100
plugins = ["-e file:///${PROJECT_ROOT}"]
101101

102102
[tool.pdm.options]
103-
update = ["--update-all", "--unconstrained"]
103+
install = ["-G:all"]
104+
update = ["--update-all"]
104105

105106
[tool.pdm.version]
106107
source = "scm"

tests/fixtures/cli.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def fixture_typer_runner() -> CliRunner:
2222
name='fresh_environment',
2323
scope='session',
2424
)
25-
def fixture_fresh_environment() -> dict[str, str]:
25+
def fixture_fresh_environment(request: pytest.FixtureRequest) -> dict[str, str]:
2626
"""Create a fresh environment for subprocess calls."""
2727
# Start with a minimal environment
2828
new_env = {}
@@ -33,4 +33,8 @@ def fixture_fresh_environment() -> dict[str, str]:
3333

3434
# Provide a PATH that doesn't contain venv references
3535
new_env['PATH'] = os.environ['PATH']
36+
37+
# Set the Cppython root directory
38+
new_env['CPPYTHON_ROOT'] = str(request.config.rootpath.resolve())
39+
3640
return new_env

tests/integration/examples/test_conan_cmake.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ class TestConanCMake:
1919
def test_simple(example_runner: CliRunner, fresh_environment: dict[str, str]) -> None:
2020
"""Simple project"""
2121
# By nature of running the test, we require PDM to develop the project and so it will be installed
22+
result = subprocess.run(
23+
['pdm', 'install', '--plugins'], capture_output=True, text=True, env=fresh_environment, check=False
24+
)
25+
26+
assert result.returncode == 0, f'PDM plugin installation failed: {result.stderr}'
27+
2228
result = subprocess.run(['pdm', 'install'], capture_output=True, text=True, env=fresh_environment, check=False)
2329

2430
assert result.returncode == 0, f'PDM install failed: {result.stderr}'
@@ -37,6 +43,12 @@ def test_simple(example_runner: CliRunner, fresh_environment: dict[str, str]) ->
3743
def test_inject(example_runner: CliRunner, fresh_environment: dict[str, str]) -> None:
3844
"""Inject"""
3945
# By nature of running the test, we require PDM to develop the project and so it will be installed
46+
result = subprocess.run(
47+
['pdm', 'install', '--plugins'], capture_output=True, text=True, env=fresh_environment, check=False
48+
)
49+
50+
assert result.returncode == 0, f'PDM plugin installation failed: {result.stderr}'
51+
4052
result = subprocess.run(['pdm', 'install'], capture_output=True, text=True, env=fresh_environment, check=False)
4153

4254
assert result.returncode == 0, f'PDM install failed: {result.stderr}'

0 commit comments

Comments
 (0)