Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
4f3eb7ff
Unverified
Commit
4f3eb7ff
authored
May 18, 2019
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
parents
7372f247
1aa1ab29
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
46 additions
and
8 deletions
+46
-8
CHANGELOG.md
+13
-1
docs/docs/pyproject.md
+3
-3
poetry/masonry/builders/wheel.py
+4
-0
poetry/poetry.py
+1
-1
poetry/repositories/legacy_repository.py
+1
-1
poetry/semver/version.py
+5
-1
tests/masonry/builders/test_complete.py
+3
-0
tests/repositories/fixtures/legacy/jupyter.html
+1
-1
tests/repositories/test_legacy_repository.py
+8
-0
tests/semver/test_version.py
+7
-0
No files found.
CHANGELOG.md
View file @
4f3eb7ff
...
@@ -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
...
...
docs/docs/pyproject.md
View file @
4f3eb7ff
...
@@ -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" },
]
]
```
```
...
...
poetry/masonry/builders/wheel.py
View file @
4f3eb7ff
...
@@ -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
:
...
...
poetry/poetry.py
View file @
4f3eb7ff
...
@@ -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
...
...
poetry/repositories/legacy_repository.py
View file @
4f3eb7ff
...
@@ -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
)
el
se
:
el
if
hash
:
hashes
.
append
(
link
.
hash_name
+
":"
+
hash
)
hashes
.
append
(
link
.
hash_name
+
":"
+
hash
)
data
[
"digests"
]
=
hashes
data
[
"digests"
]
=
hashes
...
...
poetry/semver/version.py
View file @
4f3eb7ff
...
@@ -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
))
...
...
tests/masonry/builders/test_complete.py
View file @
4f3eb7ff
# -*- 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
&
0
o777
)
==
0
o644
zip
=
zipfile
.
ZipFile
(
str
(
whl
))
zip
=
zipfile
.
ZipFile
(
str
(
whl
))
...
...
tests/repositories/fixtures/legacy/jupyter.html
View file @
4f3eb7ff
...
@@ -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-->
tests/repositories/test_legacy_repository.py
View file @
4f3eb7ff
...
@@ -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
tests/semver/test_version.py
View file @
4f3eb7ff
...
@@ -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"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment