1. Jannis Leidel
  2. wheel


Daniel Holth  committed 8918997

test wheel.tool.install

  • Participants
  • Parent commits e44291e
  • Branches default

Comments (0)

Files changed (2)

File wheel/test/test_install.py

View file
  • Ignore whitespace
 # The root is PLATLIB
 # So, some in PLATLIB, and one in each of DATA, HEADERS and SCRIPTS.
-import wheel.util
+import wheel.tool
+import wheel.pep425tags
 from wheel.install import WheelFile
 from tempfile import mkdtemp
 import shutil
         assert check(locs['platlib'], 'test-1.0.dist-info', 'RECORD')
+def test_install_tool():
+    """Slightly improve coverage of wheel.install"""
+    wheel.tool.install([TESTWHEEL], force=True, dry_run=True)

File wheel/tool/__init__.py

View file
  • Ignore whitespace
     return selected
 def install(requirements, requirements_file=None,
-            wheel_dirs=None, force=False, list_files=False):
+            wheel_dirs=None, force=False, list_files=False,
+            dry_run=False):
     """Install wheels.
     :param requirements: A list of requirements or wheel files to install.
     :param wheel_dirs: A list of directories to search for wheels.
     :param force: Install a wheel file even if it is not compatible.
     :param list_files: Only list the files to install, don't install them.
+    :param dry_run: Do everything but the actual install.
     # If no wheel directories specified, use the WHEELPATH environment
         for w in os.listdir(d):
             if w.endswith('.whl'):
                 wf = WheelFile(os.path.join(d, w))
-                if wf.supported:
+                if wf.compatible:
     # If there is a requirements file, add it to the list of requirements
             # Explicitly specified wheel filename
             if os.path.exists(req):
                 wf = WheelFile(req)
-                if wf.supported or force:
+                if wf.compatible or force:
                     msg = ("{} is not compatible with this Python. "
     # We now have a list of wheels to install
     if list_files:
+    if dry_run:
+        return
     for wf in to_install:
         if list_files:
             sys.stdout.write("    {}\n".format(wf.filename))