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
fbb90678
Unverified
Commit
fbb90678
authored
Oct 13, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix transitive directory dependencies installation
parent
16448242
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
124 additions
and
7 deletions
+124
-7
CHANGELOG.md
+1
-0
poetry/packages/locker.py
+0
-4
poetry/puzzle/provider.py
+13
-3
tests/fixtures/directory/project_with_transitive_directory_dependencies/project_with_transitive_directory_dependencies/__init__.py
+0
-0
tests/fixtures/directory/project_with_transitive_directory_dependencies/pyproject.toml
+12
-0
tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py
+24
-0
tests/installation/fixtures/with-directory-dependency-poetry-transitive.test
+54
-0
tests/installation/test_installer.py
+20
-0
No files found.
CHANGELOG.md
View file @
fbb90678
...
...
@@ -22,6 +22,7 @@
-
Fixed handling of extras.
-
Fixed duplicate entries in both sdist and wheel.
-
Fixed excluded files appearing in the
`package_data`
of the generated
`setup.py`
.
-
Fixed transitive directory dependencies installation.
## [0.11.5] - 2018-09-04
...
...
poetry/packages/locker.py
View file @
fbb90678
...
...
@@ -215,10 +215,6 @@ class Locker:
else
:
dependencies
[
dependency
.
pretty_name
]
.
append
(
constraint
)
for
name
,
constraints
in
dependencies
.
items
():
if
len
(
constraints
)
==
1
:
dependencies
[
name
]
=
constraints
[
0
]
data
=
{
"name"
:
package
.
pretty_name
,
"version"
:
package
.
pretty_version
,
...
...
poetry/puzzle/provider.py
View file @
fbb90678
...
...
@@ -22,7 +22,6 @@ from poetry.packages import dependency_from_pep_508
from
poetry.mixology.incompatibility
import
Incompatibility
from
poetry.mixology.incompatibility_cause
import
DependencyCause
from
poetry.mixology.incompatibility_cause
import
PlatformCause
from
poetry.mixology.incompatibility_cause
import
PythonCause
from
poetry.mixology.term
import
Term
...
...
@@ -525,14 +524,25 @@ class Provider:
)
raise
CompatibilityError
(
*
python_constraints
)
if
not
package
.
dependency
.
python_constraint
.
is_any
():
for
dep
in
dependencies
:
# Modifying dependencies as needed
for
dep
in
dependencies
:
if
not
package
.
dependency
.
python_constraint
.
is_any
():
dep
.
transitive_python_versions
=
str
(
dep
.
python_constraint
.
intersect
(
package
.
dependency
.
python_constraint
)
)
if
package
.
dependency
.
is_directory
()
and
dep
.
is_directory
():
if
dep
.
package
.
source_url
.
startswith
(
package
.
source_url
):
relative
=
(
Path
(
package
.
source_url
)
/
dep
.
package
.
source_url
)
.
relative_to
(
package
.
source_url
)
else
:
relative
=
Path
(
package
.
source_url
)
/
dep
.
package
.
source_url
dep
.
package
.
source_url
=
relative
.
as_posix
()
package
.
requires
=
dependencies
return
package
...
...
tests/fixtures/directory/project_with_transitive_directory_dependencies/project_with_transitive_directory_dependencies/__init__.py
0 → 100644
View file @
fbb90678
tests/fixtures/directory/project_with_transitive_directory_dependencies/pyproject.toml
0 → 100644
View file @
fbb90678
[tool.poetry]
name
=
"project-with-transitive-directory-dependencies"
version
=
"1.2.3"
description
=
"This is a description"
authors
=
[
"Your Name <you@example.com>"
]
license
=
"MIT"
[tool.poetry.dependencies]
python
=
"*"
project-with-extras
=
{path
=
"../../project_with_extras/"
}
[tool.poetry.dev-dependencies]
tests/fixtures/directory/project_with_transitive_directory_dependencies/setup.py
0 → 100644
View file @
fbb90678
# -*- coding: utf-8 -*-
from
distutils.core
import
setup
packages
=
[
"project_with_extras"
]
package_data
=
{
""
:
[
"*"
]}
extras_require
=
{
"extras_a"
:
[
"pendulum>=1.4.4"
],
"extras_b"
:
[
"cachy>=0.2.0"
]}
setup_kwargs
=
{
"name"
:
"project-with-extras"
,
"version"
:
"1.2.3"
,
"description"
:
"This is a description"
,
"long_description"
:
None
,
"author"
:
"Your Name"
,
"author_email"
:
"you@example.com"
,
"url"
:
None
,
"packages"
:
packages
,
"package_data"
:
package_data
,
"extras_require"
:
extras_require
,
}
setup
(
**
setup_kwargs
)
tests/installation/fixtures/with-directory-dependency-poetry-transitive.test
0 → 100644
View file @
fbb90678
[[
package
]]
description
=
""
category
=
"dev"
name
=
"cachy"
optional
=
true
python
-
versions
=
"*"
version
=
"0.2.0"
[[
package
]]
description
=
""
category
=
"dev"
name
=
"pendulum"
optional
=
true
python
-
versions
=
"*"
version
=
"1.4.4"
[[
package
]]
category
=
"main"
description
=
""
name
=
"project-with-extras"
optional
=
false
python
-
versions
=
"*"
version
=
"1.2.3"
[
package
.
source
]
reference
=
""
type
=
"directory"
url
=
"tests/fixtures/directory/project_with_transitive_directory_dependencies/../../project_with_extras"
[[
package
]]
category
=
"main"
description
=
""
name
=
"project-with-transitive-directory-dependencies"
optional
=
false
python
-
versions
=
"*"
version
=
"1.2.3"
[
package
.
dependencies
]
project
-
with
-
extras
=
"1.2.3"
[
package
.
source
]
reference
=
""
type
=
"directory"
url
=
"tests/fixtures/directory/project_with_transitive_directory_dependencies"
[
metadata
]
content
-
hash
=
"123456789"
python
-
versions
=
"*"
[
metadata
.
hashes
]
cachy
=
[]
project
-
with
-
extras
=
[]
project
-
with
-
transitive
-
directory
-
dependencies
=
[]
pendulum
=
[]
tests/installation/test_installer.py
View file @
fbb90678
...
...
@@ -624,6 +624,26 @@ def test_run_installs_with_local_poetry_directory_and_extras(
assert
len
(
installer
.
installer
.
installs
)
==
2
def
test_run_installs_with_local_poetry_directory_transitive
(
installer
,
locker
,
repo
,
package
,
tmpdir
):
file_path
=
Path
(
"tests/fixtures/directory/project_with_transitive_directory_dependencies/"
)
package
.
add_dependency
(
"demo"
,
{
"path"
:
str
(
file_path
)})
repo
.
add_package
(
get_package
(
"pendulum"
,
"1.4.4"
))
repo
.
add_package
(
get_package
(
"cachy"
,
"0.2.0"
))
installer
.
run
()
expected
=
fixture
(
"with-directory-dependency-poetry-transitive"
)
assert
locker
.
written_data
==
expected
assert
len
(
installer
.
installer
.
installs
)
==
2
def
test_run_installs_with_local_setuptools_directory
(
installer
,
locker
,
repo
,
package
,
tmpdir
):
...
...
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