Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
Fix Editable Git install package name parsing
Browse files Browse the repository at this point in the history
In pip 19.0 release [1] the

 Editable Git installs without a remote now freeze as editable. (#4759) [2]

bug is fixed. Now the output of pip freeze for such package looks like:

 # Editable Git install with no remote (neutron==10.0.8.dev66)
 -e /home/zuul/src/git.openstack.org/openstack/neutron

instead of:

 ## !! Could not determine repository location
 neutron==10.0.8.dev66

Since for listing the package names the module uses the lines that contains
'==' the new behaviour leaves some garbage in front of the package name. So
in case the string contains '(' then remove the first part of the string.

[1] https://pip.pypa.io/en/stable/news/#id15
[2] pypa/pip#4759

Change-Id: I3573c067f63a09f22377612f53c80c80252965e4
  • Loading branch information
Elod Illes committed Jan 24, 2019
1 parent cce734c commit 44b4702
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion roles/tox/library/tox_install_sibling_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def get_installed_packages(tox_python):
frozen_pkgs = subprocess.check_output(
[tox_python, '-m', 'pip', '-qqq', 'freeze']
)
return [x.split('==')[0] for x in frozen_pkgs.split('\n') if '==' in x]
return [x[x.find('(') + 1:].split('==')[0]
for x in frozen_pkgs.split('\n') if '==' in x]


def write_new_constraints_file(constraints, packages):
Expand Down

0 comments on commit 44b4702

Please sign in to comment.