mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
On behalf of Tarek: Issue #11501: disutils.archive_utils.make_zipfile no
longer fails if zlib is not installed. Instead, the zipfile.ZIP_STORED compression is used to create the ZipFile. Patch by Natalia B. Bidart.
This commit is contained in:
parent
7dedcb4644
commit
2c50a09ac4
7 changed files with 110 additions and 12 deletions
|
|
@ -40,6 +40,13 @@ somecode%(sep)sdoc.dat
|
|||
somecode%(sep)sdoc.txt
|
||||
"""
|
||||
|
||||
try:
|
||||
import zlib
|
||||
ZLIB_SUPPORT = True
|
||||
except ImportError:
|
||||
ZLIB_SUPPORT = False
|
||||
|
||||
|
||||
class SDistTestCase(PyPIRCCommandTestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
@ -78,6 +85,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
cmd.warn = _warn
|
||||
return dist, cmd
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_prune_file_list(self):
|
||||
# this test creates a package with some vcs dirs in it
|
||||
# and launch sdist to make sure they get pruned
|
||||
|
|
@ -119,6 +127,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
# making sure everything has been pruned correctly
|
||||
self.assertEqual(len(content), 4)
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_make_distribution(self):
|
||||
|
||||
# check if tar and gzip are installed
|
||||
|
|
@ -153,6 +162,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
result.sort()
|
||||
self.assertEqual(result, ['fake-1.0.tar', 'fake-1.0.tar.gz'])
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_add_defaults(self):
|
||||
|
||||
# http://bugs.python.org/issue2279
|
||||
|
|
@ -218,6 +228,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
finally:
|
||||
f.close()
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_metadata_check_option(self):
|
||||
# testing the `medata-check` option
|
||||
dist, cmd = self.get_cmd(metadata={})
|
||||
|
|
@ -277,7 +288,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
cmd.formats = 'supazipa'
|
||||
self.assertRaises(DistutilsOptionError, cmd.finalize_options)
|
||||
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_get_file_list(self):
|
||||
# make sure MANIFEST is recalculated
|
||||
dist, cmd = self.get_cmd()
|
||||
|
|
@ -318,6 +329,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
self.assertEqual(len(manifest2), 6)
|
||||
self.assertIn('doc2.txt', manifest2[-1])
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_manifest_marker(self):
|
||||
# check that autogenerated MANIFESTs have a marker
|
||||
dist, cmd = self.get_cmd()
|
||||
|
|
@ -334,6 +346,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
self.assertEqual(manifest[0],
|
||||
'# file GENERATED by distutils, do NOT edit')
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_manual_manifest(self):
|
||||
# check that a MANIFEST without a marker is left alone
|
||||
dist, cmd = self.get_cmd()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue