Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.17.2: pytest is failing because use deprecated pkg_resources #951

Open
kloczek opened this issue Apr 20, 2023 · 9 comments
Open

0.17.2: pytest is failing because use deprecated pkg_resources #951

kloczek opened this issue Apr 20, 2023 · 9 comments

Comments

@kloczek
Copy link

kloczek commented Apr 20, 2023

Latest pytest 7.3.1 and latest setuptools 67.6.1.

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-scikit-build-0.17.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-scikit-build-0.17.2-2.fc35
+ /usr/bin/pytest -ra -m 'not network' -m 'not nosetuptoolsscm' --deselect tests/test_hello_cpp.py::test_hello_develop --deselect tests/test_issue274_support_default_package_dir.py::test_in
============================= test session starts ==============================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
installed packages of interest: build==0.10.0 distro==1.8.0 packaging==23.0 pip==23.0.1 setuptools==67.6.1 setuptools_scm==7.1.0 virtualenv==20.21.0 wheel==0.40.0
rootdir: /home/tkloczko/rpmbuild/BUILD/scikit-build-0.17.2
configfile: pyproject.toml
testpaths: tests
plugins: shutil-1.7.0, virtualenv-1.7.0, mock-3.10.0
collected 241 items / 13 deselected / 1 skipped / 228 selected

tests/test_broken_project.py FFFFFFF                                     [  3%]
tests/test_cmake_target.py F                                             [  3%]
tests/test_cmakelists_not_in_top_level_dir.py FFFFF                      [  5%]
tests/test_cmaker.py ...............                                     [ 12%]
tests/test_command_line.py FFFFFFFFFFFFFF                                [ 18%]
tests/test_constants.py .                                                [ 18%]
tests/test_cython_flags.py F                                             [ 19%]
tests/test_distribution.py s.                                            [ 20%]
tests/test_filter_manifest.py F                                          [ 20%]
tests/test_hello_cpp.py FFFFFF                                           [ 23%]
tests/test_hello_cython.py FFF                                           [ 24%]
tests/test_hello_pure.py FFFF                                            [ 26%]
tests/test_include_exclude_data.py FF                                    [ 27%]
tests/test_issue284_build_ext_inplace.py F                               [ 27%]
tests/test_issue335_support_cmake_source_dir.py F                        [ 28%]
tests/test_issue342_cmake_osx_args_in_setup.py FFFFFFFFF                 [ 32%]
tests/test_issue352_isolated_environment_support.py F                    [ 32%]
tests/test_issue707_tested_packages.py F                                 [ 32%]
tests/test_logging.py ..                                                 [ 33%]
tests/test_manifest_in.py F                                              [ 34%]
tests/test_numpy.py .                                                    [ 34%]
tests/test_outside_project_root.py FFF                                   [ 35%]
tests/test_pep518.py ..                                                  [ 36%]
tests/test_platform.py .............s                                    [ 42%]
tests/test_setup.py ....FFFFFFFFFFFFF...........FFFFFFFFFFFFFFFFFFFFFFFF [ 65%]
FFFFFFFFFsssFsssFsssFsssFsssFsssFsssFsssFFFFF                            [ 85%]
tests/test_skbuild.py .sFFFssss                                          [ 89%]
tests/test_skbuild_variable.py FFF                                       [ 90%]
tests/test_utils.py .....................                                [100%]

=================================== FAILURES ===================================
____________________ test_cmakelists_with_fatalerror_fails _____________________

capfd = <_pytest.capture.CaptureFixture object at 0x7f0dca81e7f0>

    def test_cmakelists_with_fatalerror_fails(capfd):
        with push_dir():

            @project_setup_py_test("fail-with-fatal-error-cmakelists", ["build"], disable_languages_test=True)
            def should_fail():
                pass

            with pytest.raises(SystemExit) as excinfo:
>               should_fail()

capfd      = <_pytest.capture.CaptureFixture object at 0x7f0dca81e7f0>
excinfo    = <ExceptionInfo for raises contextmanager>
should_fail = <function test_cmakelists_with_fatalerror_fails.<locals>.should_fail at 0x7f0dca868ca0>

