@@ -59,3 +59,43 @@ def test_simple(example_runner: CliRunner) -> None:
5959
6060 # Publish the project to the local cache
6161 publish_project .publish ()
62+
63+ @staticmethod
64+ def test_build_requires (example_runner : CliRunner ) -> None :
65+ """build_requires project"""
66+ # Create project configuration
67+ project_root = Path .cwd ()
68+ project_configuration = ProjectConfiguration (project_root = project_root , version = None , verbosity = 2 , debug = True )
69+
70+ # Create console interface
71+ interface = ConsoleInterface ()
72+
73+ # Load pyproject.toml data
74+ pyproject_path = project_root / 'pyproject.toml'
75+ pyproject_data = loads (pyproject_path .read_text (encoding = 'utf-8' ))
76+
77+ # Create and use the project directly
78+ project = Project (project_configuration , interface , pyproject_data )
79+
80+ # Call install directly to get structured results
81+ project .install ()
82+
83+ # Run the CMake configuration command
84+ result = subprocess .run (['cmake' , '--preset=default' ], capture_output = True , text = True , check = False )
85+
86+ assert result .returncode == 0 , f'Cmake failed: { result .stderr } '
87+
88+ path = Path ('build' ).absolute ()
89+
90+ # Verify that the build directory contains the expected files
91+ assert (path / 'CMakeCache.txt' ).exists (), f'{ path / "CMakeCache.txt" } not found'
92+
93+ # --- Setup for Publish with modified config ---
94+ # Modify the in-memory representation of the pyproject data
95+ pyproject_data ['tool' ]['cppython' ]['provider' ]['remotes' ] = []
96+
97+ # Create a new project instance with the modified configuration for the 'publish' step
98+ publish_project = Project (project_configuration , interface , pyproject_data )
99+
100+ # Publish the project to the local cache
101+ publish_project .publish ()
0 commit comments