Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
04a306fa
Commit
04a306fa
authored
Jul 13, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use makedirs with future compatibility throughout setuptools. Ref #1083.
parent
902edffb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
10 deletions
+11
-10
setuptools/command/easy_install.py
setuptools/command/easy_install.py
+2
-3
setuptools/sandbox.py
setuptools/sandbox.py
+3
-3
setuptools/tests/files.py
setuptools/tests/files.py
+4
-2
setuptools/tests/test_manifest.py
setuptools/tests/test_manifest.py
+2
-2
No files found.
setuptools/command/easy_install.py
View file @
04a306fa
...
...
@@ -59,7 +59,7 @@ from pkg_resources import (
Distribution
,
PathMetadata
,
EggMetadata
,
WorkingSet
,
DistributionNotFound
,
VersionConflict
,
DEVELOP_DIST
,
)
import
pkg_resources
import
pkg_resources
.py31compat
# Turn on PEP440Warnings
warnings
.
filterwarnings
(
"default"
,
category
=
pkg_resources
.
PEP440Warning
)
...
...
@@ -544,8 +544,7 @@ class easy_install(Command):
if
ok_exists
:
os
.
unlink
(
ok_file
)
dirname
=
os
.
path
.
dirname
(
ok_file
)
if
not
os
.
path
.
exists
(
dirname
):
os
.
makedirs
(
dirname
)
pkg_resources
.
py31compat
.
makedirs
(
dirname
,
exist_ok
=
True
)
f
=
open
(
pth_file
,
'w'
)
except
(
OSError
,
IOError
):
self
.
cant_write_to_target
()
...
...
setuptools/sandbox.py
View file @
04a306fa
...
...
@@ -12,7 +12,7 @@ import textwrap
from
setuptools.extern
import
six
from
setuptools.extern.six.moves
import
builtins
,
map
import
pkg_resources
import
pkg_resources
.py31compat
if
sys
.
platform
.
startswith
(
'java'
):
import
org.python.modules.posix.PosixModule
as
_os
...
...
@@ -26,6 +26,7 @@ _open = open
from
distutils.errors
import
DistutilsError
from
pkg_resources
import
working_set
__all__
=
[
"AbstractSandbox"
,
"DirectorySandbox"
,
"SandboxViolation"
,
"run_setup"
,
]
...
...
@@ -73,8 +74,7 @@ def override_temp(replacement):
"""
Monkey-patch tempfile.tempdir with replacement, ensuring it exists
"""
if
not
os
.
path
.
isdir
(
replacement
):
os
.
makedirs
(
replacement
)
pkg_resources
.
py31compat
.
makedirs
(
replacement
,
exist_ok
=
True
)
saved
=
tempfile
.
tempdir
...
...
setuptools/tests/files.py
View file @
04a306fa
import
os
import
pkg_resources.py31compat
def
build_files
(
file_defs
,
prefix
=
""
):
"""
Build a set of files/directories, as described by the file_defs dictionary.
...
...
@@ -24,8 +27,7 @@ def build_files(file_defs, prefix=""):
for
name
,
contents
in
file_defs
.
items
():
full_name
=
os
.
path
.
join
(
prefix
,
name
)
if
isinstance
(
contents
,
dict
):
if
not
os
.
path
.
exists
(
full_name
):
os
.
makedirs
(
full_name
)
pkg_resources
.
py31compat
.
makedirs
(
full_name
,
exist_ok
=
True
)
build_files
(
contents
,
prefix
=
full_name
)
else
:
with
open
(
full_name
,
'w'
)
as
f
:
...
...
setuptools/tests/test_manifest.py
View file @
04a306fa
...
...
@@ -10,6 +10,7 @@ import itertools
from
distutils
import
log
from
distutils.errors
import
DistutilsTemplateError
import
pkg_resources.py31compat
from
setuptools.command.egg_info
import
FileList
,
egg_info
,
translate_pattern
from
setuptools.dist
import
Distribution
from
setuptools.extern
import
six
...
...
@@ -361,8 +362,7 @@ class TestFileListTest(TempDirTestCase):
for
file
in
files
:
file
=
os
.
path
.
join
(
self
.
temp_dir
,
file
)
dirname
,
basename
=
os
.
path
.
split
(
file
)
if
not
os
.
path
.
exists
(
dirname
):
os
.
makedirs
(
dirname
)
pkg_resources
.
py31compat
.
makedirs
(
dirname
,
exist_ok
=
True
)
open
(
file
,
'w'
).
close
()
def
test_process_template_line
(
self
):
...
...
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