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
4c1a43d1
Commit
4c1a43d1
authored
Nov 24, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use with statement in setup.py
parent
a37fa956
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
setup.py
setup.py
+12
-20
No files found.
setup.py
View file @
4c1a43d1
...
@@ -13,17 +13,15 @@ from distutils.util import convert_path
...
@@ -13,17 +13,15 @@ from distutils.util import convert_path
command_ns
=
{}
command_ns
=
{}
init_path
=
convert_path
(
'setuptools/command/__init__.py'
)
init_path
=
convert_path
(
'setuptools/command/__init__.py'
)
init_file
=
open
(
init_path
)
with
open
(
init_path
)
as
init_file
:
exec
(
init_file
.
read
(),
command_ns
)
exec
(
init_file
.
read
(),
command_ns
)
init_file
.
close
()
SETUP_COMMANDS
=
command_ns
[
'__all__'
]
SETUP_COMMANDS
=
command_ns
[
'__all__'
]
main_ns
=
{}
main_ns
=
{}
ver_path
=
convert_path
(
'setuptools/version.py'
)
ver_path
=
convert_path
(
'setuptools/version.py'
)
ver_file
=
open
(
ver_path
)
with
open
(
ver_path
)
as
ver_file
:
exec
(
ver_file
.
read
(),
main_ns
)
exec
(
ver_file
.
read
(),
main_ns
)
ver_file
.
close
()
import
setuptools
import
setuptools
from
setuptools.command.build_py
import
build_py
as
_build_py
from
setuptools.command.build_py
import
build_py
as
_build_py
...
@@ -70,23 +68,17 @@ class test(_test):
...
@@ -70,23 +68,17 @@ class test(_test):
_test
.
run
(
self
)
_test
.
run
(
self
)
return
# even though _test.run will raise SystemExit
return
# even though _test.run will raise SystemExit
f
=
open
(
entry_points
)
# save the content
with
open
(
entry_points
)
as
f
:
# running the test
try
:
ep_content
=
f
.
read
()
ep_content
=
f
.
read
()
finally
:
f
.
close
()
# run the test
try
:
try
:
_test
.
run
(
self
)
_test
.
run
(
self
)
finally
:
finally
:
# restoring the file
# restore the file
f
=
open
(
entry_points
,
'w'
)
with
open
(
entry_points
,
'w'
)
as
f
:
try
:
f
.
write
(
ep_content
)
f
.
write
(
ep_content
)
finally
:
f
.
close
()
readme_file
=
open
(
'README.txt'
)
readme_file
=
open
(
'README.txt'
)
...
@@ -96,9 +88,9 @@ if os.path.exists('CHANGES (links).txt'):
...
@@ -96,9 +88,9 @@ if os.path.exists('CHANGES (links).txt'):
else
:
else
:
# but if the release script has not run, fall back to the source file
# but if the release script has not run, fall back to the source file
changes_file
=
open
(
'CHANGES.txt'
)
changes_file
=
open
(
'CHANGES.txt'
)
long_description
=
readme_file
.
read
()
+
'
\
n
'
+
changes_file
.
read
()
with
readme_file
:
readme_file
.
close
()
with
changes_file
:
changes_file
.
close
()
long_description
=
readme_file
.
read
()
+
'
\
n
'
+
changes_file
.
read
()
package_data
=
{
'setuptools'
:
[
'site-patch.py'
]}
package_data
=
{
'setuptools'
:
[
'site-patch.py'
]}
if
sys
.
platform
==
'win32'
or
os
.
environ
.
get
(
"SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"
)
not
in
(
None
,
""
,
"0"
):
if
sys
.
platform
==
'win32'
or
os
.
environ
.
get
(
"SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"
)
not
in
(
None
,
""
,
"0"
):
...
...
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