File tree 4 files changed +15
-11
lines changed
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)
5
3
target_link_libraries (_hello ${F2PY_LIBRARIES} )
6
4
target_include_directories (_hello PRIVATE ${F2PY_INCLUDE_DIRS} )
5
+ python_extension_module(_hello)
7
6
8
7
install (TARGETS _hello LIBRARY DESTINATION hello_f2py)
Original file line number Diff line number Diff line change 2
2
! $ python -m numpy.f2py hello.f90 -m _hello -h _hello.pyf
3
3
! and edit if helpful (see F2PY docs)
4
4
subroutine hello (a )
5
+ use , intrinsic :: iso_fortran_env
5
6
character (len=* ) :: a
6
- print " (a)" , " Hello, " // a // " !"
7
+ print ' (A)' , ' Hello, ' // a // ' !'
8
+ flush(OUTPUT_UNIT)
7
9
end subroutine hello
Original file line number Diff line number Diff line change @@ -7,12 +7,15 @@ authors = [
7
7
]
8
8
license = {text = " MIT" }
9
9
requires-python = " >=3.7"
10
+ dependencies = [
11
+ " numpy" ,
12
+ ]
10
13
11
14
[build-system ]
12
15
requires = [
13
- " setuptools>=42 " ,
14
- " scikit-build>=0.13 " ,
15
- " cmake>=3.18 " ,
16
+ " setuptools" ,
17
+ " scikit-build" ,
18
+ " cmake" ,
16
19
" ninja" ,
17
20
" cython" ,
18
21
" numpy" ,
Original file line number Diff line number Diff line change 1
1
from hello_f2py import hello
2
2
3
+
3
4
def test_hello (capfd ):
4
- #hello("World")
5
- print ('Hello, World!' )
5
+ hello ('World' )
6
6
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