Skip to content

Commit

Permalink
Reword wheel hash details output
Browse files Browse the repository at this point in the history
This rewords the output to be more like the form of the preceeding
messages.  Additionally the size is added, since we have calculated it
anyway.  The output will now look like:

 Collecting simple==3.0
 Building wheels for collected packages: simple
   Building wheel for simple (setup.py): started
   Building wheel for simple (setup.py): finished with status 'done'
   Created wheel for simple: filename=simple-3.0-py3-none-any.whl size=1138 sha256=2a980a802c9d38a24d29aded2dc2df2b080e58370902e5fdf950090ff67aec10
   Stored in directory: /tmp/pytest-of-iwienand/pytest-0/test_pip_wheel_success0/workspace/scratch
 Successfully built simple

A match for the following line is added to the functional test too.
  • Loading branch information
ianw committed Jun 25, 2019
1 parent 2639514 commit 8d4e17c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/pip/_internal/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,10 +892,12 @@ def _build_one_inside_env(self, req, output_dir, python_tag=None):
wheel_name = os.path.basename(wheel_path)
dest_path = os.path.join(output_dir, wheel_name)
try:
wheel_hash, _ = hash_file(wheel_path)
wheel_hash, length = hash_file(wheel_path)
shutil.move(wheel_path, dest_path)
logger.info('Finished: %s sha256=%s',
wheel_name, wheel_hash.hexdigest())
logger.info('Created wheel for %s: '
'filename=%s size=%d sha256=%s',
req.name, wheel_name, length,
wheel_hash.hexdigest())
logger.info('Stored in directory: %s', output_dir)
return dest_path
except Exception:
Expand Down
7 changes: 5 additions & 2 deletions tests/functional/test_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ def test_pip_wheel_success(script, data):
wheel_file_name = 'simple-3.0-py%s-none-any.whl' % pyversion[0]
wheel_file_path = script.scratch / wheel_file_name
assert re.search(
"Finished: %s sha256=[A-Fa-f0-9]{64}" % re.escape(wheel_file_name),
result.stdout)
r"Created wheel for simple: "
r"filename=%s size=\d+ sha256=[A-Fa-f0-9]{64}"
% re.escape(wheel_file_name), result.stdout)
assert re.search(
r"^\s+Stored in directory: ", result.stdout, re.M)
assert wheel_file_path in result.files_created, result.stdout
assert "Successfully built simple" in result.stdout, result.stdout

Expand Down

0 comments on commit 8d4e17c

Please sign in to comment.