Skip to content
Permalink
Browse files

Merge pull request python-poetry#1309 from sdispater/950-simplified

950 simplified
  • Loading branch information
brycedrennan committed Aug 20, 2019
2 parents ab81ff0 + e69077e commit f4803e91bca440e6f4af6ad54e396d01c024a76f
@@ -203,7 +203,7 @@ def dist_info(self): # type: () -> str
def wheel_filename(self): # type: () -> str
return "{}-{}-{}.whl".format(
re.sub(r"[^\w\d.]+", "_", self._package.pretty_name, flags=re.UNICODE),
re.sub(r"[^\w\d.]+", "_", self._meta.version, flags=re.UNICODE),
re.sub(r"[^\w\d.\+]+", "_", self._meta.version, flags=re.UNICODE),
self.tag,
)

@@ -214,7 +214,7 @@ def supports_python2(self):

def dist_info_name(self, distribution, version): # type: (...) -> str
escaped_name = re.sub(r"[^\w\d.]+", "_", distribution, flags=re.UNICODE)
escaped_version = re.sub(r"[^\w\d.]+", "_", version, flags=re.UNICODE)
escaped_version = re.sub(r"[^\w\d.+]+", "_", version, flags=re.UNICODE)

return "{}-{}.dist-info".format(escaped_name, escaped_version)

@@ -0,0 +1 @@
"""Test fixture for https://github.com/sdispater/poetry/issues/756"""
@@ -0,0 +1,5 @@
[tool.poetry]
name = "localversionlabel"
version = "0.1-beta.1+gitbranch-buildno-1"
authors = []

@@ -61,6 +61,18 @@ def test_wheel_prerelease():
assert whl.exists()


def test_wheel_localversionlabel():
module_path = fixtures_dir / "localversionlabel"
WheelBuilder.make(Poetry.create(str(module_path)), NullEnv(), NullIO())
local_version_string = "localversionlabel-0.1b1+gitbranch.buildno.1"
whl = module_path / "dist" / (local_version_string + "-py2.py3-none-any.whl")

assert whl.exists()

with zipfile.ZipFile(str(whl)) as z:
assert local_version_string + ".dist-info/METADATA" in z.namelist()


def test_wheel_package_src():
module_path = fixtures_dir / "source_package"
WheelBuilder.make(Poetry.create(str(module_path)), NullEnv(), NullIO())

0 comments on commit f4803e9

Please sign in to comment.
You can’t perform that action at this time.