Coder Social home page Coder Social logo

Comments (6)

lucascolley avatar lucascolley commented on June 27, 2024

are you aware of a good alternative? What is there, other than removing the shebang and forcing people to use the python command?

from scipy.

bnavigator avatar bnavigator commented on June 27, 2024

I guess it is okay for people to use the shebang instead of using python generate_f2pymod.py. But the meson build should not do that on it's own.

Ideas:

  • Using a #!/usr/bin/env python3 shebang so that at least builds inside a venv do not use the system python3
  • reverting part of #20121 so that meson always uses the current runtime interpreter for the python script
  • having meson generate the script with the correct shebang from a generate_f2pymod.py.src and tempita.py (But that's a bit convoluted isn't it?

from scipy.

lucascolley avatar lucascolley commented on June 27, 2024

cc @rgommers

from scipy.

bnavigator avatar bnavigator commented on June 27, 2024

Hmm, when omitting the --no-build-isolation, meson actually does the right thing:

python3.12 -m pip -v wheel .
...
  Installing collected packages: ply, setuptools, pybind11, packaging, numpy, meson, gast, Cython, pyproject-metadata, beniget, pythran, meson-python
  Successfully installed Cython-3.0.10 beniget-0.4.1 gast-0.5.4 meson-1.4.0 meson-python-0.16.0 numpy-2.0.0rc1 packaging-24.0 ply-3.11 pybind11-2.12.0 pyproject-metadata-0.8.0 pythran-0.15.0 setuptools-69.5.1
...
  Running command Preparing metadata (pyproject.toml)
  + meson setup /scipy-1.13.0 /scipy-1.13.0/.mesonpy-wrowlhu5 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/scipy-1.13.0/.mesonpy-wrowlhu5/meson-python-native-file.ini
...
  Program python found: YES (/usr/bin/python3.12)
...
  Program tools/generate_f2pymod.py found: YES (/usr/bin/python3.12 /scipy-1.13.0/tools/generate_f2pymod.py)

Related: mesonbuild/meson-python#23

from scipy.

rgommers avatar rgommers commented on June 27, 2024

Ah, sorry about that - that's a regression indeed. For code generation scripts that don't need numpy/cython, the shebang is preferred. But for these cases that's wrong indeed.

That part of gh-20121 should be reverted. I'd like to think a bit more about:

  • whether to add a generator for f2py, so that the py3 doesn't need to be copied everywhere,
  • if it's possible to use the build (native) Python with f2py/cython rather than the host (cross) Python. Perhaps by invoking f2py rather than python -m f2py.

from scipy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.