matham / rotpy

Python bindings for the Spinnaker SDK to enable Pythonic control of Teledyne/FLIR/Point Grey USB and GigE cameras.
MIT License
17 stars 0 forks source link

Python 3.12 #6

Open arminbahl opened 2 months ago

arminbahl commented 2 months ago

Hi,

Your package is of tremendous help for us to use Python to link to our Spinnaker SDK-based FLIR Cameras. With Python 3.12 around the corner, do think it would be possible to provide a Python 3.12-compatible pip wheel? This would allow us to upgrade our systems to the latest Python version and be happy for a few years.

Thanks and best! AB

arminbahl commented 1 week ago

I have tried to compile from source code. Include path, and lib configuration are fine. But I am getting various compiling errors:

`(base) C:\Users\ag-bahl\rotpy>pip install -e . Obtaining file:///C:/Users/ag-bahl/rotpy Installing build dependencies ... done Checking if build backend supports build_editable ... done Getting requirements to build editable ... done Preparing editable metadata (pyproject.toml) ... done Building wheels for collected packages: rotpy Building editable for rotpy (pyproject.toml) ... error error: subprocess-exited-with-error

× Building editable for rotpy (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [167 lines of output] running editable_wheel creating C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info writing C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\PKG-INFO writing dependency_links to C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\dependency_links.txt writing requirements to C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\requires.txt writing top-level names to C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\top_level.txt writing manifest file 'C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\SOURCES.txt' reading manifest file 'C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\SOURCES.txt' adding license file 'LICENSE' writing manifest file 'C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy.egg-info\SOURCES.txt' creating 'C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy-0.2.2.dev0.dist-info' C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\bdist_wheel.py:112: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect if get_flag("Py_DEBUG", hasattr(sys, "gettotalrefcount"), warn=(impl == "cp")): creating C:\Users\ag-bahl\AppData\Local\Temp\pip-wheel-f4k1e6ji.tmp-omgyu7em\rotpy-0.2.2.dev0.dist-info\WHEEL running build_py running build_ext

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
          JPEG_ENC "Spinnaker::TIFFOption::JPEG"

  cdef extern from "SpinnakerDefs.h" namespace "Spinnaker" nogil:

      const uint64_t EVENT_TIMEOUT_NONE = 0
      ^
  ------------------------------------------------------------

  rotpy\includes/SpinnakerDefs.pxi:20:4: Assignment to const 'EVENT_TIMEOUT_NONE'

  Error compiling Cython file:
  ------------------------------------------------------------
  ...

  cdef extern from "SpinnakerDefs.h" namespace "Spinnaker" nogil:

      const uint64_t EVENT_TIMEOUT_NONE = 0
      const uint64_t EVENT_TIMEOUT_INFINITE = 0xFFFFFFFFFFFFFFFF
      ^
  ------------------------------------------------------------

  rotpy\includes/SpinnakerDefs.pxi:21:4: Assignment to const 'EVENT_TIMEOUT_INFINITE'
  Traceback (most recent call last):
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 153, in run
      self._create_wheel_file(bdist_wheel)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 355, in _create_wheel_file
      files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 278, in _run_build_commands
      self._run_build_subcommands()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 305, in _run_build_subcommands
      self.run_command(name)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\dist.py", line 974, in run_command
      super().run_command(command)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 989, in run_command
      cmd_obj.run()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
      self.build_extensions()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 479, in build_extensions
      self._build_extensions_serial()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 505, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Distutils\build_ext.py", line 130, in build_extension
      new_ext = cythonize(
                ^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: rotpy\_interface.pyx
  C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\dist.py:989: _DebuggingTips: Problem in editable installation.
  !!

          ********************************************************************************
          An error happened while installing `rotpy` in editable mode.

          The following steps are recommended to help debug this problem:

          - Try to install the project normally, without using the editable mode.
            Does the error still persist?
            (If it does, try fixing the problem before attempting the editable mode).
          - If you are using binary extensions, make sure you have all OS-level
            dependencies installed (e.g. compilers, toolchains, binary libraries, ...).
          - Try the latest version of setuptools (maybe the error was already fixed).
          - If you (or your project dependencies) are using any setuptools extension
            or customization, make sure they support the editable mode.

          After following the steps above, if the problem still persists and
          you think this is related to how setuptools handles editable installations,
          please submit a reproducible example
          (see https://stackoverflow.com/help/minimal-reproducible-example) to:

              https://github.com/pypa/setuptools/issues

          See https://setuptools.pypa.io/en/latest/userguide/development_mode.html for details.
          ********************************************************************************

  !!
    cmd_obj.run()
  Compiling rotpy\_interface.pyx because it depends on C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Includes\libcpp\string.pxd.
  [1/1] Cythonizing rotpy\_interface.pyx
  Traceback (most recent call last):
    File "C:\Users\ag-bahl\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\ag-bahl\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\anaconda3\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 273, in build_editable
      return hook(wheel_directory, config_settings, metadata_directory)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\build_meta.py", line 453, in build_editable
      return self._build_with_temp_dir(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\build_meta.py", line 397, in _build_with_temp_dir
      self.run_setup()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 89, in <module>
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\__init__.py", line 103, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 184, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\core.py", line 200, in run_commands
      dist.run_commands()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 970, in run_commands
      self.run_command(cmd)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\dist.py", line 974, in run_command
      super().run_command(command)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 989, in run_command
      cmd_obj.run()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 153, in run
      self._create_wheel_file(bdist_wheel)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 355, in _create_wheel_file
      files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 278, in _run_build_commands
      self._run_build_subcommands()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 305, in _run_build_subcommands
      self.run_command(name)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
      self.distribution.run_command(command)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\dist.py", line 974, in run_command
      super().run_command(command)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 989, in run_command
      cmd_obj.run()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
      self.build_extensions()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 479, in build_extensions
      self._build_extensions_serial()
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 505, in _build_extensions_serial
      self.build_extension(ext)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Distutils\build_ext.py", line 130, in build_extension
      new_ext = cythonize(
                ^^^^^^^^^^
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "C:\Users\ag-bahl\AppData\Local\Temp\pip-build-env-b0p3ev_6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: rotpy\_interface.pyx
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building editable for rotpy Failed to build rotpy ERROR: Could not build wheels for rotpy, which is required to install pyproject.toml-based projects`

Is this a problem with Cython? Would it be possible to provide a new compiled wheel against Python 3.12.

Thanks!