diff options
author | Éric Araujo <merwok@netwok.org> | 2011-09-01 03:11:29 (GMT) |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-09-01 03:11:29 (GMT) |
commit | 95fc53f2b378e603dadb3629597b053c13e45965 (patch) | |
tree | f37a8730f28839cac28c6ffded0a6bf057af6a22 /Lib/packaging/command | |
parent | ab3bea6815a236af940b7d25a0d295e6bbf20c5b (diff) | |
download | cpython-95fc53f2b378e603dadb3629597b053c13e45965.zip cpython-95fc53f2b378e603dadb3629597b053c13e45965.tar.gz cpython-95fc53f2b378e603dadb3629597b053c13e45965.tar.bz2 |
Clean up packaging.util: add __all__, remove some unused functions.
This huge module is the heir of six distutils modules, and contains
a number of miscellaneous functions. I have attempted to help readers
of the source code with an annoted __all__. Removed or deprecated
functions have been removed from the documentation; I’m working on
another patch to document the remaining public functions.
For the curious:
The unzip_file and untar_file were used by (or intended to be used by)
“pysetup install path/to/archive.tar.gz”, but the code presently used
shutil.unpack_archive and an helper function, so I just deleted them.
They’re still in the repository if we need them in the future.
The find_packages function is not used anymore but I want to discuss
module and package auto-discovery (in “pysetup create”) again before
removing it.
subst_vars now lives in sysconfig; rfc822_escape is inlined in
packaging.metadata. Other functions are for internal use only, or
deprecated; I have left them out of __all__ and sprinkled TODO notes
for future cleanups.
Diffstat (limited to 'Lib/packaging/command')
-rw-r--r-- | Lib/packaging/command/build_py.py | 2 | ||||
-rw-r--r-- | Lib/packaging/command/install_lib.py | 2 | ||||
-rw-r--r-- | Lib/packaging/command/register.py | 1 | ||||
-rw-r--r-- | Lib/packaging/command/upload.py | 1 |
4 files changed, 2 insertions, 4 deletions
diff --git a/Lib/packaging/command/build_py.py b/Lib/packaging/command/build_py.py index 360f4c9..7baa6e4 100644 --- a/Lib/packaging/command/build_py.py +++ b/Lib/packaging/command/build_py.py @@ -393,7 +393,7 @@ class build_py(Command, Mixin2to3): self.get_command_name()) return - from packaging.util import byte_compile + from packaging.util import byte_compile # FIXME use compileall prefix = self.build_lib if prefix[-1] != os.sep: prefix = prefix + os.sep diff --git a/Lib/packaging/command/install_lib.py b/Lib/packaging/command/install_lib.py index 5ff9cee..978f0ef 100644 --- a/Lib/packaging/command/install_lib.py +++ b/Lib/packaging/command/install_lib.py @@ -122,7 +122,7 @@ class install_lib(Command): self.get_command_name()) return - from packaging.util import byte_compile + from packaging.util import byte_compile # FIXME use compileall # Get the "--root" directory supplied to the "install_dist" command, # and use it as a prefix to strip off the purported filename diff --git a/Lib/packaging/command/register.py b/Lib/packaging/command/register.py index 006dfdf..67cda80 100644 --- a/Lib/packaging/command/register.py +++ b/Lib/packaging/command/register.py @@ -2,7 +2,6 @@ # Contributed by Richard Jones -import io import getpass import urllib.error import urllib.parse diff --git a/Lib/packaging/command/upload.py b/Lib/packaging/command/upload.py index e39016c..f56d2c6 100644 --- a/Lib/packaging/command/upload.py +++ b/Lib/packaging/command/upload.py @@ -5,7 +5,6 @@ import socket import logging import platform import urllib.parse -from io import BytesIO from base64 import standard_b64encode from hashlib import md5 from urllib.error import HTTPError |