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
command_ns
=
{}
init_path
=
convert_path
(
'setuptools/command/__init__.py'
)
init_file
=
open
(
init_path
)
exec
(
init_file
.
read
(),
command_ns
)
init_file
.
close
()
with
open
(
init_path
)
as
init_file
:
exec
(
init_file
.
read
(),
command_ns
)
SETUP_COMMANDS
=
command_ns
[
'__all__'
]
main_ns
=
{}
ver_path
=
convert_path
(
'setuptools/version.py'
)
ver_file
=
open
(
ver_path
)
exec
(
ver_file
.
read
(),
main_ns
)
ver_file
.
close
()
with
open
(
ver_path
)
as
ver_file
:
exec
(
ver_file
.
read
(),
main_ns
)
import
setuptools
from
setuptools.command.build_py
import
build_py
as
_build_py
...
...
@@ -70,23 +68,17 @@ class test(_test):
_test
.
run
(
self
)
return
# even though _test.run will raise SystemExit
f
=
open
(
entry_points
)
# running the test
try
:
# save the content
with
open
(
entry_points
)
as
f
:
ep_content
=
f
.
read
()
finally
:
f
.
close
()
# run the test
try
:
_test
.
run
(
self
)
finally
:
# restoring the file
f
=
open
(
entry_points
,
'w'
)
try
:
# restore the file
with
open
(
entry_points
,
'w'
)
as
f
:
f
.
write
(
ep_content
)
finally
:
f
.
close
()
readme_file
=
open
(
'README.txt'
)
...
...
@@ -96,9 +88,9 @@ if os.path.exists('CHANGES (links).txt'):
else
:
# but if the release script has not run, fall back to the source file
changes_file
=
open
(
'CHANGES.txt'
)
long_description
=
readme_file
.
read
()
+
'
\
n
'
+
changes_file
.
read
()
readme_file
.
close
()
changes_file
.
close
()
with
readme_file
:
with
changes_file
:
long_description
=
readme_file
.
read
()
+
'
\
n
'
+
changes_file
.
read
()
package_data
=
{
'setuptools'
:
[
'site-patch.py'
]}
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