Skip to content

Commit

Permalink
Merge pull request #204 from mikekap/fix_local_packages
Browse files Browse the repository at this point in the history
Don't normalize version numbers as names.
  • Loading branch information
kwlzn committed Feb 10, 2016
2 parents 7379f31 + e61b3d9 commit f0c5c6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pex/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def name(self):

@property
def raw_version(self):
return safe_name(self._raw_version)
return self._raw_version

# SourcePackages are always compatible as they can be translated to a distribution.
def compatible(self, identity, platform=Platform.current()):
Expand Down Expand Up @@ -167,7 +167,7 @@ def name(self):

@property
def raw_version(self):
return safe_name(self._raw_version)
return self._raw_version

@property
def py_version(self):
Expand Down
9 changes: 9 additions & 0 deletions tests/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ def test_source_packages():
assert sl.raw_version == '1.5'


def test_local_specifier():
for ext in ('.tar.gz', '.tar', '.tgz', '.zip', '.tar.bz2'):
sl = SourcePackage('a_p_r-3.1.3+pexed.1' + ext)
assert sl.name == 'a-p-r'
assert sl.raw_version == '3.1.3+pexed.1'
assert sl.version == parse_version(sl.raw_version)
assert sl.satisfies('a_p_r==3.1.3+pexed.1')


def test_egg_packages():
el = EggPackage('psutil-0.4.1-py2.6-macosx-10.7-intel.egg')
assert el.name == 'psutil'
Expand Down

0 comments on commit f0c5c6f

Please sign in to comment.