Commit 4f3eb7ff by Sébastien Eustace

Merge branch 'master' into develop

parents 7372f247 1aa1ab29
...@@ -24,6 +24,17 @@ ...@@ -24,6 +24,17 @@
- Fixed transitive extra dependencies being removed when updating a specific dependency. - Fixed transitive extra dependencies being removed when updating a specific dependency.
## [0.12.16] - 2019-05-17
### Fixed
- Fixed packages with no hashes retrieval for legacy repositories.
- Fixed multiple constraints for dev dependencies.
- Fixed dependency resolution failing on badly formed package versions instead of skipping.
- Fixed permissions of built wheels.
>>>>>>> master
## [0.12.15] - 2019-05-03 ## [0.12.15] - 2019-05-03
### Fixed ### Fixed
...@@ -685,7 +696,8 @@ Initial release ...@@ -685,7 +696,8 @@ Initial release
[Unreleased]: https://github.com/sdispater/poetry/compare/0.12.15...develop [Unreleased]: https://github.com/sdispater/poetry/compare/0.12.16...develop
[0.12.16]: https://github.com/sdispater/poetry/releases/tag/0.12.16
[0.12.15]: https://github.com/sdispater/poetry/releases/tag/0.12.15 [0.12.15]: https://github.com/sdispater/poetry/releases/tag/0.12.15
[0.12.14]: https://github.com/sdispater/poetry/releases/tag/0.12.14 [0.12.14]: https://github.com/sdispater/poetry/releases/tag/0.12.14
[0.12.13]: https://github.com/sdispater/poetry/releases/tag/0.12.13 [0.12.13]: https://github.com/sdispater/poetry/releases/tag/0.12.13
......
...@@ -98,7 +98,7 @@ you can specify the packages you want to include in the final distribution. ...@@ -98,7 +98,7 @@ you can specify the packages you want to include in the final distribution.
[tool.poetry] [tool.poetry]
# ... # ...
packages = [ packages = [
{ include = "mypackage" }, { include = "my_package" },
{ include = "extra_package/**/*.py" }, { include = "extra_package/**/*.py" },
] ]
``` ```
...@@ -109,7 +109,7 @@ If your package is stored inside a "source" directory, you must specify it: ...@@ -109,7 +109,7 @@ If your package is stored inside a "source" directory, you must specify it:
[tool.poetry] [tool.poetry]
# ... # ...
packages = [ packages = [
{ include = "mypackage", from = "lib" }, { include = "my_package", from = "lib" },
] ]
``` ```
...@@ -123,7 +123,7 @@ packages = [ ...@@ -123,7 +123,7 @@ packages = [
```toml ```toml
packages = [ packages = [
{ include = "mypackage" }, { include = "my_package" },
{ include = "extra_package" }, { include = "extra_package" },
] ]
``` ```
......
...@@ -67,6 +67,10 @@ class WheelBuilder(Builder): ...@@ -67,6 +67,10 @@ class WheelBuilder(Builder):
(fd, temp_path) = tempfile.mkstemp(suffix=".whl") (fd, temp_path) = tempfile.mkstemp(suffix=".whl")
st_mode = os.stat(temp_path).st_mode
new_mode = normalize_file_permissions(st_mode)
os.chmod(temp_path, new_mode)
with zipfile.ZipFile( with zipfile.ZipFile(
os.fdopen(fd, "w+b"), mode="w", compression=zipfile.ZIP_DEFLATED os.fdopen(fd, "w+b"), mode="w", compression=zipfile.ZIP_DEFLATED
) as zip_file: ) as zip_file:
......
...@@ -151,7 +151,7 @@ class Poetry: ...@@ -151,7 +151,7 @@ class Poetry:
for name, constraint in local_config["dev-dependencies"].items(): for name, constraint in local_config["dev-dependencies"].items():
if isinstance(constraint, list): if isinstance(constraint, list):
for _constraint in constraint: for _constraint in constraint:
package.add_dependency(name, _constraint) package.add_dependency(name, _constraint, category="dev")
continue continue
......
...@@ -364,7 +364,7 @@ class LegacyRepository(PyPiRepository): ...@@ -364,7 +364,7 @@ class LegacyRepository(PyPiRepository):
hash = link.hash hash = link.hash
if link.hash_name == "sha256": if link.hash_name == "sha256":
hashes.append(hash) hashes.append(hash)
else: elif hash:
hashes.append(link.hash_name + ":" + hash) hashes.append(link.hash_name + ":" + hash)
data["digests"] = hashes data["digests"] = hashes
......
...@@ -196,7 +196,11 @@ class Version(VersionRange): ...@@ -196,7 +196,11 @@ class Version(VersionRange):
@classmethod @classmethod
def parse(cls, text): # type: (str) -> Version def parse(cls, text): # type: (str) -> Version
match = COMPLETE_VERSION.match(text) try:
match = COMPLETE_VERSION.match(text)
except TypeError:
match = None
if match is None: if match is None:
raise ParseVersionError('Unable to parse "{}".'.format(text)) raise ParseVersionError('Unable to parse "{}".'.format(text))
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from __future__ import unicode_literals from __future__ import unicode_literals
import os
import pytest import pytest
import re import re
import shutil import shutil
...@@ -160,6 +161,8 @@ def test_complete(): ...@@ -160,6 +161,8 @@ def test_complete():
whl = module_path / "dist" / "my_package-1.2.3-py3-none-any.whl" whl = module_path / "dist" / "my_package-1.2.3-py3-none-any.whl"
assert whl.exists() assert whl.exists()
if sys.platform != "win32":
assert (os.stat(str(whl)).st_mode & 0o777) == 0o644
zip = zipfile.ZipFile(str(whl)) zip = zipfile.ZipFile(str(whl))
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</head> </head>
<body> <body>
<h1>Links for jupyter</h1> <h1>Links for jupyter</h1>
<a href="https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz#sha256=d9dc4b3318f310e34c82951ea5d6683f67bed7def4b259fafbfe4f1beb1d8e5f">jupyter-1.0.0.tar.gz</a><br/> <a href="https://files.pythonhosted.org/packages/c9/a9/371d0b8fe37dd231cf4b2cff0a9f0f25e98f3a73c3771742444be27f2944/jupyter-1.0.0.tar.gz">jupyter-1.0.0.tar.gz</a><br/>
</body> </body>
</html> </html>
<!--SERIAL 1673841--> <!--SERIAL 1673841-->
...@@ -245,3 +245,11 @@ def test_get_package_retrieves_non_sha256_hashes(): ...@@ -245,3 +245,11 @@ def test_get_package_retrieves_non_sha256_hashes():
] ]
assert expected == package.hashes assert expected == package.hashes
def test_get_package_retrieves_packages_with_no_hashes():
repo = MockRepository()
package = repo.package("jupyter", "1.0.0")
assert [] == package.hashes
...@@ -3,6 +3,7 @@ import pytest ...@@ -3,6 +3,7 @@ import pytest
from poetry.semver import EmptyConstraint from poetry.semver import EmptyConstraint
from poetry.semver import Version from poetry.semver import Version
from poetry.semver import VersionRange from poetry.semver import VersionRange
from poetry.semver.exceptions import ParseVersionError
@pytest.mark.parametrize( @pytest.mark.parametrize(
...@@ -32,6 +33,12 @@ def test_parse_valid(input, version): ...@@ -32,6 +33,12 @@ def test_parse_valid(input, version):
assert parsed.text == input assert parsed.text == input
@pytest.mark.parametrize("input", [(None, "example")])
def test_parse_invalid(input):
with pytest.raises(ParseVersionError):
Version.parse(input)
def test_comparison(): def test_comparison():
versions = [ versions = [
"1.0.0-alpha", "1.0.0-alpha",
......
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