Skip to content

ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmap #15113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 15, 2019

Conversation

charris
Copy link
Member

@charris charris commented Dec 15, 2019

Backport of #15106.

Previously, f2py loaded the type mappings from a file .f2py_f2cmap
in current directory, at import time.

Make the file name customizable by adding a --f2cmap command line
option, and postpone loading the file to f2py.run_main().

Restore the default type mapping in f2py.run_main() before
loading the customizations, so that multiple calls to f2py.run_main() do
not interfere with each other. (For example, numpy.distutils calls f2py
multiple times in the same process.)

Moreover, add documentation for the .f2py_f2cmap file (copypasted
from the old f2py FAQ on archive.org), and fix a race condition bug in
the f2py test suite which caused the tests to sometimes not be run
when using pytest-xdist.

cc @pearu

Closes: gh-15096

pv added 4 commits December 15, 2019 13:37
Previously, f2py loaded the type mappings from a file ``.f2py_f2cmap``
in current directory, at import time.

Make the file name customizable by adding a ``--f2cmap`` command line
option, and postpone loading the file to f2py.run_main().

Moreover, restore the default type mapping in f2py.run_main() before
loading the customizations, so that multiple calls to f2py.run_main() do
not interfere with each other. (For example, numpy.distutils calls f2py
multiple times in the same process.)
Distutils code needs to run in different temporary directories, probably
because they create `_configtest.c` files for compiler detection in the
current directory.
@charris charris added this to the 1.18.0 release milestone Dec 15, 2019
@charris charris merged commit ed41774 into numpy:maintenance/1.18.x Dec 15, 2019
@charris charris deleted the backport-15106 branch December 15, 2019 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants