Skip to content

Update of setuptools in PR 1936 broke numpy 1.26.4 (does not affect release/2.1) #1942

@climbfuji

Description

@climbfuji

Description

The update of py-setuptools in PR #1936 to version 75 broke py-numpy@1.26.4. Apparently, this conflict is not captured in the spack recipe for py-numpy.

Fortunately, this PR was merged into develop after we cut the release/2.1 branch, thus it doesn't affect the release.

The (first?) error is generated by this line, typically found in setup.py files of Python projects:

from numpy.distutils.core import Extension, setup

The error:

  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 35, in <module>
        File "/gpfs/actions/dh/nep-eco-20260304-broken/lis-ncoda-utils/setup.py", line 2, in <module>
          from numpy.distutils.core import Extension, setup as numpy_setup
        File "/gpfs/neptune/spack-stack/spack-stack-dev-20260227/envs/ne-oneapi-2025.3.0/install/intel-oneapi-compilers/2025.3.0/py-numpy-1.26.4-u2hf3or/lib/python3.11/site-packages/numpy/distutils/__init__.py", line 26, in <module>
          from . import ccompiler
        File "/gpfs/neptune/spack-stack/spack-stack-dev-20260227/envs/ne-oneapi-2025.3.0/install/intel-oneapi-compilers/2025.3.0/py-numpy-1.26.4-u2hf3or/lib/python3.11/site-packages/numpy/distutils/ccompiler.py", line 11, in <module>
          from distutils.ccompiler import (
      ImportError: cannot import name 'compiler_class' from 'distutils.ccompiler' (/gpfs/neptune/spack-stack/spack-stack-dev-20260227/envs/ne-oneapi-2025.3.0/install/none/none/py-setuptools-75.9.1-lkuodpk/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py)
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.

[notice] A new release of pip is available: 25.1.1 -> 26.0.1
[notice] To update, run: python3 -m pip install --upgrade 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.

Possible solutions

  1. Revert Various minor updates to packages, site configs, Python scripts, README.md, ... #19, at least for now, and deal with the awscrt dependency issue. awscrt is arguably less important than numpy. What do we need awscrt for? I assume for the AWS CLI.
  2. Update numpy to a newer, compliant version. Which version? How many of our packages is this going to break? We pinned numpy to an older version for a reason.

In any case, we should determine the exact version conflicts for py-numpy w.r.t. py-setuptools and create PR in the upstream spack-packages, if not already there. Then bring that version conflict down to our fork.

To Reproduce

See above

Expected behavior

py-numpy and py-setuptools are compatible so that python setup.py works.

System, compiler, code, ...

NRL Atlantis, oneAPI 2025.3.0 stack.

Additional context

n/a

Metadata

Metadata

Labels

bugSomething is not working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions