has2k1 / scikit-misc

Miscellaneous tools for data analysis and scientific computing
https://has2k1.github.io/scikit-misc/stable
BSD 3-Clause "New" or "Revised" License
39 stars 9 forks source link

`meson setup` fails for 0.3.0 #27

Closed penguinpee closed 9 months ago

penguinpee commented 1 year ago

I went about updating scikit-misc for Fedora to 0.3.0. During the build I hit the following error:

  ../skmisc/meson.build:22:15: ERROR: Command `/usr/bin/python3 -c 'import os
  os.chdir(os.path.join("..", "tools"))
  import numpy as np
  try:
    incdir = os.path.relpath(np.get_include())
  except Exception:
    incdir = np.get_include()
  print(incdir)
  '` failed with status 1.

NumPy is at version 1.24.4 currently and meson-python at version 0.14.0.

has2k1 commented 1 year ago

I think for some reason /usr/bin/python3 is called within an environment that does not have numpy.

has2k1 commented 1 year ago

I have been able to build it on python-3.12.0rc2 with numpy-1.26.0rc1 since that verson is pip installable.

penguinpee commented 1 year ago

I think for some reason /usr/bin/python3 is called within an environment that does not have numpy.

That's possible. Let me check the build log again. It's an inline script called from meson setup. Depending on which stage that script is run, the build environment may not have been fully populated.

penguinpee commented 1 year ago

The error happens in the %build stage. Before that stage all dependencies are resolved and installed. And numpy is mentioned as being satisfied:

Handling numpy; python_version>='3.12' from build-system.requires
Requirement satisfied: numpy; python_version>='3.12'
   (installed: numpy 1.24.4)

I tried running the steps in the script manually. Lo and behold, it's not numpy that fails, but os.chdir. There is no directory ../tools. I've used the PyPI tarball for building. I vaguely remember stumbling upon some issues related to differences between PyPI and GitHub archive before. I will switch to the GitHub release now.

penguinpee commented 1 year ago

Package builds fine using the GitHub tarball. I'll stick with that from now on.

has2k1 commented 1 year ago

I tried running the steps in the script manually. Lo and behold, it's not numpy that fails, but os.chdir. There is no directory ../tools. I've used the PyPI tarball for building.

I will track that down.

has2k1 commented 9 months ago

This issue was fixed in v0.3.1.