| 15 | |
| 16 | |
| 17 | def find_f2py_commands(): |
| 18 | if sys.platform == 'win32': |
| 19 | exe_dir = dirname(sys.executable) |
| 20 | if exe_dir.endswith('Scripts'): # virtualenv |
| 21 | return [os.path.join(exe_dir, 'f2py')] |
| 22 | else: |
| 23 | return [os.path.join(exe_dir, "Scripts", 'f2py')] |
| 24 | else: |
| 25 | # Three scripts are installed in Unix-like systems: |
| 26 | # 'f2py', 'f2py{major}', and 'f2py{major.minor}'. For example, |
| 27 | # if installed with python3.9 the scripts would be named |
| 28 | # 'f2py', 'f2py3', and 'f2py3.9'. |
| 29 | version = sys.version_info |
| 30 | major = str(version.major) |
| 31 | minor = str(version.minor) |
| 32 | return ['f2py', 'f2py' + major, 'f2py' + major + '.' + minor] |
| 33 | |
| 34 | |
| 35 | @pytest.mark.skipif(is_inplace, reason="Cannot test f2py command inplace") |