Skip to content

Commit

Permalink
Do not look for version number on editable pip packages (#39)
Browse files Browse the repository at this point in the history
If the user has a local python site and installed editable packages,
they will appear in the output of `pip freeze` in a different format
than other installed packages.
  • Loading branch information
cgibb committed Mar 7, 2019
1 parent 6651845 commit ffd1d81
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions colcon_bundle/installer/base_pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,12 @@ def _generate_metadata(self, python_pip_args):
def split_package_version(package_version):
"""Split package==3.2.3 pip freeze output."""
split_string = package_version.split('==')
# TODO: This shouldn't be necessary if we fix #40 since we
# should never install packages as editable
if len(split_string) < 2 and '-e' in package_version:
# Package is installed with --editable flag, and formatted
# differently. Does not have a version number.
# format: -e git+https://<repo>@<commit_hash>#egg=<package_name>.
split_string = package_version.split('=')
return {'name': split_string[1]}
return {'name': split_string[0], 'version': split_string[1]}

0 comments on commit ffd1d81

Please sign in to comment.