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
9
Merge Requests
9
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
10e2f007
Commit
10e2f007
authored
Feb 21, 2008
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- applied patch fixing rmtree issues on Windows (patch by
Gottfried Ganssauge) (ajung)
parent
d2e46744
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
3 deletions
+111
-3
CHANGES.txt
CHANGES.txt
+6
-0
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+10
-3
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+29
-0
src/zc/buildout/windows.txt
src/zc/buildout/windows.txt
+66
-0
No files found.
CHANGES.txt
View file @
10e2f007
...
...
@@ -4,6 +4,12 @@ Status
Change History
**************
1.0.1 (unreleased)
==================
- applied patch fixing rmtree issues on Windows (patch by
Gottfried Ganssauge) (ajung)
1.0.0 (2008-01-13)
==================
...
...
src/zc/buildout/testing.py
View file @
10e2f007
...
...
@@ -87,6 +87,13 @@ def system(command, input=''):
def
get
(
url
):
return
urllib2
.
urlopen
(
url
).
read
()
def
_rmtree
(
path
):
def
retry_writeable
(
func
,
path
,
exc
):
os
.
chmod
(
path
,
0600
)
func
(
path
)
shutil
.
rmtree
(
path
,
onerror
=
retry_writeable
)
def
_runsetup
(
setup
,
executable
,
*
args
):
if
os
.
path
.
isdir
(
setup
):
setup
=
os
.
path
.
join
(
setup
,
'setup.py'
)
...
...
@@ -102,7 +109,7 @@ def _runsetup(setup, executable, *args):
os
.
chdir
(
d
)
os
.
spawnle
(
os
.
P_WAIT
,
executable
,
executable
,
setup
,
*
args
)
if
os
.
path
.
exists
(
'build'
):
shutil
.
rmtree
(
'build'
)
_
rmtree
(
'build'
)
finally
:
os
.
chdir
(
here
)
...
...
@@ -163,7 +170,7 @@ def buildoutSetUp(test):
base
=
tempfile
.
mkdtemp
(
'buildoutSetUp'
)
register_teardown
(
lambda
base
=
base
:
shutil
.
rmtree
(
base
))
register_teardown
(
lambda
base
=
base
:
_
rmtree
(
base
))
old_home
=
os
.
environ
.
get
(
'HOME'
)
os
.
environ
[
'HOME'
]
=
os
.
path
.
join
(
base
,
'bbbBadHome'
)
...
...
@@ -178,7 +185,7 @@ def buildoutSetUp(test):
os
.
mkdir
(
base
)
tmp
=
tempfile
.
mkdtemp
(
'buildouttests'
)
register_teardown
(
lambda
:
shutil
.
rmtree
(
tmp
))
register_teardown
(
lambda
:
_
rmtree
(
tmp
))
zc
.
buildout
.
easy_install
.
default_index_url
=
'file://'
+
tmp
os
.
environ
[
'buildout-testing-index-url'
]
=
(
...
...
src/zc/buildout/tests.py
View file @
10e2f007
...
...
@@ -2693,6 +2693,35 @@ def test_suite():
]),
),
zc.buildout.testselectingpython.test_suite(),
doctest.DocFileSuite(
'windows.txt',
setUp=zc.buildout.testing.buildoutSetUp,
tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
(re.compile('__buildout_signature__ = recipes-
\
S+
'
),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile('executable =
\
S+py
t
hon
\
S*
'
),
'executable = python'),
(re.compile('[-d] setuptools-
\
S+[.]egg
'
), 'setuptools.egg'),
(re.compile('zc.buildout(-
\
S+)?[.]egg(-li
n
k)?'),
'zc.buildout.egg'),
(re.compile('creating
\
S*se
t
up.cfg'), 'creating setup.cfg'),
(re.compile('hello
\
%sse
t
up' % os.path.sep), 'hello/setup'),
(re.compile('Picked: (
\
S+) =
\
S+'),
'Picked:
\
\
1 = V.V'),
(re.compile(r'We have a develop egg: zc.buildout (
\
S+)
'
),
'We have a develop egg: zc.buildout X.X.'),
(re.compile(r'
\
\
[
\
\
]?'), '/'),
(re.compile('WindowsError'), 'OSError'),
(re.compile(r'
\
[E
r
ror 17
\
] C
a
nnot create a file '
r'when that file already exists: '),
'[Errno 17] File exists: '
),
])
),
))
return suite
src/zc/buildout/windows.txt
0 → 100644
View file @
10e2f007
zc.buildout on MS-Windows
=========================
Certain aspects of every software project are dependent on the
operating system used.
The same - of course - applies to zc.buildout.
To test that windows doesn't get in the way, we'll test some system
dependent aspects.
The following recipe will create a read-only file which shutil.rmtree
can't delete.
>>> mkdir('recipe')
>>> write('recipe', 'recipe.py',
... '''
... import os
... class Recipe:
... def __init__(self, buildout, name, options):
... self.location = os.path.join(
... buildout['buildout']['parts-directory'],
... name)
...
... def install(self):
... print "can't remove read only files"
... if not os.path.exists (self.location):
... os.makedirs (self.location)
...
... name = os.path.join (self.location, 'readonly.txt')
... open (name, 'w').write ('this is a read only file')
... os.chmod (name, 0400)
... return ()
...
... update = install
... ''')
>>> write('recipe', 'setup.py',
... '''
... from setuptools import setup
... setup(name='spam', version='1', py_modules=['recipe'],
... entry_points={'zc.buildout': ['default = recipe:Recipe']},
... )
... ''')
>>> write('recipe', 'README', '')
>>> print system(buildout+' setup recipe bdist_egg'), # doctest: +ELLIPSIS
Running setup script 'recipe/setup.py'.
...
and we'll configure a buildout to use it:
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = foo
... find-links = %s
...
... [foo]
... recipe = spam
... ''' % join('recipe', 'dist'))
>>> print system(buildout),
Getting distribution for 'spam'.
Got spam 1.
Installing foo.
can't remove read only files
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