opencv / opencv/opencv-python

Build problem with setuptools 75.6.0

オープン
#1,069 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Python
スター
5.4k
フォーク
1k
平均マージ
22時間 17分
マージ済み PR(30日)
3

説明

Expected behaviour

I'm building with setuptools 75.6.0 on Python 3.12 with pip 24.2. I expect it works !

Actual behaviour

I have several problems when I build :

  • first a warning (just for the record) :
     /home/baptiste/mfext/build/opt/python3_scientific/lib/python3.12/site-packages/skbuild/command/test.py:3: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
      !!

              ********************************************************************************
              Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.
              ********************************************************************************

      !!
        from setuptools.command.test import test as _test
      /home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py:251: _IncompatibleBdistWheel: wheel.bdist_wheel is deprecated, please import it from setuptools
      !!

              ********************************************************************************
              Ensure that any custom bdist_wheel implementation is a subclass of
              setuptools.command.bdist_wheel.bdist_wheel.

              By 2025-Oct-15, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://github.com/pypa/wheel/pull/631 for details.
  • Then an error :
      copying LICENSE-3RD-PARTY.txt -> _skbuild/linux-x86_64-3.12/cmake-install/cv2/LICENSE-3RD-PARTY.txt
      Traceback (most recent call last):
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/fancy_getopt.py", line 245, in getopt
          opts, args = getopt.getopt(args, short_opts, self.long_opts)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/getopt.py", line 93, in getopt
          opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/getopt.py", line 157, in do_longs
          has_arg, opt = long_has_args(opt, longopts)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/getopt.py", line 174, in long_has_args
          raise GetoptError(_('option --%s not recognized') % opt, opt)
      getopt.GetoptError: option --dist-info-dir not recognized

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 170, in setup
          ok = dist.parse_command_line()
               ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 472, in parse_command_line
          args = self._parse_command_opts(parser, args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/dist.py", line 896, in _parse_command_opts
          nargs = _Distribution._parse_command_opts(self, parser, args)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 576, in _parse_command_opts
          (args, opts) = parser.getopt(args[1:])
                         ^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/fancy_getopt.py", line 247, in getopt
          raise DistutilsArgError(msg)
      distutils.errors.DistutilsArgError: option --dist-info-dir not recognized

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 438, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 543, in <module>
        File "<string>", line 273, in main
        File "/home/baptiste/mfext/build/opt/python3_scientific/lib/python3.12/site-packages/skbuild/setuptools_wrap.py", line 507, in setup
          return setuptools.setup(**kw)
                 ^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 172, in setup
          raise SystemExit(gen_usage(dist.script_name) + f"\nerror: {msg}")
      SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
         or: setup.py --help [cmd1 cmd2 ...]
         or: setup.py --help-commands
         or: setup.py cmd --help

      error: option --dist-info-dir not recognized

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 444, in build_wheel
          return _build(['bdist_wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 426, in _build
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
          self.run_setup()
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/home/baptiste/mfext/build/opt/python3_core/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 543, in <module>
        File "<string>", line 273, in main
        File "/home/baptiste/mfext/build/opt/python3_scientific/lib/python3.12/site-packages/skbuild/setuptools_wrap.py", line 671, in setup
          _classify_installed_files(
        File "<string>", line 483, in _classify_installed_files_override
      TypeError: RearrangeCMakeOutput._classify_installed_files_override() got an unexpected keyword argument '_cmake_install_dir'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for opencv-contrib-python-headless

I had no problem with setuptools 74.1.3. So it's probably linked to last changes in setuptools 75

Steps to reproduce
  • operating system : rockylinux 8
  • architecture : x86-64
  • opencv-python version : 4.10.0.84
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、Python 3.12、pip 24.2、setuptools 75.6.0、opencv-python 4.10.0.84 を使用して、Rocky Linux 8 上で opencv-contrib-python-headless のビルドを再現します。skbuild/setuptools_wrap.py を通してビルドを追跡し、--dist-info-dir の失敗と _classify_installed_files_override() の TypeError に焦点を当て、その後、setuptools 74.1.3 で同じビルドを比較します。setuptools 75.6.0 で wheel のビルドに成功すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。