displaycal-py3 icon indicating copy to clipboard operation
displaycal-py3 copied to clipboard

3.9.10: build failure with python 3.11

Open tgurr opened this issue 2 years ago • 4 comments

While rebuilding the packages for python 3.11 on our distribution I run into the following error trying to build 3.9.10:

[...]
/usr/x86_64-pc-linux-gnu/bin/python3.11 -m build --wheel --no-isolation
* Getting dependencies for wheel...
/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
['egg_info']

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Traceback (most recent call last):
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/defaultpaths.py", line 234, in set_translation
    obj.translation = gettext.translation(
                      ^^^^^^^^^^^^^^^^^^^^
TypeError: translation() got an unexpected keyword argument 'codeset'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/pep517/in_process/_in_process.py", line 363, in <module>
    main()
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/pep517/in_process/_in_process.py", line 345, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=['wheel'])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/setuptools/build_meta.py", line 320, in _get_build_requires
    self.run_setup()
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 1583, in <module>
  File "<string>", line 991, in setup
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/setup.py", line 70, in <module>
    from DisplayCAL.defaultpaths import autostart, autostart_home
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/defaultpaths.py", line 399, in <module>
    if isinstance(attr, (str, list)):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/defaultpaths.py", line 303, in __getattribute__
    object.__getattribute__(self, "init")()
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/defaultpaths.py", line 380, in init
    XDG.set_translation(self)
  File "/var/tmp/paludis/build/measurement-DisplayCAL-3.9.10/work/DisplayCAL-3.9.10/DisplayCAL/defaultpaths.py", line 238, in set_translation
    obj.translation = gettext.translation(
                      ^^^^^^^^^^^^^^^^^^^^
  File "/usr/x86_64-pc-linux-gnu/lib/python3.11/gettext.py", line 516, in translation
    raise FileNotFoundError(ENOENT,
FileNotFoundError: [Errno 2] No translation file found for domain: 'xdg-user-dirs'

Error:
  * In program cave perform install --hooks --managed-output --output-exclusivity with-others =measurement/DisplayCAL-3.9.10:0::hardware --destination installed --replacing =measurement/DisplayCAL-3.9.7:0::installed --x-of-y 1 of 1:
  * When installing 'measurement/DisplayCAL-3.9.10:0::hardware' replacing { 'measurement/DisplayCAL-3.9.7:0::installed' }:
  * When running an ebuild command on 'measurement/DisplayCAL-3.9.10:0::hardware':
  * Install failed for 'measurement/DisplayCAL-3.9.10:0::hardware' (paludis::ActionFailedError)


!!! ERROR in measurement/DisplayCAL-3.9.10::hardware:
!!! In edo at line 1350
!!! /usr/x86_64-pc-linux-gnu/bin/python3.11 -m build --wheel --no-isolation failed
[...]

The first TypeError probably doesn't matter due to https://github.com/eoyilmaz/displaycal-py3/commit/f2ea3f28a8a170810af53b1501d5f505f9b4390d however it looks like it's running into another error afterwards.

tgurr avatar Dec 09 '22 07:12 tgurr

Hey @tgurr can you try to build with the dev-branch? I had to do some minor tweaks to get displaycal running with python 3.11. The main branch will not run with python 3.11 because we set some limitations in the early porting phase.

p5k369 avatar Dec 10 '22 18:12 p5k369

Hey @tgurr can you try to build with the dev-branch? I had to do some minor tweaks to get displaycal running with python 3.11. The main branch will not run with python 3.11 because we set some limitations in the early porting phase.

Thanks for the hint! After backporting the following two commits from develop branch:

https://github.com/eoyilmaz/displaycal-py3/commit/3762e7be0368484d68c4a90923672fdb0f51a5fc https://github.com/eoyilmaz/displaycal-py3/commit/97f0c91f5855e4d21f47181ef596251eb03cb835

3.9.10 builds and runs (at least statup - didn't test any actual functions) for me with Python 3.11.

tgurr avatar Dec 11 '22 01:12 tgurr

@p5k369

The main branch will not run with python 3.11 because we set some limitations in the early porting phase.

Just ran into this on a pip-install on Fedora37 + python 3.11.

are those backports slated to move to main, and to PiPi? or should we DIY build from dev branch for awhile ?

FYI, here, a DIY from 'develop' branch fails @ req'ts

lsb_release -rd
	Description:    Fedora release 37 (Thirty Seven)
	Release:        37

dnf install gcc glibc-devel dbus pkgconf gtk3-devel libXxf86vm-devel

python -V
	Python 3.11.0
pip install --upgrade pip
pip -V
	pip 22.3.1 from /usr/local/lib/python3.11/site-packages/pip (python 3.11)
pip check
	No broken requirements found.

cd /usr/local/src
rm -rf displaycal-py3 displaycal_venv

git clone https://github.com/eoyilmaz/displaycal-py3

python -m venv ./displaycal_venv
source ./displaycal_venv/bin/activate
cd ./displaycal-py3/

git checkout develop

pip install --upgrade pip
pip install attrdict setuptools
pip install -r requirements.txt -v
	Using pip 22.3.1 from /usr/local/src/displaycal_venv/lib64/python3.11/site-packages/pip (python 3.11)
	Collecting attrdict3
	  Using cached attrdict3-2.0.2-py2.py3-none-any.whl (10 kB)
	Collecting build
	  Using cached build-0.9.0-py3-none-any.whl (17 kB)
	...
	Collecting distro
	  Using cached distro-1.8.0-py3-none-any.whl (20 kB)
	  Link requires a different Python (3.11.0 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/3a/be/650f9c091ef71cb01d735775d554e068752d3ff63d7943b26316dc401749/numpy-1.21.2.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
	  Link requires a different Python (3.11.0 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/5f/d6/ad58ded26556eaeaa8c971e08b6466f17c4ac4d786cd3d800e26ce59cc01/numpy-1.21.3.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
	  Link requires a different Python (3.11.0 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/fb/48/b0708ebd7718a8933f0d3937513ef8ef2f4f04529f1f66ca86d873043921/numpy-1.21.4.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
	  Link requires a different Python (3.11.0 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/c2/a8/a924a09492bdfee8c2ec3094d0a13f2799800b4fdc9c890738aeeb12c72e/numpy-1.21.5.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
	  Link requires a different Python (3.11.0 not in: '>=3.7,<3.11'): https://files.pythonhosted.org/packages/45/b7/de7b8e67f2232c26af57c205aaad29fe17754f793404f59c8a730c7a191a/numpy-1.21.6.zip (from https://pypi.org/simple/numpy/) (requires-python:>=3.7,<3.11)
	Collecting numpy
	  Using cached numpy-1.24.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
	Collecting Pillow
	  Using cached Pillow-9.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (3.3 MB)
	Collecting PyChromecast
	  Using cached PyChromecast-13.0.4-py2.py3-none-any.whl (62 kB)
	Collecting Send2Trash
	  Using cached Send2Trash-1.8.0-py3-none-any.whl (18 kB)
	Collecting wxPython>=4.1.1
	  Using cached wxPython-4.2.0.tar.gz (71.0 MB)
	  Running command python setup.py egg_info
	  Traceback (most recent call last):
	    File "<string>", line 2, in <module>
	    File "<pip-setuptools-caller>", line 34, in <module>
	    File "/tmp/pip-install-oor5t868/wxpython_7b3c918bfe8546fb8046b2f991d236cd/setup.py", line 27, in <module>
	      from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
	    File "/tmp/pip-install-oor5t868/wxpython_7b3c918bfe8546fb8046b2f991d236cd/buildtools/config.py", line 30, in <module>
	      from attrdict import AttrDict
	    File "/usr/local/src/displaycal_venv/lib64/python3.11/site-packages/attrdict/__init__.py", line 5, in <module>
	      from attrdict.mapping import AttrMap
	    File "/usr/local/src/displaycal_venv/lib64/python3.11/site-packages/attrdict/mapping.py", line 4, in <module>
	      from collections import Mapping
	  ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.11/collections/__init__.py)
	  error: subprocess-exited-with-error

	  × python setup.py egg_info did not run successfully.
	  │ exit code: 1
	  ╰─> See above for output.

	  note: This error originates from a subprocess, and is likely not a problem with pip.
	  full command: /usr/local/src/displaycal_venv/bin/python -c '
	  exec(compile('"'"''"'"''"'"'
	  # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
	  #
	  # - It imports setuptools before invoking setup.py, to enable projects that directly
	  #   import from `distutils.core` to work with newer packaging standards.
	  # - It provides a clear error message when setuptools is not installed.
	  # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
	  #   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
	  #     manifest_maker: standard file '"'"'-c'"'"' not found".
	  # - It generates a shim setup.py, for handling setup.cfg-only projects.
	  import os, sys, tokenize

	  try:
	      import setuptools
	  except ImportError as error:
	      print(
	          "ERROR: Can not execute `setup.py` since setuptools is not available in "
	          "the build environment.",
	          file=sys.stderr,
	      )
	      sys.exit(1)

	  __file__ = %r
	  sys.argv[0] = __file__

	  if os.path.exists(__file__):
	      filename = __file__
	      with tokenize.open(__file__) as f:
	          setup_py_code = f.read()
	  else:
	      filename = "<auto-generated setuptools caller>"
	      setup_py_code = "from setuptools import setup; setup()"

	  exec(compile(setup_py_code, filename, "exec"))
	  '"'"''"'"''"'"' % ('"'"'/tmp/pip-install-oor5t868/wxpython_7b3c918bfe8546fb8046b2f991d236cd/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-17isxeiq
	  cwd: /tmp/pip-install-oor5t868/wxpython_7b3c918bfe8546fb8046b2f991d236cd/
	  Preparing metadata (setup.py) ... error
	error: metadata-generation-failed

	× Encountered error while generating package metadata.
	╰─> See above for output.

	note: This is an issue with the package mentioned above, not pip.
	hint: See above for details.

rpm -q --whatprovides /usr/lib64/python3.11/collections
	python3-libs-3.11.0-1.fc37.x86_64

pgnd avatar Dec 18 '22 22:12 pgnd

At irregular intervals we merge the dev with the main branch and release a pypi package. Do not install attrdict manually. You need attrdict3 for dependency reasons.

p5k369 avatar Dec 18 '22 23:12 p5k369