Commit f4803e91 by Bryce Drennan Committed by GitHub

Merge pull request #1309 from sdispater/950-simplified

950 simplified
parents ab81ff02 e69077e1
...@@ -203,7 +203,7 @@ class WheelBuilder(Builder): ...@@ -203,7 +203,7 @@ class WheelBuilder(Builder):
def wheel_filename(self): # type: () -> str def wheel_filename(self): # type: () -> str
return "{}-{}-{}.whl".format( return "{}-{}-{}.whl".format(
re.sub(r"[^\w\d.]+", "_", self._package.pretty_name, flags=re.UNICODE), 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, self.tag,
) )
...@@ -214,7 +214,7 @@ class WheelBuilder(Builder): ...@@ -214,7 +214,7 @@ class WheelBuilder(Builder):
def dist_info_name(self, distribution, version): # type: (...) -> str def dist_info_name(self, distribution, version): # type: (...) -> str
escaped_name = re.sub(r"[^\w\d.]+", "_", distribution, flags=re.UNICODE) 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) return "{}-{}.dist-info".format(escaped_name, escaped_version)
......
"""Test fixture for https://github.com/sdispater/poetry/issues/756"""
[tool.poetry]
name = "localversionlabel"
version = "0.1-beta.1+gitbranch-buildno-1"
authors = []
...@@ -61,6 +61,18 @@ def test_wheel_prerelease(): ...@@ -61,6 +61,18 @@ def test_wheel_prerelease():
assert whl.exists() 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(): def test_wheel_package_src():
module_path = fixtures_dir / "source_package" module_path = fixtures_dir / "source_package"
WheelBuilder.make(Poetry.create(str(module_path)), NullEnv(), NullIO()) WheelBuilder.make(Poetry.create(str(module_path)), NullEnv(), NullIO())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment