-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a script that builds release sources
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 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 |
---|---|---|
|
@@ -134,3 +134,4 @@ input.py.dat | |
*.cube | ||
dfh.* | ||
*.npz | ||
*.zip |
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,41 @@ | ||
import gau2grid as gg | ||
from pathlib import Path | ||
import os | ||
import zipfile | ||
import tempfile | ||
import shutil | ||
|
||
am_list = [6, 8] | ||
|
||
for am in am_list: | ||
|
||
folder = f"gau2grid-am{am}-{gg.__version__}" | ||
zip_filename = folder + '.zip' | ||
zipf = zipfile.ZipFile(zip_filename, 'w', zipfile.ZIP_DEFLATED) | ||
|
||
path = Path(folder) | ||
path.mkdir(parents=True) | ||
gg.c_gen.generate_c_gau2grid(am, path=path.resolve()) | ||
|
||
for filename in path.iterdir(): | ||
zipf.write(filename) | ||
|
||
shutil.rmtree(path.resolve()) | ||
|
||
# with tempfile.TemporaryDirectory() as tmp: | ||
# os.chdir(tmp) | ||
# | ||
# folder = f"gau2grid-am{am}-{gg.__version__}" | ||
# zip_filename = folder + '.zip' | ||
# zip_path = os.path.join(tmp, zip_filename) | ||
# zipf = zipfile.ZipFile(zip_path, 'w', zipfile.ZIP_DEFLATED) | ||
# | ||
# path = Path(tmp) / folder | ||
# path.mkdir(parents=True) | ||
# gg.c_gen.generate_c_gau2grid(am, path=path.resolve()) | ||
# | ||
# for filename in path.iterdir(): | ||
# arcname = os.path.join(*str(filename).split(os.path.sep)[-2:]) | ||
# print(filename, arcname) | ||
# zipf.write(filename, arcname=arcname) | ||
# |