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
c77299ed
Unverified
Commit
c77299ed
authored
Jul 28, 2020
by
Aviram Hassan
Committed by
GitHub
Jul 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
executor: default to parallel operations
This change ensures that non fancy io can use parallel installs.
parent
cae154c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
poetry/installation/executor.py
+1
-4
tests/console/commands/test_add.py
+5
-3
tests/installation/test_executor.py
+4
-1
No files found.
poetry/installation/executor.py
View file @
c77299ed
...
@@ -29,7 +29,7 @@ from .operations.update import Update
...
@@ -29,7 +29,7 @@ from .operations.update import Update
class
Executor
(
object
):
class
Executor
(
object
):
def
__init__
(
self
,
env
,
pool
,
config
,
io
,
parallel
=
Non
e
):
def
__init__
(
self
,
env
,
pool
,
config
,
io
,
parallel
=
Tru
e
):
self
.
_env
=
env
self
.
_env
=
env
self
.
_io
=
io
self
.
_io
=
io
self
.
_dry_run
=
False
self
.
_dry_run
=
False
...
@@ -39,9 +39,6 @@ class Executor(object):
...
@@ -39,9 +39,6 @@ class Executor(object):
self
.
_chef
=
Chef
(
config
,
self
.
_env
)
self
.
_chef
=
Chef
(
config
,
self
.
_env
)
self
.
_chooser
=
Chooser
(
pool
,
self
.
_env
)
self
.
_chooser
=
Chooser
(
pool
,
self
.
_env
)
if
parallel
is
None
:
parallel
=
self
.
supports_fancy_output
()
if
parallel
:
if
parallel
:
# This should be directly handled by ThreadPoolExecutor
# This should be directly handled by ThreadPoolExecutor
# however, on some systems the number of CPUs cannot be determined
# however, on some systems the number of CPUs cannot be determined
...
...
tests/console/commands/test_add.py
View file @
c77299ed
...
@@ -253,7 +253,7 @@ Package operations: 4 installs, 0 updates, 0 removals
...
@@ -253,7 +253,7 @@ Package operations: 4 installs, 0 updates, 0 removals
• Installing demo (0.1.2 9cf87a2)
• Installing demo (0.1.2 9cf87a2)
"""
"""
assert
expected
==
tester
.
io
.
fetch_output
()
assert
expected
.
strip
()
==
tester
.
io
.
fetch_output
()
.
strip
()
assert
4
==
tester
.
_command
.
installer
.
executor
.
installations_count
assert
4
==
tester
.
_command
.
installer
.
executor
.
installations_count
content
=
app
.
poetry
.
file
.
read
()[
"tool"
][
"poetry"
]
content
=
app
.
poetry
.
file
.
read
()[
"tool"
][
"poetry"
]
...
@@ -512,8 +512,10 @@ Package operations: 4 installs, 0 updates, 0 removals
...
@@ -512,8 +512,10 @@ Package operations: 4 installs, 0 updates, 0 removals
• Installing tomlkit (0.5.5)
• Installing tomlkit (0.5.5)
• Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
• Installing demo (0.1.0 https://python-poetry.org/distributions/demo-0.1.0-py2.py3-none-any.whl)
"""
"""
# Order might be different, split into lines and compare the overall output.
assert
expected
==
tester
.
io
.
fetch_output
()
expected
=
set
(
expected
.
splitlines
())
output
=
set
(
tester
.
io
.
fetch_output
()
.
splitlines
())
assert
expected
==
output
assert
4
==
tester
.
_command
.
installer
.
executor
.
installations_count
assert
4
==
tester
.
_command
.
installer
.
executor
.
installations_count
content
=
app
.
poetry
.
file
.
read
()[
"tool"
][
"poetry"
]
content
=
app
.
poetry
.
file
.
read
()[
"tool"
][
"poetry"
]
...
...
tests/installation/test_executor.py
View file @
c77299ed
...
@@ -110,7 +110,10 @@ Package operations: 4 installs, 1 update, 1 removal
...
@@ -110,7 +110,10 @@ Package operations: 4 installs, 1 update, 1 removal
"""
.
format
(
"""
.
format
(
file_package
.
source_url
,
directory_package
.
source_url
file_package
.
source_url
,
directory_package
.
source_url
)
)
assert
expected
==
io
.
fetch_output
()
expected
=
set
(
expected
.
splitlines
())
output
=
set
(
io
.
fetch_output
()
.
splitlines
())
assert
expected
==
output
assert
5
==
len
(
env
.
executed
)
assert
5
==
len
(
env
.
executed
)
...
...
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