Skip to content

Commit 5abcd34

Browse files
committed
pass strict_timestamps through directly
1 parent a005736 commit 5abcd34

File tree

2 files changed

+9
-21
lines changed

2 files changed

+9
-21
lines changed

.github/workflows/ci-cd.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ jobs:
4747
run: python3 -m pip install -e .[test]
4848
- name: Install Extras Package
4949
run: python3 -m pip install -e ./extras[test,application,image,vendor_openxmlformats_officedocument]
50-
- name: Install missing types
51-
run: python3 -m pip install types-PyYAML
5250
- name: MyPy
5351
run: mypy --install-types --non-interactive --no-warn-unused-ignores --python-version "${{ matrix.python-version }}" .
5452
- name: Pytest

extras/fileformats/extras/application/archive.py

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import os.path
2-
import sys
3-
import typing as ty
4-
import tempfile
52
import tarfile
3+
import tempfile
4+
import typing as ty
65
import zipfile
76
from pathlib import Path
7+
88
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
149

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
1515

1616
TAR_COMPRESSION_TYPES = ["", "gz", "bz2", "xz"]
1717

@@ -162,23 +162,13 @@ def create_zip(
162162

163163
out_file = out_file.absolute()
164164

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-
175165
with zipfile.ZipFile(
176166
out_file,
177167
mode="w",
178168
compression=compression,
179169
allowZip64=allowZip64,
180170
compresslevel=compresslevel,
181-
**zip_kwargs,
171+
strict_timestamps=strict_timestamps,
182172
) as zfile, set_cwd(base_dir):
183173
for fspath in in_file.fspaths:
184174
fspath = Path(fspath)

0 commit comments

Comments
 (0)