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
f06d21eb
Unverified
Commit
f06d21eb
authored
Dec 11, 2019
by
Sébastien Eustace
Committed by
GitHub
Dec 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Poetry reporting a Python incompatibility when there is none (#1707)
parent
06cdc773
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
1 deletions
+37
-1
poetry/utils/env.py
+1
-1
tests/utils/test_env.py
+36
-0
No files found.
poetry/utils/env.py
View file @
f06d21eb
...
@@ -508,7 +508,7 @@ class EnvManager(object):
...
@@ -508,7 +508,7 @@ class EnvManager(object):
)
)
supported_python
=
self
.
_poetry
.
package
.
python_constraint
supported_python
=
self
.
_poetry
.
package
.
python_constraint
if
not
supported_python
.
allows
(
Version
.
parse
(
python_
minor
)):
if
not
supported_python
.
allows
(
Version
.
parse
(
python_
patch
)):
# The currently activated or chosen Python version
# The currently activated or chosen Python version
# is not compatible with the Python constraint specified
# is not compatible with the Python constraint specified
# for the project.
# for the project.
...
...
tests/utils/test_env.py
View file @
f06d21eb
...
@@ -664,6 +664,42 @@ def test_create_venv_does_not_try_to_find_compatible_versions_with_executable(
...
@@ -664,6 +664,42 @@ def test_create_venv_does_not_try_to_find_compatible_versions_with_executable(
assert
0
==
m
.
call_count
assert
0
==
m
.
call_count
def
test_create_venv_uses_patch_version_to_detect_compatibility
(
manager
,
poetry
,
config
,
mocker
):
if
"VIRTUAL_ENV"
in
os
.
environ
:
del
os
.
environ
[
"VIRTUAL_ENV"
]
version
=
Version
.
parse
(
"."
.
join
(
str
(
c
)
for
c
in
sys
.
version_info
[:
3
]))
poetry
.
package
.
python_versions
=
"^{}"
.
format
(
"."
.
join
(
str
(
c
)
for
c
in
sys
.
version_info
[:
3
])
)
venv_name
=
manager
.
generate_env_name
(
"simple-project"
,
str
(
poetry
.
file
.
parent
))
mocker
.
patch
(
"sys.version_info"
,
(
version
.
major
,
version
.
minor
,
version
.
patch
+
1
))
check_output
=
mocker
.
patch
(
"poetry.utils._compat.subprocess.check_output"
,
side_effect
=
check_output_wrapper
(
Version
.
parse
(
"3.6.9"
)),
)
m
=
mocker
.
patch
(
"poetry.utils.env.EnvManager.build_venv"
,
side_effect
=
lambda
*
args
,
**
kwargs
:
""
)
manager
.
create_venv
(
NullIO
())
assert
not
check_output
.
called
m
.
assert_called_with
(
str
(
Path
(
"/foo/virtualenvs/{}-py{}.{}"
.
format
(
venv_name
,
version
.
major
,
version
.
minor
)
)
),
executable
=
None
,
)
def
test_activate_with_in_project_setting_does_not_fail_if_no_venvs_dir
(
def
test_activate_with_in_project_setting_does_not_fail_if_no_venvs_dir
(
manager
,
poetry
,
config
,
tmp_dir
,
mocker
manager
,
poetry
,
config
,
tmp_dir
,
mocker
):
):
...
...
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