|
1 | 1 | import os.path |
2 | | -import sys |
3 | | -import typing as ty |
4 | | -import tempfile |
5 | 2 | import tarfile |
| 3 | +import tempfile |
| 4 | +import typing as ty |
6 | 5 | import zipfile |
7 | 6 | from pathlib import Path |
| 7 | + |
8 | 8 | from pydra.compose import python |
9 | | -from fileformats.generic import FsObject |
10 | | -from fileformats.core.utils import set_cwd |
11 | | -from fileformats.core.typing import PathType |
12 | | -from fileformats.core import converter, FileSet |
13 | | -from fileformats.application import Zip, Tar, TarGzip |
14 | 9 |
|
| 10 | +from fileformats.application import Tar, TarGzip, Zip |
| 11 | +from fileformats.core import FileSet, converter |
| 12 | +from fileformats.core.typing import PathType |
| 13 | +from fileformats.core.utils import set_cwd |
| 14 | +from fileformats.generic import FsObject |
15 | 15 |
|
16 | 16 | TAR_COMPRESSION_TYPES = ["", "gz", "bz2", "xz"] |
17 | 17 |
|
@@ -162,23 +162,13 @@ def create_zip( |
162 | 162 |
|
163 | 163 | out_file = out_file.absolute() |
164 | 164 |
|
165 | | - zip_kwargs = {} |
166 | | - if not strict_timestamps: # Truthy is the default in earlier versions |
167 | | - if sys.version_info.major <= 3 and sys.version_info.minor < 8: |
168 | | - raise Exception( |
169 | | - "Must be using Python >= 3.8 to pass " |
170 | | - f"strict_timestamps={strict_timestamps!r}" |
171 | | - ) |
172 | | - |
173 | | - zip_kwargs["strict_timestamps"] = strict_timestamps |
174 | | - |
175 | 165 | with zipfile.ZipFile( |
176 | 166 | out_file, |
177 | 167 | mode="w", |
178 | 168 | compression=compression, |
179 | 169 | allowZip64=allowZip64, |
180 | 170 | compresslevel=compresslevel, |
181 | | - **zip_kwargs, |
| 171 | + strict_timestamps=strict_timestamps, |
182 | 172 | ) as zfile, set_cwd(base_dir): |
183 | 173 | for fspath in in_file.fspaths: |
184 | 174 | fspath = Path(fspath) |
|
0 commit comments