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
92b85f2d
Unverified
Commit
92b85f2d
authored
Dec 20, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix resolving directory dependencies with no sub dependencies
parent
1ebd629e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
2 deletions
+43
-2
CHANGELOG.md
+1
-0
poetry/utils/helpers.py
+2
-2
tests/fixtures/git/github.com/demo/no-dependencies/demo/__init__.py
+1
-0
tests/fixtures/git/github.com/demo/no-dependencies/setup.py
+17
-0
tests/puzzle/test_provider.py
+22
-0
No files found.
CHANGELOG.md
View file @
92b85f2d
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
-
Fixed the way packages information are retrieved for legacy repositories.
-
Fixed the way packages information are retrieved for legacy repositories.
-
Fixed an error when adding packages with invalid versions.
-
Fixed an error when adding packages with invalid versions.
-
Fixed an error when resolving directory dependencies with no sub dependencies.
## [0.12.10] - 2018-11-22
## [0.12.10] - 2018-11-22
...
...
poetry/utils/helpers.py
View file @
92b85f2d
...
@@ -5,6 +5,7 @@ import stat
...
@@ -5,6 +5,7 @@ import stat
import
tempfile
import
tempfile
from
contextlib
import
contextmanager
from
contextlib
import
contextmanager
from
typing
import
List
from
typing
import
Optional
from
typing
import
Optional
from
typing
import
Union
from
typing
import
Union
...
@@ -41,7 +42,7 @@ def temporary_directory(*args, **kwargs):
...
@@ -41,7 +42,7 @@ def temporary_directory(*args, **kwargs):
shutil
.
rmtree
(
name
)
shutil
.
rmtree
(
name
)
def
parse_requires
(
requires
):
# type: (str) ->
Union[list, None
]
def
parse_requires
(
requires
):
# type: (str) ->
List[str
]
lines
=
requires
.
split
(
"
\n
"
)
lines
=
requires
.
split
(
"
\n
"
)
requires_dist
=
[]
requires_dist
=
[]
...
@@ -79,7 +80,6 @@ def parse_requires(requires): # type: (str) -> Union[list, None]
...
@@ -79,7 +80,6 @@ def parse_requires(requires): # type: (str) -> Union[list, None]
requires_dist
.
append
(
line
)
requires_dist
.
append
(
line
)
if
requires_dist
:
return
requires_dist
return
requires_dist
...
...
tests/fixtures/git/github.com/demo/no-dependencies/demo/__init__.py
0 → 100644
View file @
92b85f2d
__version__
=
"1.2.3"
tests/fixtures/git/github.com/demo/no-dependencies/setup.py
0 → 100644
View file @
92b85f2d
# -*- coding: utf-8 -*-
from
setuptools
import
setup
kwargs
=
dict
(
name
=
"demo"
,
license
=
"MIT"
,
version
=
"0.1.2"
,
description
=
"Demo project."
,
author
=
"Sébastien Eustace"
,
author_email
=
"sebastien@eustace.io"
,
url
=
"https://github.com/demo/demo"
,
packages
=
[
"demo"
],
)
setup
(
**
kwargs
)
tests/puzzle/test_provider.py
View file @
92b85f2d
...
@@ -227,6 +227,28 @@ def test_search_for_directory_setup_read_setup_with_extras(provider, mocker):
...
@@ -227,6 +227,28 @@ def test_search_for_directory_setup_read_setup_with_extras(provider, mocker):
}
}
@pytest.mark.skipif
(
not
PY35
,
reason
=
"AST parsing does not work for Python <3.4"
)
def
test_search_for_directory_setup_read_setup_with_no_dependencies
(
provider
,
mocker
):
mocker
.
patch
(
"poetry.utils.env.Env.get"
,
return_value
=
MockEnv
())
dependency
=
DirectoryDependency
(
"demo"
,
Path
(
__file__
)
.
parent
.
parent
/
"fixtures"
/
"git"
/
"github.com"
/
"demo"
/
"no-dependencies"
,
)
package
=
provider
.
search_for_directory
(
dependency
)[
0
]
assert
package
.
name
==
"demo"
assert
package
.
version
.
text
==
"0.1.2"
assert
package
.
requires
==
[]
assert
package
.
extras
==
{}
def
test_search_for_directory_poetry
(
provider
):
def
test_search_for_directory_poetry
(
provider
):
dependency
=
DirectoryDependency
(
dependency
=
DirectoryDependency
(
"demo"
,
Path
(
__file__
)
.
parent
.
parent
/
"fixtures"
/
"project_with_extras"
"demo"
,
Path
(
__file__
)
.
parent
.
parent
/
"fixtures"
/
"project_with_extras"
...
...
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