Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
sdispater committed May 18, 2019
2 parents 7372f24 + 1aa1ab2 commit 4f3eb7f
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 8 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
- 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

### Fixed
Expand Down Expand Up @@ -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.14]: https://github.com/sdispater/poetry/releases/tag/0.12.14
[0.12.13]: https://github.com/sdispater/poetry/releases/tag/0.12.13
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ you can specify the packages you want to include in the final distribution.
[tool.poetry]
# ...
packages = [
{ include = "mypackage" },
{ include = "my_package" },
{ include = "extra_package/**/*.py" },
]
```
Expand All @@ -109,7 +109,7 @@ If your package is stored inside a "source" directory, you must specify it:
[tool.poetry]
# ...
packages = [
{ include = "mypackage", from = "lib" },
{ include = "my_package", from = "lib" },
]
```

Expand All @@ -123,7 +123,7 @@ packages = [

```toml
packages = [
{ include = "mypackage" },
{ include = "my_package" },
{ include = "extra_package" },
]
```
Expand Down
4 changes: 4 additions & 0 deletions poetry/masonry/builders/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ def build(self):

(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(
os.fdopen(fd, "w+b"), mode="w", compression=zipfile.ZIP_DEFLATED
) as zip_file:
Expand Down
2 changes: 1 addition & 1 deletion poetry/poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def create(cls, cwd): # type: (Path) -> Poetry
for name, constraint in local_config["dev-dependencies"].items():
if isinstance(constraint, list):
for _constraint in constraint:
package.add_dependency(name, _constraint)
package.add_dependency(name, _constraint, category="dev")

continue

Expand Down
2 changes: 1 addition & 1 deletion poetry/repositories/legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def _get_release_info(self, name, version): # type: (str, str) -> dict
hash = link.hash
if link.hash_name == "sha256":
hashes.append(hash)
else:
elif hash:
hashes.append(link.hash_name + ":" + hash)

data["digests"] = hashes
Expand Down
6 changes: 5 additions & 1 deletion poetry/semver/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,11 @@ def include_max(self):

@classmethod
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:
raise ParseVersionError('Unable to parse "{}".'.format(text))

Expand Down
3 changes: 3 additions & 0 deletions tests/masonry/builders/test_complete.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

import os
import pytest
import re
import shutil
Expand Down Expand Up @@ -160,6 +161,8 @@ def test_complete():
whl = module_path / "dist" / "my_package-1.2.3-py3-none-any.whl"

assert whl.exists()
if sys.platform != "win32":
assert (os.stat(str(whl)).st_mode & 0o777) == 0o644

zip = zipfile.ZipFile(str(whl))

Expand Down
2 changes: 1 addition & 1 deletion tests/repositories/fixtures/legacy/jupyter.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</head>
<body>
<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>
</html>
<!--SERIAL 1673841-->
8 changes: 8 additions & 0 deletions tests/repositories/test_legacy_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,11 @@ def test_get_package_retrieves_non_sha256_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
7 changes: 7 additions & 0 deletions tests/semver/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from poetry.semver import EmptyConstraint
from poetry.semver import Version
from poetry.semver import VersionRange
from poetry.semver.exceptions import ParseVersionError


@pytest.mark.parametrize(
Expand Down Expand Up @@ -32,6 +33,12 @@ def test_parse_valid(input, version):
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():
versions = [
"1.0.0-alpha",
Expand Down

0 comments on commit 4f3eb7f

Please sign in to comment.