Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
9bcc9042
Commit
9bcc9042
authored
Jul 20, 2013
by
Yusuke Tsutsumi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bootstrap.py that no longer uses site-packages
parent
7dc7b399
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
24 deletions
+27
-24
bootstrap/bootstrap.py
bootstrap/bootstrap.py
+27
-24
No files found.
bootstrap/bootstrap.py
View file @
9bcc9042
...
@@ -63,32 +63,35 @@ options, args = parser.parse_args()
...
@@ -63,32 +63,35 @@ options, args = parser.parse_args()
######################################################################
######################################################################
# load/install setuptools
# load/install setuptools
to_reload
=
False
try
:
try
:
import
pkg_resources
from
urllib.request
import
urlopen
import
setuptools
except
ImportError
:
except
ImportError
:
ez
=
{}
from
urllib2
import
urlopen
try
:
ez
=
{}
from
urllib.request
import
urlopen
# XXX use a more permanent ez_setup.py URL when available.
except
ImportError
:
exec
(
urlopen
(
'https://bitbucket.org/pypa/setuptools/downloads/ez_setup.py'
from
urllib2
import
urlopen
).
read
(),
ez
)
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
)
# XXX use a more permanent ez_setup.py URL when available.
ez
[
'use_setuptools'
](
**
setup_args
)
exec
(
urlopen
(
'https://bitbucket.org/pypa/setuptools/raw/0.7.2/ez_setup.py'
import
setuptools
).
read
(),
ez
)
# ez_setup imports site, which adds site packages
setup_args
=
dict
(
to_dir
=
tmpeggs
,
download_delay
=
0
)
ez
[
'use_setuptools'
](
**
setup_args
)
# this will remove them to ensure that incompataible versions
# of setuptools are not installed
if
to_reload
:
import
site
reload
(
pkg_resources
)
# inside a virtualenv, there is no 'getsitepackages'.
import
pkg_resources
# We can't remove these reliably
# This does not (always?) update the default working set. We will
if
hasattr
(
site
,
'getsitepackages'
):
# do it.
for
sitepackage_path
in
site
.
getsitepackages
():
for
path
in
sys
.
path
:
sys
.
path
[:]
=
[
x
for
x
in
sys
.
path
if
sitepackage_path
not
in
x
]
if
path
not
in
pkg_resources
.
working_set
.
entries
:
pkg_resources
.
working_set
.
add_entry
(
path
)
import
pkg_resources
# This does not (always?) update the default working set. We will
# do it.
for
path
in
sys
.
path
:
if
path
not
in
pkg_resources
.
working_set
.
entries
:
pkg_resources
.
working_set
.
add_entry
(
path
)
######################################################################
######################################################################
# Install buildout
# Install buildout
...
...
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