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
a4838b76
Commit
a4838b76
authored
Sep 18, 2022
by
Sébastien Eustace
Committed by
Randy Döring
Feb 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change setting name for modern installation
parent
6eef349c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
10 deletions
+22
-10
src/poetry/config/config.py
+7
-3
src/poetry/console/commands/config.py
+1
-0
src/poetry/installation/executor.py
+5
-3
tests/console/commands/test_config.py
+3
-3
tests/installation/test_executor.py
+6
-1
No files found.
src/poetry/config/config.py
View file @
a4838b76
...
@@ -126,9 +126,13 @@ class Config:
...
@@ -126,9 +126,13 @@ class Config:
"experimental"
:
{
"experimental"
:
{
"new-installer"
:
True
,
"new-installer"
:
True
,
"system-git-client"
:
False
,
"system-git-client"
:
False
,
"wheel-installer"
:
True
,
},
},
"installer"
:
{
"parallel"
:
True
,
"max-workers"
:
None
,
"no-binary"
:
None
},
"installer"
:
{
"modern-installation"
:
True
,
"parallel"
:
True
,
"max-workers"
:
None
,
"no-binary"
:
None
,
},
}
}
def
__init__
(
def
__init__
(
...
@@ -270,7 +274,7 @@ class Config:
...
@@ -270,7 +274,7 @@ class Config:
"virtualenvs.options.prefer-active-python"
,
"virtualenvs.options.prefer-active-python"
,
"experimental.new-installer"
,
"experimental.new-installer"
,
"experimental.system-git-client"
,
"experimental.system-git-client"
,
"
experimental.wheel-installer
"
,
"
installer.modern-installation
"
,
"installer.parallel"
,
"installer.parallel"
,
}:
}:
return
boolean_normalizer
return
boolean_normalizer
...
...
src/poetry/console/commands/config.py
View file @
a4838b76
...
@@ -70,6 +70,7 @@ To remove a repository (repo is a short alias for repositories):
...
@@ -70,6 +70,7 @@ To remove a repository (repo is a short alias for repositories):
"virtualenvs.prefer-active-python"
:
(
boolean_validator
,
boolean_normalizer
),
"virtualenvs.prefer-active-python"
:
(
boolean_validator
,
boolean_normalizer
),
"experimental.new-installer"
:
(
boolean_validator
,
boolean_normalizer
),
"experimental.new-installer"
:
(
boolean_validator
,
boolean_normalizer
),
"experimental.system-git-client"
:
(
boolean_validator
,
boolean_normalizer
),
"experimental.system-git-client"
:
(
boolean_validator
,
boolean_normalizer
),
"installer.modern-installation"
:
(
boolean_validator
,
boolean_normalizer
),
"installer.parallel"
:
(
boolean_validator
,
boolean_normalizer
),
"installer.parallel"
:
(
boolean_validator
,
boolean_normalizer
),
"installer.max-workers"
:
(
lambda
val
:
int
(
val
)
>
0
,
int_normalizer
),
"installer.max-workers"
:
(
lambda
val
:
int
(
val
)
>
0
,
int_normalizer
),
"virtualenvs.prompt"
:
(
str
,
lambda
val
:
str
(
val
)),
"virtualenvs.prompt"
:
(
str
,
lambda
val
:
str
(
val
)),
...
...
src/poetry/installation/executor.py
View file @
a4838b76
...
@@ -61,7 +61,9 @@ class Executor:
...
@@ -61,7 +61,9 @@ class Executor:
self
.
_enabled
=
True
self
.
_enabled
=
True
self
.
_verbose
=
False
self
.
_verbose
=
False
self
.
_wheel_installer
=
WheelInstaller
(
self
.
_env
)
self
.
_wheel_installer
=
WheelInstaller
(
self
.
_env
)
self
.
_use_wheel_installer
=
config
.
get
(
"experimental.wheel-installer"
,
True
)
self
.
_use_modern_installation
=
config
.
get
(
"installer.modern-installation"
,
True
)
if
parallel
is
None
:
if
parallel
is
None
:
parallel
=
config
.
get
(
"installer.parallel"
,
True
)
parallel
=
config
.
get
(
"installer.parallel"
,
True
)
...
@@ -477,7 +479,7 @@ class Executor:
...
@@ -477,7 +479,7 @@ class Executor:
def
_install
(
self
,
operation
:
Install
|
Update
)
->
int
:
def
_install
(
self
,
operation
:
Install
|
Update
)
->
int
:
package
=
operation
.
package
package
=
operation
.
package
if
package
.
source_type
==
"directory"
and
not
self
.
_use_
wheel_installer
:
if
package
.
source_type
==
"directory"
and
not
self
.
_use_
modern_installation
:
return
self
.
_install_directory_without_wheel_installer
(
operation
)
return
self
.
_install_directory_without_wheel_installer
(
operation
)
cleanup_archive
:
bool
=
False
cleanup_archive
:
bool
=
False
...
@@ -502,7 +504,7 @@ class Executor:
...
@@ -502,7 +504,7 @@ class Executor:
)
)
self
.
_write
(
operation
,
message
)
self
.
_write
(
operation
,
message
)
if
not
self
.
_use_
wheel_installer
:
if
not
self
.
_use_
modern_installation
:
return
self
.
pip_install
(
archive
,
upgrade
=
operation
.
job_type
==
"update"
)
return
self
.
pip_install
(
archive
,
upgrade
=
operation
.
job_type
==
"update"
)
try
:
try
:
...
...
tests/console/commands/test_config.py
View file @
a4838b76
...
@@ -53,8 +53,8 @@ def test_list_displays_default_value_if_not_set(
...
@@ -53,8 +53,8 @@ def test_list_displays_default_value_if_not_set(
expected
=
f
"""cache-dir = {cache_dir}
expected
=
f
"""cache-dir = {cache_dir}
experimental.new-installer = true
experimental.new-installer = true
experimental.system-git-client = false
experimental.system-git-client = false
experimental.wheel-installer = true
installer.max-workers = null
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.no-binary = null
installer.parallel = true
installer.parallel = true
virtualenvs.create = true
virtualenvs.create = true
...
@@ -83,8 +83,8 @@ def test_list_displays_set_get_setting(
...
@@ -83,8 +83,8 @@ def test_list_displays_set_get_setting(
expected
=
f
"""cache-dir = {cache_dir}
expected
=
f
"""cache-dir = {cache_dir}
experimental.new-installer = true
experimental.new-installer = true
experimental.system-git-client = false
experimental.system-git-client = false
experimental.wheel-installer = true
installer.max-workers = null
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.no-binary = null
installer.parallel = true
installer.parallel = true
virtualenvs.create = false
virtualenvs.create = false
...
@@ -137,8 +137,8 @@ def test_list_displays_set_get_local_setting(
...
@@ -137,8 +137,8 @@ def test_list_displays_set_get_local_setting(
expected
=
f
"""cache-dir = {cache_dir}
expected
=
f
"""cache-dir = {cache_dir}
experimental.new-installer = true
experimental.new-installer = true
experimental.system-git-client = false
experimental.system-git-client = false
experimental.wheel-installer = true
installer.max-workers = null
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.no-binary = null
installer.parallel = true
installer.parallel = true
virtualenvs.create = false
virtualenvs.create = false
...
...
tests/installation/test_executor.py
View file @
a4838b76
...
@@ -862,7 +862,12 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer(
...
@@ -862,7 +862,12 @@ def test_executor_fallback_on_poetry_create_error_without_wheel_installer(
"poetry.factory.Factory.create_poetry"
,
side_effect
=
RuntimeError
"poetry.factory.Factory.create_poetry"
,
side_effect
=
RuntimeError
)
)
config
.
merge
({
"cache-dir"
:
tmp_dir
,
"experimental"
:
{
"wheel-installer"
:
False
}})
config
.
merge
(
{
"cache-dir"
:
tmp_dir
,
"installer"
:
{
"modern-installation"
:
False
},
}
)
executor
=
Executor
(
env
,
pool
,
config
,
io
)
executor
=
Executor
(
env
,
pool
,
config
,
io
)
...
...
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