classification
Title: add xz compression support to shutil
Type: enhancement Stage: needs patch
Components: Library (Lib) Versions: Python 3.3
process
Status: open Resolution:
Dependencies: Support xz compression in tarfile module
View: 5689
Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, nadeem.vawda, proyvind, tarek
Priority: normal Keywords: patch

Created on 2009-03-03 11:56 by proyvind, last changed 2012-02-11 18:28 by nadeem.vawda.

Files
File name Uploaded Description Edit
shutil-xz.diff eric.araujo, 2012-02-06 17:11 review
Messages (10)
msg83072 - (view) Author: Per Øyvind Karlsen (proyvind) Date: 2009-03-03 11:56
Here's a patch that adds support for xz compression:
http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/python/current/SOURCES/Python-2.6.1-distutils-xz-support.patch?view=log
msg83263 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-03-07 00:56
Good idea !

are you able provide a unit test for the changes made into the two
commands ?
msg83401 - (view) Author: Per Øyvind Karlsen (proyvind) Date: 2009-03-09 20:12
hmm, I'm unsure about how this should be done..


I guess such a test would belong in Lib/distutils/test_dist.py, but I'm
uncertain about how it should be done, ie. should it be a test for doing
'bdist', 'bdist_rpm' and 'sdist' for each of the formats supported? I
cannot seem to find any tests for the currently supported formats and
such tests would introduce dependencies on the tools used to compress
with these formats..
msg83404 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-03-09 21:07
> I guess such a test would belong in Lib/distutils/test_dist.py

no, rather in test_bdist_rpm, test_sdist and so on,
but I can do it, it'll just take more time.
msg111038 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-07-21 12:06
distutils2 uses tarfile now instead of external programs. Adding dependency on another bug.
msg115780 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-09-07 15:38
FTR, the distutils2 repo is http://bitbucket.org/tarek/distutils2. distutils2.tests.support contains helper to create temp directories and run commands; see docstrings and example uses in the tests for more info.
msg148660 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-11-30 15:12
distutils2/packaging now just uses the shutil functions.  I’ll make a patch for shutil after tarfile is updated.
msg152748 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-06 17:11
This not-so-bad patch adds lzma compression support to the shutil functions, under the 'xztar' name.  Please review.
msg152749 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-06 17:16
I should add that a doc update will be part of the next patch.

In parallel, I’ve also started updating packaging to add lzma support to the bdist command, but the situation is very disappointing: tarfile knows what format it supports, shutil has its own list, and packaging has a few duplicates too!  Ideally, tarfile should have an attribute to expose what compression formats are available, then shutil would reuse that, and packaging would just call shutil.  (I’m not even talking about the duplication in the doc.)  If you agree with the general idea, I’ll open reports to a) add the attribute to tarfile b) rework the (luckily internal) registries in shutil to stop being hard-coded c) remove packaging’s registries.
msg153131 - (view) Author: Nadeem Vawda (nadeem.vawda) * (Python committer) Date: 2012-02-11 18:28
> This not-so-bad patch adds lzma compression support to the shutil functions, under the 'xztar' name.  Please review.

Functionally, the patch looks good to me. There are some docstrings that
should probably be updated, though:

- _make_tarball (the 'compress' argument)
- make_archive
- _unpack_tarfile
- unpack_archive


> Ideally, tarfile should have an attribute to expose what compression formats are available, then shutil would reuse that, and packaging would just call shutil.

+1
History
Date User Action Args
2012-02-11 18:28:32nadeem.vawdasetmessages: + msg153131
2012-02-06 17:16:11eric.araujosetmessages: + msg152749
2012-02-06 17:11:38eric.araujosetfiles: + shutil-xz.diff

messages: + msg152748
2011-11-30 15:19:07nadeem.vawdasetnosy: + nadeem.vawda
2011-11-30 15:12:08eric.araujosetversions: + Python 3.3, - 3rd party
title: add xz compression support to distutils -> add xz compression support to shutil
messages: + msg148660

assignee: tarek -> eric.araujo
components: + Library (Lib), - Distutils2
2010-09-29 23:58:50eric.araujosetversions: + 3rd party, - Python 2.6, Python 2.5, Python 3.1, Python 2.7, Python 3.2
2010-09-07 15:38:35eric.araujosetmessages: + msg115780
2010-07-21 12:06:34eric.araujosetdependencies: + Support xz compression in tarfile module
messages: + msg111038
stage: test needed -> needs patch
versions: + Python 2.6, Python 2.5, Python 3.2
2010-04-09 07:44:48tareksetnosy: tarek, eric.araujo, proyvind
components: + Distutils2, - Distutils
2010-04-09 01:39:23eric.araujosetnosy: + eric.araujo
2009-03-09 21:07:06tareksetmessages: + msg83404
2009-03-09 20:12:58proyvindsetmessages: + msg83401
2009-03-07 00:56:06tareksetpriority: normal
keywords: + patch
versions: + Python 3.1, Python 2.7, - Python 2.6
messages: + msg83263
stage: test needed
2009-03-03 11:56:24proyvindcreate