summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Holth <dholth@fastmail.fm>2016-08-20 19:06:14 -0400
committerDaniel Holth <dholth@fastmail.fm>2016-08-20 19:06:14 -0400
commit2df0d8d7383bdbeacf88deaf1ef841cffdfe10c7 (patch)
treed2fbe75197270fd43f218c00ab8c104e09575d6e
parent429c8d0f0b0bd44af6b5837547695d0cb79fd4a2 (diff)
parent6fd82dd38c199028c7b8e4de8f3bd1632030b331 (diff)
downloadwheel-2df0d8d7383bdbeacf88deaf1ef841cffdfe10c7.tar.gz
Merged in HexDecimal/wheel/strict-resource-testing (pull request #66)
File handling tests and fixes.
-rw-r--r--wheel/bdist_wheel.py6
-rw-r--r--wheel/install.py12
-rw-r--r--wheel/metadata.py5
-rw-r--r--wheel/signatures/keys.py2
-rw-r--r--wheel/tool/__init__.py9
5 files changed, 17 insertions, 17 deletions
diff --git a/wheel/bdist_wheel.py b/wheel/bdist_wheel.py
index 3dc2caf..d716163 100644
--- a/wheel/bdist_wheel.py
+++ b/wheel/bdist_wheel.py
@@ -12,7 +12,6 @@ import warnings
import shutil
import json
import sys
-import wheel
try:
import sysconfig
@@ -39,6 +38,7 @@ from .archive import archive_wheelfile
from .pkginfo import read_pkg_info, write_pkg_info
from .metadata import pkginfo_to_dict
from . import pep425tags, metadata
+from . import __version__ as wheel_version
def safer_name(name):
return safe_name(name).replace('-', '_')
@@ -257,7 +257,7 @@ class bdist_wheel(Command):
else:
rmtree(self.bdist_dir)
- def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel.__version__ + ')'):
+ def write_wheelfile(self, wheelfile_base, generator='bdist_wheel (' + wheel_version + ')'):
from email.message import Message
msg = Message()
msg['Wheel-Version'] = '1.0' # of the spec
@@ -423,7 +423,7 @@ class bdist_wheel(Command):
adios(egginfo_path)
def write_record(self, bdist_dir, distinfo_dir):
- from wheel.util import urlsafe_b64encode
+ from .util import urlsafe_b64encode
record_path = os.path.join(distinfo_dir, 'RECORD')
record_relpath = os.path.relpath(record_path, bdist_dir)
diff --git a/wheel/install.py b/wheel/install.py
index 9d48efe..a422b0e 100644
--- a/wheel/install.py
+++ b/wheel/install.py
@@ -18,12 +18,12 @@ try:
except NameError:
_big_number = sys.maxint
-from wheel.decorator import reify
-from wheel.util import (urlsafe_b64encode, from_json, urlsafe_b64decode,
- native, binary, HashingFile)
-from wheel import signatures
-from wheel.pkginfo import read_pkg_info_bytes
-from wheel.util import open_for_csv
+from .decorator import reify
+from .util import (urlsafe_b64encode, from_json, urlsafe_b64decode,
+ native, binary, HashingFile)
+from . import signatures
+from .pkginfo import read_pkg_info_bytes
+from .util import open_for_csv
from .pep425tags import get_supported
from .paths import get_install_paths
diff --git a/wheel/metadata.py b/wheel/metadata.py
index 47b15ce..fd2bb7e 100644
--- a/wheel/metadata.py
+++ b/wheel/metadata.py
@@ -15,7 +15,8 @@ import os.path
import textwrap
import pkg_resources
import email.parser
-import wheel
+
+from . import __version__ as wheel_version
METADATA_VERSION = "2.0"
@@ -106,7 +107,7 @@ def pkginfo_to_dict(path, distribution=None):
"""
metadata = OrderedDefaultDict(lambda: OrderedDefaultDict(lambda: OrderedDefaultDict(OrderedDict)))
- metadata["generator"] = "bdist_wheel (" + wheel.__version__ + ")"
+ metadata["generator"] = "bdist_wheel (" + wheel_version + ")"
try:
unicode
pkg_info = read_pkg_info(path)
diff --git a/wheel/signatures/keys.py b/wheel/signatures/keys.py
index 1dde4bf..57d7feb 100644
--- a/wheel/signatures/keys.py
+++ b/wheel/signatures/keys.py
@@ -33,7 +33,7 @@ wheel export key
import json
import os.path
-from wheel.util import native, load_config_paths, save_config_path
+from ..util import native, load_config_paths, save_config_path
class WheelKeys(object):
SCHEMA = 1
diff --git a/wheel/tool/__init__.py b/wheel/tool/__init__.py
index 95f0a9b..4c0187b 100644
--- a/wheel/tool/__init__.py
+++ b/wheel/tool/__init__.py
@@ -6,13 +6,13 @@ import os
import hashlib
import sys
import json
-import wheel.paths
from glob import iglob
from .. import signatures
from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary,
matches_requirement)
-from ..install import WheelFile
+from ..install import WheelFile, VerifyingZipFile
+from ..paths import get_install_command
def require_pkgresources(name):
try:
@@ -97,8 +97,7 @@ def unsign(wheelfile):
ordinary archive, with the compressed files and the directory in the same
order, and without any non-zip content after the truncation point.
"""
- import wheel.install
- vzf = wheel.install.VerifyingZipFile(wheelfile, "a")
+ vzf = VerifyingZipFile(wheelfile, "a")
info = vzf.infolist()
if not (len(info) and info[-1].filename.endswith('/RECORD.jws')):
raise WheelError("RECORD.jws not found at end of archive.")
@@ -233,7 +232,7 @@ def install_scripts(distributions):
for dist in distributions:
pkg_resources_dist = pkg_resources.get_distribution(dist)
- install = wheel.paths.get_install_command(dist)
+ install = get_install_command(dist)
command = easy_install.easy_install(install.distribution)
command.args = ['wheel'] # dummy argument
command.finalize_options()