Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
charris merged 4 commits into
numpy:maintenance/1.18.xfrom
charris:backport-15106
Dec 15, 2019
Merged

ENH: f2py: add --f2cmap option for specifying the name of .f2py_f2cmap#15113
charris merged 4 commits into
numpy:maintenance/1.18.xfrom
charris:backport-15106

Conversation

@charris
Copy link
Copy Markdown
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