File tree Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Expand file tree Collapse file tree 4 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 1- add_f2py_target(_hello _hello.pyf hello.f90)
2- add_library (_hello MODULE ${_hello} )
3- python_extension_module(_hello)
4-
1+ add_f2py_target(_hello _hello.pyf)
2+ add_library (_hello MODULE ${_hello} hello.f90)
53target_link_libraries (_hello ${F2PY_LIBRARIES} )
64target_include_directories (_hello PRIVATE ${F2PY_INCLUDE_DIRS} )
5+ python_extension_module(_hello)
76
87install (TARGETS _hello LIBRARY DESTINATION hello_f2py)
Original file line number Diff line number Diff line change 22! $ python -m numpy.f2py hello.f90 -m _hello -h _hello.pyf
33! and edit if helpful (see F2PY docs)
44subroutine hello (a )
5+ use , intrinsic :: iso_fortran_env
56 character (len=* ) :: a
6- print " (a)" , " Hello, " // a // " !"
7+ print ' (A)' , ' Hello, ' // a // ' !'
8+ flush(OUTPUT_UNIT)
79end subroutine hello
Original file line number Diff line number Diff line change @@ -7,12 +7,15 @@ authors = [
77]
88license = {text = " MIT" }
99requires-python = " >=3.7"
10+ dependencies = [
11+ " numpy" ,
12+ ]
1013
1114[build-system ]
1215requires = [
13- " setuptools>=42 " ,
14- " scikit-build>=0.13 " ,
15- " cmake>=3.18 " ,
16+ " setuptools" ,
17+ " scikit-build" ,
18+ " cmake" ,
1619 " ninja" ,
1720 " cython" ,
1821 " numpy" ,
Original file line number Diff line number Diff line change 11from hello_f2py import hello
22
3+
34def test_hello (capfd ):
4- #hello("World")
5- print ('Hello, World!' )
5+ hello ('World' )
66 captured = capfd .readouterr ()
7- assert captured .out == " Hello, World!\n "
7+ assert captured .out == ' Hello, World!\n '
You can’t perform that action at this time.
0 commit comments