You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
f2py: pyf file mentioned in sources of an Extension is not added to source distribution #19441
In my project, I have an extension generated from Fortran source code. The generated pyf file needed to be tweaked a bit, and must therefore be treated as a source file as well.
Problem is that, although the pyf file is mentioned as a source file in the Extension, it is not packaged in the source distribution. As, a result, when you try to install from the source tar-ball, the build will fail.
Reproducing code example:
The error cannot be reproduced with a single python file. I created a small demo project that reproduces the error. See https://github.com/gmloose/f2py_hello.
The README.md file describes the steps you have to take in order to reproduce the error.
Error message:
If you follow the steps in the README.md file, you will see the following error message:
build_src
building extension "hello._hello" sources
target build/src.linux-x86_64-3.6/hello/_hellomodule.c does not exist:
Assuming _hellomodule.c was generated with "build_src --inplace" command.
error: 'hello/_hellomodule.c' missing
ERROR Backend subproccess exited when trying to invoke get_requires_for_build_wheel
Note that this is the latest numpy version that supports Python 3.6. It was automatically installed in the virtual environment when I installed my demo project.
This solves the issue of having the pyf file in the binary distribution. But it is still a workaround. I think the real issue is in the way Numpy's Extension handles pyf files mentioned as sources, which IMHO is a bug. It shouldn't be necessary to manually add the pyf file to either MANIFEST.in or as package_data argument to setup().
Activity
pearu commentedon Jul 9, 2021
As a workaround, try including the pyf file in
MANIFEST.infile.gmloose commentedon Jul 9, 2021
This solves the issue of having the
pyffile in the binary distribution. But it is still a workaround. I think the real issue is in the way Numpy'sExtensionhandlespyffiles mentioned assources, which IMHO is a bug. It shouldn't be necessary to manually add thepyffile to eitherMANIFEST.inor aspackage_dataargument tosetup().pearu commentedon Jul 9, 2021
Yes, it is a bug: the
pyffiles should always be considered source files.gmloose commentedon Jan 21, 2022
Any idea when this will be fixed?
HaoZeke commentedon Nov 20, 2023
Closing as distutils isn't supported anymore. Please use
meson-pythonwith themesonbackend.