tests/test_broken_project.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/__init__.py:249: in wrapped
    with execute_setup_py(wrapped.tmp_dir, wrapped.setup_args, disable_languages_test=disable_languages_test):
        disable_languages_test = True
        fun        = <function test_cmakelists_with_fatalerror_fails.<locals>.should_fail at 0x7f0dca868f70>
        iargs      = ()
        ikwargs    = {}
        ret        = False
        wrapped    = <function test_cmakelists_with_fatalerror_fails.<locals>.should_fail at 0x7f0dca868ca0>
/usr/lib64/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
        self       = <contextlib._GeneratorContextManager object at 0x7f0dca823070>
tests/__init__.py:218: in execute_setup_py
    pkg_resources._initialize_master_working_set()
        disable_languages_test = True
        project_dir = local('/tmp/pytest-of-tkloczko/pytest-179/should_fail0')
        setup_args = ['build']
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3349: in _initialize_master_working_set
    tuple(dist.activate(replace=False) for dist in working_set)
        add_activation_listener = <bound method WorkingSet.subscribe of <pkg_resources.WorkingSet object at 0x7f0dca823910>>
        iter_entry_points = <bound method WorkingSet.iter_entry_points of <pkg_resources.WorkingSet object at 0x7f0dca823910>>
        require    = <bound method WorkingSet.require of <pkg_resources.WorkingSet object at 0x7f0dca823910>>
        run_main   = <bound method WorkingSet.run_script of <pkg_resources.WorkingSet object at 0x7f0dca823910>>
        run_script = <bound method WorkingSet.run_script of <pkg_resources.WorkingSet object at 0x7f0dca823910>>
        working_set = <pkg_resources.WorkingSet object at 0x7f0dca823910>
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3349: in <genexpr>
    tuple(dist.activate(replace=False) for dist in working_set)
        .0         = <generator object WorkingSet.__iter__ at 0x7f0dca9bc040>
        dist       = sphinxcontrib-devhelp 1.0.2.dev20230415 (/usr/lib/python3.8/site-packages)
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2870: in activate
    declare_namespace(pkg)
        path       = ['/tmp/pytest-of-tkloczko/pytest-179/should_fail0', '/home/tkloczko/rpmbuild/BUILD/scikit-build-0.17.2', '/usr/bin', '...ld/BUILDROOT/python-scikit-build-0.17.2-2.fc35.
        pkg        = 'sphinxcontrib'
        replace    = False
        self       = sphinxcontrib-devhelp 1.0.2.dev20230415 (/usr/lib/python3.8/site-packages)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


[..]

================================================================================== short test summary info ==================================================================================
SKIPPED [1] tests/test_hello_fortran.py:18: could not import 'numpy': No module named 'numpy'
SKIPPED [1] tests/test_distribution.py:20: no source distribution available
SKIPPED [1] tests/test_platform.py:116: Requires Windows
SKIPPED [24] tests/test_setup.py:584: unsupported configuration: python package fully generated by CMake does *NOT* work. At least __init__.py should be in the project source tree
SKIPPED [1] tests/test_skbuild.py:84: NMake Makefiles generator is not available on Linux
SKIPPED [3] tests/test_skbuild.py:127: Requires Windows
SKIPPED [1] tests/test_skbuild.py:151: Requires Windows
FAILED tests/test_broken_project.py::test_cmakelists_with_fatalerror_fails - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_cmakelists_with_syntaxerror_fails - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_hello_with_compileerror_fails - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_invalid_cmake[CalledProcessError] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_invalid_cmake[OSError] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_first_invalid_generator - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_broken_project.py::test_invalid_generator - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmake_target.py::test_cmake_target_build - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmakelists_not_in_top_level_dir.py::test_build - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmakelists_not_in_top_level_dir.py::test_cmake_source_dir[invalid-True] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmakelists_not_in_top_level_dir.py::test_cmake_source_dir[-False] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmakelists_not_in_top_level_dir.py::test_cmake_source_dir[.-False] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cmakelists_not_in_top_level_dir.py::test_hello_sdist - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_help - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_help_commands - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_metadata_display - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_no_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_invalid_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_too_many_separators - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_cmake_initial_cache_as_global_option - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_cmake_executable_arg - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_hide_listing[True-sdist] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_hide_listing[True-bdist_wheel] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_hide_listing[False-sdist] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_hide_listing[False-bdist_wheel] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_run_cmake_arg - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_command_line.py::test_skip_cmake_arg - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_cython_flags.py::test_hello_cython_builds - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_filter_manifest.py::test_bdist_wheel_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_builds - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_sdist - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_wheel - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_clean[with-dry-run] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_clean[without-dry-run] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_cleans - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cpp.py::test_hello_develop - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cython.py::test_hello_cython_builds - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cython.py::test_hello_cython_sdist - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_cython.py::test_hello_cython_wheel - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_pure.py::test_hello_pure_builds - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_pure.py::test_hello_pure_sdist - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_pure.py::test_hello_pure_wheel - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_hello_pure.py::test_hello_clean - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_include_exclude_data.py::test_include_exclude_data - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_include_exclude_data.py::test_include_exclude_data_with_base - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue274_support_default_package_dir.py::test_install_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue274_support_default_package_dir.py::test_test_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue274_support_one_package_without_package_dir.py::test_install_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue274_support_one_package_without_package_dir.py::test_test_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue284_build_ext_inplace.py::test_build_ext_inplace_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue334_configure_cmakelists_non_cp1252_encoding.py::test_install_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue335_support_cmake_source_dir.py::test_bdist_wheel_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args0-keyword_cmake_args0-cli_cmake_args0-10.9] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[10.7-cli_setup_args1-keyword_cmake_args1-cli_cmake_args1-10.7] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[10.7-cli_setup_args2-keyword_cmake_args2-cli_cmake_args2-10.9] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args3-keyword_cmake_args3-cli_cmake_args3-10.6] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args4-keyword_cmake_args4-cli_cmake_args4-10.7] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args5-keyword_cmake_args5-cli_cmake_args5-10.7] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args6-keyword_cmake_args6-cli_cmake_args6-10.7] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args7-keyword_cmake_args7-cli_cmake_args7-10.8] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue342_cmake_osx_args_in_setup.py::test_cmake_args_keyword_osx_default[None-cli_setup_args8-keyword_cmake_args8-cli_cmake_args8-10.8] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue352_isolated_environment_support.py::test_isolated_env_trigger_reconfigure - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue668_symbol_visibility.py::test_symbol_visibility[ON] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue668_symbol_visibility.py::test_symbol_visibility[OFF] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_issue707_tested_packages.py::test_install_command - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_manifest_in.py::test_manifest_in_wheel - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_outside_project_root.py::test_outside_project_root_fails[None] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_outside_project_root.py::test_outside_project_root_fails[-DINSTALL_FILE:BOOL=1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_outside_project_root.py::test_outside_project_root_fails[-DINSTALL_PROJECT:BOOL=1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_args_keyword[cmake_args0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_args_keyword[cmake_args1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_dir_keyword[None-True-str] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_dir_keyword[-True-str] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_dir_keyword[/tmp/scikit-build-True-SKBuildError] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_dir_keyword[banana-False-str] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_with_sdist_keyword[True] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_with_sdist_keyword[False] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_minimum_required_version_keyword - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_requires_keyword_include_cmake - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_script_keyword[pure] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_script_keyword[skbuild] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_py_modules_keyword[pure] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_py_modules_keyword[skbuild] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-0-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-0-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-0-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-1-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-1-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-0-1-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-0-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-0-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-0-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-1-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-1-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-0-1-1-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-0-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-0-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-0-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-1-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-1-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-0-1-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-0-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-0-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-0-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-1-0-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-1-1-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[0-1-1-1-1-1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-0-0-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-0-0-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-0-1-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-0-1-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-1-0-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-1-0-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-1-1-0-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_setup_inputs[1-1-1-1-0-0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_into_pure_package[0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_cmake_install_into_pure_package[1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_zip_safe_default[None] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_zip_safe_default[False] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_setup.py::test_zip_safe_default[True] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild.py::test_generator[Unix Makefiles-make] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild.py::test_invalid_generator[generator_args0] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild.py::test_invalid_generator[generator_args1] - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild_variable.py::test_skbuild_variable_builds - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild_variable.py::test_skbuild_variable_sdist - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
FAILED tests/test_skbuild_variable.py::test_skbuild_variable_wheel - DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
=========================================================== 134 failed, 72 passed, 32 skipped, 4 deselected in 104.83s (0:01:44) ============================================================

Excample ho to replace pkg_resources on use namespaces mcmtroffaes/sphinxcontrib-bibtex@65153f78

@henryiii
Copy link
Contributor

Do you have to have sphinxcontrib-devhelp installed? This is being loaded by pkg_resources's global loader even though it is not used by us.

@kloczek
Copy link
Author

kloczek commented Apr 20, 2023

Do you have to have sphinxcontrib-devhelp installed? This is being loaded by pkg_resources's global loader even though it is not used by us.

Yes I have and you are right that part of those fails is because that modules is using pkg_resources however scikit-build is urint it in own code as well 😋

[tkloczko@pers-jacek scikit-build-0.17.2]$ grep -r pkg_resources
pyproject.toml:  'ignore: pkg_resources is deprecated as an API:DeprecationWarning',
tests/__init__.py:import pkg_resources
tests/__init__.py:        pkg_resources._initialize_master_working_set()
tests/pytest_helpers.py:from pkg_resources import parse_version

@kloczek
Copy link
Author

kloczek commented Apr 20, 2023

FYI temporary in my build procedute I've added -W ignore::DeprecationWarning to pytest paramms so that issue is not-so-urgent 😋

@APN-Pucky
Copy link

With -Werror I get the warning/error as well with scikit-build-0.17.6:

    from skbuild import cmaker
/usr/lib/python3.11/site-packages/skbuild/__init__.py:10: in <module>
    from .setuptools_wrap import setup
/usr/lib/python3.11/site-packages/skbuild/setuptools_wrap.py:31: in <module>
    from .command import (
/usr/lib/python3.11/site-packages/skbuild/command/test.py:5: in <module>
    from setuptools.command.test import test as _test
/usr/lib/python3.11/site-packages/setuptools/command/test.py:11: in <module>
    from pkg_resources import (
/usr/lib/python3.11/site-packages/pkg_resources/__init__.py:121: in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
E   DeprecationWarning: pkg_resources is deprecated as an API

@henryiii
Copy link
Contributor

Yeah, we disable this one:

'ignore: pkg_resources is deprecated as an API:DeprecationWarning',

Since it's coming from inside setuptools itself. (setuptools/command/test.py is calling it, not us). We'll be removing the "test" command customization soon, since it's heavily deprecated at this point.

@kloczek
Copy link
Author

kloczek commented Jul 21, 2023

setuptools maintainer plans to remove pkg_resources so sooner or later it will be necessary to port that to proposed in doc solution 😋

@kloczek
Copy link
Author

kloczek commented Aug 31, 2023

With latest setuptools now pytest fails with

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-scikit-build-0.17.6-4.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-scikit-build-0.17.6-4.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' -m 'not nosetuptoolsscm' --deselect tests/test_hello_cpp.py::test_hello_develop --deselect tests/test_issue274_support_default_package_dir.py::test_install_command --deselect tests/test_issue274_support_default_package_dir.py::test_test_command --deselect tests/test_issue274_support_one_package_without_package_dir.py::test_install_command --deselect tests/test_issue274_support_one_package_without_package_dir.py::test_test_command --deselect tests/test_issue334_configure_cmakelists_non_cp1252_encoding.py::test_install_command --deselect 'tests/test_issue668_symbol_visibility.py::test_symbol_visibility[OFF]' --deselect 'tests/test_issue668_symbol_visibility.py::test_symbol_visibility[ON]'
ImportError while loading conftest '/home/tkloczko/rpmbuild/BUILD/scikit-build-0.17.6/tests/conftest.py'.
tests/__init__.py:22: in <module>
    import pkg_resources
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3328: in <module>
    def _initialize_master_working_set():
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3302: in _call_aside
    f(*args, **kwargs)
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3353: in _initialize_master_working_set
    tuple(dist.activate(replace=False) for dist in working_set)
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:3353: in <genexpr>
    tuple(dist.activate(replace=False) for dist in working_set)
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2871: in activate
    declare_namespace(pkg)
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2339: in declare_namespace
    warnings.warn(msg, DeprecationWarning, stacklevel=2)
E   DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
E   Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages

@henryiii
Copy link
Contributor

That’s not triggered by scikit-build. You have a sphinxcontrib extension installed that is triggering it. The old mechanism hooked onto the import system.

@henryiii
Copy link
Contributor

Though I should see if we can avoid importing pkgutils.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@APN-Pucky @henryiii @kloczek and others