Skip to content

Commit e2abf39

Browse files
jhbaarnhmandolaerik
authored andcommitted
Avoid dependency on liblzma
Not all Pythons are built with xz compression.
1 parent 3b8dcfa commit e2abf39

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Override the default compiler in unit tests.
8383
When set, DMLC does self-profiling and writes the profile to a .prof file.
8484

8585
### DMLC_DUMP_INPUT_FILES
86-
When set, DMLC emits a `.tar.xz` archive containing all DML source files,
86+
When set, DMLC emits a `.tar.bz2` archive containing all DML source files,
8787
packaged on a form that can be compiled standalone. This is useful when a DML
8888
problem appears within a complex build environment, and you want to reproduce
8989
the problem in isolation. In the created archive, all DML files are located in

py/dml/dmlc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def dump_input_files(outputbase, imported):
182182
prefix = '/'.join(['_'] * max_dotdot)
183183
# map basename to one of its absolute paths
184184
basenames: dict[str, str] = {}
185-
with tarfile.open(outputbase + ".tar.xz", 'w:xz') as tf:
185+
with tarfile.open(outputbase + ".tar.bz2", 'w:bz2') as tf:
186186
# HACK: if two different files foo.dml are imported, where one is
187187
# imported as "foo.dml" or "./foo.dml" and the other is only
188188
# imported using a qualified path such as "bar/foo.dml", then

test/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,8 @@ def test(self):
915915
super().test()
916916
dir = Path(self.scratchdir) / 'dumped'
917917
dir.mkdir()
918-
with tarfile.open(Path(self.scratchdir) / f'T_{self.shortname}.tar.xz',
919-
'r:xz') as tf:
918+
with tarfile.open(Path(self.scratchdir) / f'T_{self.shortname}.tar.bz2',
919+
'r:bz2') as tf:
920920
tf.extractall(dir)
921921
assert (dir.joinpath(*self.prefix)
922922
/ os.path.basename(self.filename)).is_file()

0 commit comments

Comments
 (0)