Remove obsolete mentions of the compress program and .Z archives.
Packaging uses the shutil.make_archive function copied from distutils, which does not support compress. There is no test to check that “bdist --format whatever” works, so this slipped by.
This commit is contained in:
parent
ff29ff8831
commit
83ab3f319b
|
@ -75,9 +75,6 @@ The available formats for built distributions are:
|
||||||
| ``gztar`` | gzipped tar file | (1),(3) |
|
| ``gztar`` | gzipped tar file | (1),(3) |
|
||||||
| | (:file:`.tar.gz`) | |
|
| | (:file:`.tar.gz`) | |
|
||||||
+-------------+------------------------------+---------+
|
+-------------+------------------------------+---------+
|
||||||
| ``ztar`` | compressed tar file | \(3) |
|
|
||||||
| | (:file:`.tar.Z`) | |
|
|
||||||
+-------------+------------------------------+---------+
|
|
||||||
| ``tar`` | tar file (:file:`.tar`) | \(3) |
|
| ``tar`` | tar file (:file:`.tar`) | \(3) |
|
||||||
+-------------+------------------------------+---------+
|
+-------------+------------------------------+---------+
|
||||||
| ``zip`` | zip file (:file:`.zip`) | (2),(4) |
|
| ``zip`` | zip file (:file:`.zip`) | (2),(4) |
|
||||||
|
@ -98,8 +95,8 @@ Notes:
|
||||||
default on Windows
|
default on Windows
|
||||||
|
|
||||||
(3)
|
(3)
|
||||||
requires external utilities: :program:`tar` and possibly one of :program:`gzip`,
|
requires external utilities: :program:`tar` and possibly one of :program:`gzip`
|
||||||
:program:`bzip2`, or :program:`compress`
|
or :program:`bzip2`
|
||||||
|
|
||||||
(4)
|
(4)
|
||||||
requires either external :program:`zip` utility or :mod:`zipfile` module (part
|
requires either external :program:`zip` utility or :mod:`zipfile` module (part
|
||||||
|
@ -109,14 +106,14 @@ You don't have to use the :command:`bdist` command with the :option:`--formats`
|
||||||
option; you can also use the command that directly implements the format you're
|
option; you can also use the command that directly implements the format you're
|
||||||
interested in. Some of these :command:`bdist` "sub-commands" actually generate
|
interested in. Some of these :command:`bdist` "sub-commands" actually generate
|
||||||
several similar formats; for instance, the :command:`bdist_dumb` command
|
several similar formats; for instance, the :command:`bdist_dumb` command
|
||||||
generates all the "dumb" archive formats (``tar``, ``ztar``, ``gztar``, and
|
generates all the "dumb" archive formats (``tar``, ``gztar``, and
|
||||||
``zip``). The :command:`bdist` sub-commands, and the formats generated by
|
``zip``). The :command:`bdist` sub-commands, and the formats generated by
|
||||||
each, are:
|
each, are:
|
||||||
|
|
||||||
+--------------------------+-----------------------+
|
+--------------------------+-----------------------+
|
||||||
| Command | Formats |
|
| Command | Formats |
|
||||||
+==========================+=======================+
|
+==========================+=======================+
|
||||||
| :command:`bdist_dumb` | tar, ztar, gztar, zip |
|
| :command:`bdist_dumb` | tar, gztar, zip |
|
||||||
+--------------------------+-----------------------+
|
+--------------------------+-----------------------+
|
||||||
| :command:`bdist_wininst` | wininst |
|
| :command:`bdist_wininst` | wininst |
|
||||||
+--------------------------+-----------------------+
|
+--------------------------+-----------------------+
|
||||||
|
|
|
@ -32,9 +32,6 @@ to create a gzipped tarball and a zip file. The available formats are:
|
||||||
| ``bztar`` | bzip2'ed tar file | |
|
| ``bztar`` | bzip2'ed tar file | |
|
||||||
| | (:file:`.tar.bz2`) | |
|
| | (:file:`.tar.bz2`) | |
|
||||||
+-----------+-------------------------+---------+
|
+-----------+-------------------------+---------+
|
||||||
| ``ztar`` | compressed tar file | \(4) |
|
|
||||||
| | (:file:`.tar.Z`) | |
|
|
||||||
+-----------+-------------------------+---------+
|
|
||||||
| ``tar`` | tar file (:file:`.tar`) | |
|
| ``tar`` | tar file (:file:`.tar`) | |
|
||||||
+-----------+-------------------------+---------+
|
+-----------+-------------------------+---------+
|
||||||
|
|
||||||
|
@ -50,11 +47,7 @@ Notes:
|
||||||
requires either external :program:`zip` utility or :mod:`zipfile` module (part
|
requires either external :program:`zip` utility or :mod:`zipfile` module (part
|
||||||
of the standard Python library since Python 1.6)
|
of the standard Python library since Python 1.6)
|
||||||
|
|
||||||
(4)
|
When using any ``tar`` format (``gztar``, ``bztar`` or
|
||||||
requires the :program:`compress` program. Notice that this format is now
|
|
||||||
pending for deprecation and will be removed in the future versions of Python.
|
|
||||||
|
|
||||||
When using any ``tar`` format (``gztar``, ``bztar``, ``ztar`` or
|
|
||||||
``tar``) under Unix, you can specify the ``owner`` and ``group`` names
|
``tar``) under Unix, you can specify the ``owner`` and ``group`` names
|
||||||
that will be set for each member of the archive.
|
that will be set for each member of the archive.
|
||||||
|
|
||||||
|
|
|
@ -64,20 +64,18 @@ class bdist(Command):
|
||||||
'os2': 'zip'}
|
'os2': 'zip'}
|
||||||
|
|
||||||
# Establish the preferred order (for the --help-formats option).
|
# Establish the preferred order (for the --help-formats option).
|
||||||
format_commands = ['gztar', 'bztar', 'ztar', 'tar',
|
format_commands = ['gztar', 'bztar', 'tar',
|
||||||
'wininst', 'zip', 'msi']
|
'wininst', 'zip', 'msi']
|
||||||
|
|
||||||
# And the real information.
|
# And the real information.
|
||||||
format_command = {'gztar': ('bdist_dumb', "gzip'ed tar file"),
|
format_command = {'gztar': ('bdist_dumb', "gzip'ed tar file"),
|
||||||
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
|
'bztar': ('bdist_dumb', "bzip2'ed tar file"),
|
||||||
'ztar': ('bdist_dumb', "compressed tar file"),
|
|
||||||
'tar': ('bdist_dumb', "tar file"),
|
'tar': ('bdist_dumb', "tar file"),
|
||||||
'wininst': ('bdist_wininst',
|
'wininst': ('bdist_wininst',
|
||||||
"Windows executable installer"),
|
"Windows executable installer"),
|
||||||
'zip': ('bdist_dumb', "ZIP file"),
|
'zip': ('bdist_dumb', "ZIP file"),
|
||||||
'msi': ('bdist_msi', "Microsoft Installer")
|
'msi': ('bdist_msi', "Microsoft Installer"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
self.bdist_base = None
|
self.bdist_base = None
|
||||||
|
@ -109,8 +107,9 @@ class bdist(Command):
|
||||||
try:
|
try:
|
||||||
self.formats = [self.default_format[os.name]]
|
self.formats = [self.default_format[os.name]]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise PackagingPlatformError("don't know how to create built distributions " + \
|
raise PackagingPlatformError(
|
||||||
"on platform %s" % os.name)
|
"don't know how to create built distributions "
|
||||||
|
"on platform %s" % os.name)
|
||||||
|
|
||||||
if self.dist_dir is None:
|
if self.dist_dir is None:
|
||||||
self.dist_dir = "dist"
|
self.dist_dir = "dist"
|
||||||
|
|
|
@ -13,6 +13,7 @@ from packaging.command.cmd import Command
|
||||||
from packaging.errors import PackagingPlatformError
|
from packaging.errors import PackagingPlatformError
|
||||||
from packaging import logger
|
from packaging import logger
|
||||||
|
|
||||||
|
|
||||||
class bdist_dumb(Command):
|
class bdist_dumb(Command):
|
||||||
|
|
||||||
description = 'create a "dumb" built distribution'
|
description = 'create a "dumb" built distribution'
|
||||||
|
@ -23,7 +24,7 @@ class bdist_dumb(Command):
|
||||||
"platform name to embed in generated filenames "
|
"platform name to embed in generated filenames "
|
||||||
"(default: %s)" % get_platform()),
|
"(default: %s)" % get_platform()),
|
||||||
('format=', 'f',
|
('format=', 'f',
|
||||||
"archive format to create (tar, ztar, gztar, zip)"),
|
"archive format to create (tar, gztar, zip)"),
|
||||||
('keep-temp', 'k',
|
('keep-temp', 'k',
|
||||||
"keep the pseudo-installation tree around after " +
|
"keep the pseudo-installation tree around after " +
|
||||||
"creating the distribution archive"),
|
"creating the distribution archive"),
|
||||||
|
@ -44,10 +45,9 @@ class bdist_dumb(Command):
|
||||||
|
|
||||||
boolean_options = ['keep-temp', 'skip-build', 'relative']
|
boolean_options = ['keep-temp', 'skip-build', 'relative']
|
||||||
|
|
||||||
default_format = { 'posix': 'gztar',
|
default_format = {'posix': 'gztar',
|
||||||
'nt': 'zip',
|
'nt': 'zip',
|
||||||
'os2': 'zip' }
|
'os2': 'zip'}
|
||||||
|
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
self.bdist_dir = None
|
self.bdist_dir = None
|
||||||
|
@ -69,8 +69,9 @@ class bdist_dumb(Command):
|
||||||
try:
|
try:
|
||||||
self.format = self.default_format[os.name]
|
self.format = self.default_format[os.name]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise PackagingPlatformError(("don't know how to create dumb built distributions " +
|
raise PackagingPlatformError(
|
||||||
"on platform %s") % os.name)
|
"don't know how to create dumb built distributions "
|
||||||
|
"on platform %s" % os.name)
|
||||||
|
|
||||||
self.set_undefined_options('bdist', 'dist_dir', 'plat_name')
|
self.set_undefined_options('bdist', 'dist_dir', 'plat_name')
|
||||||
|
|
||||||
|
|
|
@ -27,33 +27,30 @@ class BuildTestCase(support.TempdirManager,
|
||||||
util.get_platform = self._get_platform
|
util.get_platform = self._get_platform
|
||||||
|
|
||||||
def test_formats(self):
|
def test_formats(self):
|
||||||
|
|
||||||
# let's create a command and make sure
|
# let's create a command and make sure
|
||||||
# we can fix the format
|
# we can set the format
|
||||||
pkg_pth, dist = self.create_dist()
|
dist = self.create_dist()[1]
|
||||||
cmd = bdist(dist)
|
cmd = bdist(dist)
|
||||||
cmd.formats = ['msi']
|
cmd.formats = ['msi']
|
||||||
cmd.ensure_finalized()
|
cmd.ensure_finalized()
|
||||||
self.assertEqual(cmd.formats, ['msi'])
|
self.assertEqual(cmd.formats, ['msi'])
|
||||||
|
|
||||||
# what format bdist offers ?
|
# what format does bdist offer?
|
||||||
# XXX an explicit list in bdist is
|
# XXX hard-coded lists are not the best way to find available bdist_*
|
||||||
# not the best way to bdist_* commands
|
# commands; we should add a registry
|
||||||
# we should add a registry
|
formats = ['bztar', 'gztar', 'msi', 'tar', 'wininst', 'zip']
|
||||||
formats = sorted(('zip', 'gztar', 'bztar', 'ztar',
|
|
||||||
'tar', 'wininst', 'msi'))
|
|
||||||
found = sorted(cmd.format_command)
|
found = sorted(cmd.format_command)
|
||||||
self.assertEqual(found, formats)
|
self.assertEqual(found, formats)
|
||||||
|
|
||||||
def test_skip_build(self):
|
def test_skip_build(self):
|
||||||
pkg_pth, dist = self.create_dist()
|
dist = self.create_dist()[1]
|
||||||
cmd = bdist(dist)
|
cmd = bdist(dist)
|
||||||
cmd.skip_build = False
|
cmd.skip_build = False
|
||||||
cmd.formats = ['ztar']
|
cmd.formats = ['ztar']
|
||||||
cmd.ensure_finalized()
|
cmd.ensure_finalized()
|
||||||
self.assertFalse(self._get_platform_called)
|
self.assertFalse(self._get_platform_called)
|
||||||
|
|
||||||
pkg_pth, dist = self.create_dist()
|
dist = self.create_dist()[1]
|
||||||
cmd = bdist(dist)
|
cmd = bdist(dist)
|
||||||
cmd.skip_build = True
|
cmd.skip_build = True
|
||||||
cmd.formats = ['ztar']
|
cmd.formats = ['ztar']
|
||||||
|
|
Loading…
Reference in New Issue