Skip to content

Commit

Permalink
Remove version generation for fortran code. Now done in configure bas…
Browse files Browse the repository at this point in the history
…h script.
  • Loading branch information
MilanSkocic committed Dec 26, 2024
1 parent 6c44763 commit ab90ddc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
30 changes: 0 additions & 30 deletions scripts/README.md

This file was deleted.

19 changes: 1 addition & 18 deletions scripts/gen_fortran.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,11 @@ def run(fpath_ast: str, fpath_code: str)->None:
fast.close()
fcode.close()

def write_version()->None:

version = None
with open("VERSION", "r") as f:
version = f.read().strip()

fobj = open('./src/codata_version.f90', "w")
fobj.write("module codata__version" + newline)
fobj.write(" !! Version" + newline)
fobj.write("implicit none" + newline)
fobj.write("private" + newline)
fobj.write(f"character(len=*), parameter :: version = \"{version:s}\"" + newline)
fobj.write("public :: version" + newline)
fobj.write("end module codata__version")
fobj.close


if __name__ == "__main__":
parser = argparse.ArgumentParser(prog='genfortran', description='Generate source code.')
parser.add_argument("ast", help="File path to the Toml file for ast input.")
parser.add_argument("code", help="File path to the source file for output.")
args = parser.parse_args()

run(args.ast, args.code)
write_version()
run(args.ast, args.code)

0 comments on commit ab90ddc

Please sign in to comment.