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
5d0c7965
Commit
5d0c7965
authored
Oct 23, 2020
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils/env: ensure user directories are created
parent
e9e6b324
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
3 deletions
+5
-3
poetry/masonry/builders/editable.py
+1
-1
poetry/utils/env.py
+1
-1
tests/utils/test_env_site.py
+3
-1
No files found.
poetry/masonry/builders/editable.py
View file @
5d0c7965
...
@@ -131,7 +131,7 @@ class EditableBuilder(Builder):
...
@@ -131,7 +131,7 @@ class EditableBuilder(Builder):
entry_points
=
self
.
convert_entry_points
()
entry_points
=
self
.
convert_entry_points
()
for
scripts_path
in
self
.
_env
.
script_dirs
:
for
scripts_path
in
self
.
_env
.
script_dirs
:
if
is_dir_writable
(
scripts_path
):
if
is_dir_writable
(
path
=
scripts_path
,
create
=
True
):
break
break
else
:
else
:
self
.
_io
.
error_line
(
self
.
_io
.
error_line
(
...
...
poetry/utils/env.py
View file @
5d0c7965
...
@@ -170,7 +170,7 @@ class SitePackages:
...
@@ -170,7 +170,7 @@ class SitePackages:
self
.
_writable_candidates
=
[]
self
.
_writable_candidates
=
[]
for
candidate
in
self
.
_candidates
:
for
candidate
in
self
.
_candidates
:
if
not
is_dir_writable
(
candidat
e
):
if
not
is_dir_writable
(
path
=
candidate
,
create
=
Tru
e
):
continue
continue
self
.
_writable_candidates
.
append
(
candidate
)
self
.
_writable_candidates
.
append
(
candidate
)
...
...
tests/utils/test_env_site.py
View file @
5d0c7965
...
@@ -5,7 +5,9 @@ from poetry.utils._compat import decode
...
@@ -5,7 +5,9 @@ from poetry.utils._compat import decode
from
poetry.utils.env
import
SitePackages
from
poetry.utils.env
import
SitePackages
def
test_env_site_simple
(
tmp_dir
):
def
test_env_site_simple
(
tmp_dir
,
mocker
):
# emulate permission error when creating directory
mocker
.
patch
(
"poetry.utils._compat.Path.mkdir"
,
side_effect
=
OSError
())
site_packages
=
SitePackages
(
Path
(
"/non-existent"
),
fallbacks
=
[
Path
(
tmp_dir
)])
site_packages
=
SitePackages
(
Path
(
"/non-existent"
),
fallbacks
=
[
Path
(
tmp_dir
)])
candidates
=
site_packages
.
make_candidates
(
Path
(
"hello.txt"
),
writable_only
=
True
)
candidates
=
site_packages
.
make_candidates
(
Path
(
"hello.txt"
),
writable_only
=
True
)
hello
=
Path
(
tmp_dir
)
/
"hello.txt"
hello
=
Path
(
tmp_dir
)
/
"hello.txt"
...
...
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