From e671fcfff8f8565deba18c10b3cd36e06fa99988 Mon Sep 17 00:00:00 2001 From: Joseph D Hughes Date: Thu, 15 Feb 2024 11:28:08 -0600 Subject: [PATCH 1/2] refactor(pymake): limit targets added to zip files to new files with --keep argument * remove ifort switches that issue warnings * write absolute zip file path if using --zip argument --- pymake/pymake.py | 21 ++++++++++++++++++--- pymake/utils/_compiler_switches.py | 3 --- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/pymake/pymake.py b/pymake/pymake.py index 22ab447..e79b3f3 100644 --- a/pymake/pymake.py +++ b/pymake/pymake.py @@ -58,6 +58,7 @@ import shutil import sys import time +from zipfile import ZipFile from .config import __description__ from .pymake_base import main @@ -267,18 +268,32 @@ def compress_targets(self): if self.verbose: print( "Appending files to existing " - + f"zipfile '{zip_pth}'" + + f"zipfile '{pl.Path(zip_pth).resolve()}'" ) + with ZipFile( + zip_pth, + mode="r", + ) as zf: + available_file_paths = zf.namelist() + pop_list = [] + for target in targets: + if target in available_file_paths: + pop_list.append(target) + for target in pop_list: + targets.remove(target) else: if self.verbose: - print(f"Deleting existing zipfile '{zip_pth}'") + print( + "Deleting existing zipfile " + + f"'{pl.Path(zip_pth).resolve()}'" + ) os.remove(zip_pth) # print a message describing the zip process if self.verbose: print( f"Compressing files in '{appdir}' " - + f"directory to zip file '{zip_pth}'" + + f"directory to zip file '{pl.Path(zip_pth).resolve()}'" ) for idx, target in enumerate(targets): print( diff --git a/pymake/utils/_compiler_switches.py b/pymake/utils/_compiler_switches.py index 21c7ad7..975d862 100644 --- a/pymake/utils/_compiler_switches.py +++ b/pymake/utils/_compiler_switches.py @@ -339,9 +339,6 @@ def _get_fortran_flags( "fpe:0", "traceback", "nologo", - "Qdiag-disable:7416", - "Qdiag-disable:7025", - "Qdiag-disable:5268", ] if debug: flags += ["debug:full", "Zi"] From 813e0823365b4a659f221d8761d43f61e457c63b Mon Sep 17 00:00:00 2001 From: Joseph D Hughes Date: Thu, 15 Feb 2024 11:34:34 -0600 Subject: [PATCH 2/2] * codeacy fix --- pymake/pymake.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymake/pymake.py b/pymake/pymake.py index e79b3f3..0c85933 100644 --- a/pymake/pymake.py +++ b/pymake/pymake.py @@ -279,8 +279,8 @@ def compress_targets(self): for target in targets: if target in available_file_paths: pop_list.append(target) - for target in pop_list: - targets.remove(target) + for target in pop_list: + targets.remove(target) else: if self.verbose: print(