scikit-build-core: Some tests on Windows fail with ProcessNotRegisteredError
When building the package for conda, the following tests in tests/test_cmake_config.py fail on Windows:
test_cmake_pathstest_init_cachetest_cmake_args
at
config.configure()
with error ProcessNotRegisteredError:
Running e.g.:
pytest -vv -ra --showlocals -k "test_cmake_args"
...
if not cls.process_list[-1]._allow_unregistered:
> raise exceptions.ProcessNotRegisteredError(
"The process '%s' was not registered."
% (
command
if isinstance(command, str)
else " ".join(str(item) for item in command),
)
)
E pytest_subprocess.exceptions.ProcessNotRegisteredError: The process '%PREFIX%\Library\bin\cmake.EXE -S%SRC_DIR%\tests\packages\simple_pure -BC:\Users\buildu.
cls = <class 'pytest_subprocess.process_dispatcher.ProcessDispatcher'>
command = ['C:\\Users\\builidusername\\miniconda3\\envs\\c3i\\conda-bld\\scikit-build-core_1722583656353\\_test_env\\Library\\bin\\cmake.EXE',
'-SC:\\Users\\builidusername\\miniconda3\\envs\\c3i\\conda-bld\\scikit-build-core_1722583656353\\test_tmp\\tests\\packages\\simple_pure',
'-BC:\\Users\\builidusername\\AppData\\Local\\Temp\\pytest-of-builidusername\\pytest-86\\test_cmake_args0\\build',
'-DCMAKE_BUILD_TYPE:STRING=Release',
'-DSOMETHING=one']
command_instance = None
process_instance = None
processes = None
...
full log: scikit-build-core-0.9.9-pytest.log
Something is not working with the parameters in the registration of the commands here:
as a test, if I replace *cmd with fp.any() to ignore the parameters, the registration works and the three tests pass.
On other platforms (linux, darwin) these three tests pass.
I could not determine if it was a \\ problem or something else.
scikit-build-core version: 0.9.9 or 0.9.8
Python: 3.8 to 3.11
Windows: 11
pytest-subprocess: 1.5.0
cmake: 3.26.4
Compiler: vs2019 win-64
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- fix: expand some variables when constructing paths (#844) Trying a potential fix for #843. Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> — committed to scikit-build/scikit-build-core by henryiii 2 years ago
- tests: fix test cmake config (#847) The function `configure_args ` that is used to prepare the arguments in `tests/test_cmake_config.py` does not consider that there might be a `CMAKE_GENERATOR` se... — committed to scikit-build/scikit-build-core by lorepirri 2 years ago
I think we probably should monkeypatch the test to remove the envvar. If it’s important, we could also make a new or parameterized test with the envvar set. You generally don’t want a test to depend on the environment and run differently.