kif / multianalyzer

Rebinning of powder diffraction data taken with multiple analyzer crystals and a large area detector
MIT License
0 stars 2 forks source link

Issue when building `multianalyzer` in bliss environment #18

Closed kif closed 10 months ago

kif commented 1 year ago
(ewoksworker) blissadm@diffract22new:~/local/ewoks/multianalyzer.git$ pip install .
Processing /home/blissadm/local/ewoks/multianalyzer.git
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [45 lines of output]
      INFO:multianalyzer.setup:Use distutils with cython
      INFO:multianalyzer.setup:Install requires: numpy >=1.17.3
      Unable to use setuptools, <class 'ImportError'>: cannot import name 'build_py' from 'setuptools._distutils.command' (/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/__init__.py)
      Traceback (most recent call last):
        File "/users/blissadm/conda/miniconda/envs/ewoksworker/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/users/blissadm/conda/miniconda/envs/ewoksworker/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/users/blissadm/conda/miniconda/envs/ewoksworker/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 174, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 1037, in <module>
          setup_package()
        File "setup.py", line 1032, in setup_package
          setup_kwargs = get_project_configuration(dry_run)
        File "setup.py", line 967, in get_project_configuration
          config = configuration()
        File "setup.py", line 438, in configuration
          config.add_subpackage(PROJECT)
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 1033, in add_subpackage
          config_list = self.get_subpackage(subpackage_name, subpackage_path,
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 999, in get_subpackage
          config = self._get_configuration_from_setup_py(
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 941, in _get_configuration_from_setup_py
          config = setup_module.configuration(*args)
        File "multianalyzer/setup.py", line 76, in configuration
          config.add_extension(**ext_config)
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/numpy/distutils/misc_util.py", line 1518, in add_extension
          from numpy.distutils.core import Extension
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/numpy/distutils/core.py", line 10, in <module>
          from setuptools.command import easy_install
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py", line 52, in <module>
          from setuptools.package_index import (
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/package_index.py", line 29, in <module>
          from setuptools.wheel import Wheel
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/wheel.py", line 17, in <module>
          from setuptools.command.egg_info import write_requirements
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/command/egg_info.py", line 21, in <module>
          from setuptools.command.sdist import sdist
        File "/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/command/sdist.py", line 2, in <module>
          import distutils.command.sdist as orig
      ImportError: cannot import name 'sdist' from 'setuptools._distutils.command' (/tmp/pip-build-env-dvogfiov/overlay/lib/python3.8/site-packages/setuptools/_distutils/command/__init__.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
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.

Submitted by @woutdenolf

kif commented 1 year ago

I can reproduce the bug. Nevertheless: python -m build works and produces viable wheels and source tarballs. This is already a work-around.