forked from Urban-Meteorology-Reading/SUEWS
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Update test-meson workflow to exclude building wheels and setu…
…p tmate session for debugging
- Loading branch information
Showing
4 changed files
with
172 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,16 +65,16 @@ jobs: | |
meson setup build | ||
meson compile -C build | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
# SETUPTOOLS_USE_DISTUTILS: stdlib | ||
CC: gcc | ||
CXX: g++ | ||
with: | ||
# package-dir: ./src/supy | ||
output-dir: wheelhouse | ||
# config-file: ./src/supy/pyproject.toml | ||
# - name: Build wheels | ||
# uses: pypa/[email protected] | ||
# env: | ||
# # SETUPTOOLS_USE_DISTUTILS: stdlib | ||
# CC: gcc | ||
# CXX: g++ | ||
# with: | ||
# # package-dir: ./src/supy | ||
# output-dir: wheelhouse | ||
# # config-file: ./src/supy/pyproject.toml | ||
|
||
# - name: Setup tmate session for debugging | ||
# if: failure() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import subprocess | ||
import sys | ||
import os | ||
|
||
|
||
def main(): | ||
f2py_executable = sys.argv[1] # path to f2py or f2py part of numpy | ||
module_name = sys.argv[2] | ||
current_source_dir = sys.argv[3] | ||
output_dir = sys.argv[4] | ||
input_output_files = sys.argv[5:] | ||
input_files = input_output_files[0:-2] | ||
output_files = input_output_files[-2:] | ||
# output_files = sys.argv[5:] # List of output file paths | ||
|
||
# Call f2py to generate the modules | ||
try: | ||
subprocess.check_call( | ||
[ | ||
f2py_executable, | ||
"-m", | ||
module_name, | ||
*input_files, | ||
"--lower", | ||
] | ||
) | ||
print("f2py call successful") | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error calling f2py: {e}") | ||
return 1 | ||
|
||
# Move generated files to the output directory | ||
try: | ||
subprocess.check_call( | ||
[ | ||
"python", | ||
os.path.join(current_source_dir, "move_output_gen.py"), | ||
*output_files, | ||
output_dir, | ||
] | ||
) | ||
print("Output files moved successfully") | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error moving output files: {e}") | ||
return 1 | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import subprocess | ||
import sys | ||
import os | ||
|
||
|
||
def main(): | ||
f90wrap_executable = sys.argv[1] # path to f2py or f2py part of numpy | ||
module_name = sys.argv[2] | ||
current_source_dir = sys.argv[3] | ||
output_dir = sys.argv[4] | ||
input_output_files = sys.argv[5:] | ||
# only .fpp files are input files | ||
input_files = [f for f in input_output_files if f.endswith(".fpp")] | ||
# only .f90 files are output files | ||
output_files = [f for f in input_output_files if f.endswith(".f90")] | ||
# input_files = input_output_files[0:-2] | ||
# output_files = input_output_files[-2:] | ||
# output_files = sys.argv[5:] # List of output file paths | ||
|
||
# Call f2py to generate the modules | ||
try: | ||
subprocess.check_call( | ||
[ | ||
f90wrap_executable, | ||
"-m", | ||
module_name, | ||
*input_files, | ||
"-k", | ||
os.path.join(current_source_dir, "kind_map"), | ||
"--skip", | ||
"error_hint", | ||
] | ||
) | ||
print("f90wrap call successful") | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error calling f2py: {e}") | ||
return 1 | ||
|
||
# Move generated files to the output directory | ||
try: | ||
subprocess.check_call( | ||
[ | ||
"python", | ||
os.path.join(current_source_dir, "move_output_gen.py"), | ||
*output_files, | ||
output_dir, | ||
] | ||
) | ||
print("Output files moved successfully") | ||
except subprocess.CalledProcessError as e: | ||
print(f"Error moving output files: {e}") | ||
return 1 | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |