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
9c63f78b
Unverified
Commit
9c63f78b
authored
Nov 08, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of extras and constraints for legacy repositories
parent
0970878e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
3 deletions
+57
-3
CHANGELOG.md
+2
-0
poetry/repositories/legacy_repository.py
+10
-2
tests/repositories/fixtures/legacy/python-language-server.html
+11
-0
tests/repositories/fixtures/pypi.org/dists/python-language-server-0.21.2.tar.gz
+0
-0
tests/repositories/test_legacy_repository.py
+34
-1
No files found.
CHANGELOG.md
View file @
9c63f78b
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
-
Fixed extras being selected when resolving dependencies even when not required.
-
Fixed extras being selected when resolving dependencies even when not required.
-
Fixed performance issues when packaging projects if a lot of files were excluded.
-
Fixed performance issues when packaging projects if a lot of files were excluded.
-
Fixed installation of files.
-
Fixed installation of files.
-
Fixed extras not being retrieved for legacy repositories.
-
Fixed invalid transitive constraints raising an error for legacy repositories.
## [0.12.6] - 2018-11-05
## [0.12.6] - 2018-11-05
...
...
poetry/repositories/legacy_repository.py
View file @
9c63f78b
...
@@ -266,9 +266,17 @@ class LegacyRepository(PyPiRepository):
...
@@ -266,9 +266,17 @@ class LegacyRepository(PyPiRepository):
req
=
req
.
split
(
";"
)[
0
]
req
=
req
.
split
(
";"
)[
0
]
dependency
=
dependency_from_pep_508
(
req
)
dependency
=
dependency_from_pep_508
(
req
)
except
ValueError
:
# Likely unable to parse constraint so we skip it
self
.
_log
(
"Invalid constraint ({}) found in {}-{} dependencies, "
"skipping"
.
format
(
req
,
package
.
name
,
package
.
version
),
level
=
"debug"
,
)
continue
if
dependency
.
extras
:
if
dependency
.
in_
extras
:
for
extra
in
dependency
.
extras
:
for
extra
in
dependency
.
in_
extras
:
if
extra
not
in
package
.
extras
:
if
extra
not
in
package
.
extras
:
package
.
extras
[
extra
]
=
[]
package
.
extras
[
extra
]
=
[]
...
...
tests/repositories/fixtures/legacy/python-language-server.html
0 → 100644
View file @
9c63f78b
<!DOCTYPE html>
<html>
<head>
<title>
Links for python-language-server
</title>
</head>
<body>
<h1>
Links for python-language-server
</h1>
<a
href=
"https://files.pythonhosted.org/packages/9f/1d/2817b5dc2dd77f897410a11c1c9e2a6d96b3273c53d4219dd9edab7882af/python-language-server-0.21.2.tar.gz#sha256=fa9162acb1402b807132d7288b7f521db2bd666d63505d8a4d9464d4b8488c52"
>
python-language-server-0.21.2.tar.gz
</a><br/>
</body>
</html>
<!--SERIAL 4245719-->
tests/repositories/fixtures/pypi.org/dists/python-language-server-0.21.2.tar.gz
0 → 100644
View file @
9c63f78b
File added
tests/repositories/test_legacy_repository.py
View file @
9c63f78b
...
@@ -67,7 +67,7 @@ def test_sdist_format_support():
...
@@ -67,7 +67,7 @@ def test_sdist_format_support():
assert
bz2_links
[
0
]
.
filename
==
"poetry-0.1.1.tar.bz2"
assert
bz2_links
[
0
]
.
filename
==
"poetry-0.1.1.tar.bz2"
def
test_missing_version
(
mocker
):
def
test_missing_version
():
repo
=
MockRepository
()
repo
=
MockRepository
()
with
pytest
.
raises
(
PackageNotFound
):
with
pytest
.
raises
(
PackageNotFound
):
...
@@ -95,3 +95,36 @@ def test_get_package_information_fallback_read_setup():
...
@@ -95,3 +95,36 @@ def test_get_package_information_fallback_read_setup():
Dependency
(
"ipykernel"
,
"*"
),
Dependency
(
"ipykernel"
,
"*"
),
Dependency
(
"ipywidgets"
,
"*"
),
Dependency
(
"ipywidgets"
,
"*"
),
]
]
def
test_get_package_information_skips_dependencies_with_invalid_constraints
():
repo
=
MockRepository
()
package
=
repo
.
package
(
"python-language-server"
,
"0.21.2"
)
assert
package
.
name
==
"python-language-server"
assert
package
.
version
.
text
==
"0.21.2"
assert
(
package
.
description
==
"Python Language Server for the Language Server Protocol"
)
assert
sorted
(
package
.
requires
,
key
=
lambda
r
:
r
.
name
)
==
[
Dependency
(
"configparser"
,
"*"
),
Dependency
(
"future"
,
">=0.14.0"
),
Dependency
(
"futures"
,
"*"
),
Dependency
(
"jedi"
,
">=0.12"
),
Dependency
(
"pluggy"
,
"*"
),
Dependency
(
"python-jsonrpc-server"
,
"*"
),
]
all_extra
=
package
.
extras
[
"all"
]
# rope>-0.10.5 should be discarded
assert
sorted
(
all_extra
,
key
=
lambda
r
:
r
.
name
)
==
[
Dependency
(
"autopep8"
,
"*"
),
Dependency
(
"mccabe"
,
"*"
),
Dependency
(
"pycodestyle"
,
"*"
),
Dependency
(
"pydocstyle"
,
">=2.0.0"
),
Dependency
(
"pyflakes"
,
">=1.6.0"
),
Dependency
(
"yapf"
,
"*"
),
]
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