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
30965bb2
Unverified
Commit
30965bb2
authored
Oct 19, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix virtualenv detection
parent
77618678
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
CHANGELOG.md
+1
-0
poetry/utils/env.py
+3
-7
No files found.
CHANGELOG.md
View file @
30965bb2
...
...
@@ -5,6 +5,7 @@
### Fixed
-
Fixed possible error on some combinations of markers.
-
Fixed venv detection so that it only uses
`VIRTUAL_ENV`
to detect activated virtualenvs.
## [0.12.3] - 2018-10-18
...
...
poetry/utils/env.py
View file @
30965bb2
...
...
@@ -90,23 +90,19 @@ class Env(object):
return
self
.
_bin
(
"pip"
)
@classmethod
def
get
(
cls
,
reload
=
False
,
cwd
=
None
):
# type: (
IO, bool
) -> Env
def
get
(
cls
,
reload
=
False
,
cwd
=
None
):
# type: (
bool, Path
) -> Env
if
cls
.
_env
is
not
None
and
not
reload
:
return
cls
.
_env
# Check if we are inside a virtualenv or not
in_venv
=
(
os
.
environ
.
get
(
"VIRTUAL_ENV"
)
is
not
None
or
hasattr
(
sys
,
"real_prefix"
)
or
(
hasattr
(
sys
,
"base_prefix"
)
and
sys
.
base_prefix
!=
sys
.
prefix
)
)
in_venv
=
os
.
environ
.
get
(
"VIRTUAL_ENV"
)
is
not
None
if
not
in_venv
:
# Checking if a local virtualenv exists
if
cwd
and
(
cwd
/
".venv"
)
.
exists
():
venv
=
cwd
/
".venv"
return
VirtualEnv
(
Path
(
venv
)
)
return
VirtualEnv
(
venv
)
config
=
Config
.
create
(
"config.toml"
)
create_venv
=
config
.
setting
(
"settings.virtualenvs.create"
,
True
)
...
...
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