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
15f4ff5e
Commit
15f4ff5e
authored
Feb 19, 2017
by
Jim Fulton
Committed by
GitHub
Feb 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #337 from buildout/getting-started
draft getting started
parents
1362887c
683162f1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
874 additions
and
6 deletions
+874
-6
doc/contents.rst
doc/contents.rst
+1
-0
doc/getting-started.rst
doc/getting-started.rst
+794
-0
doc/topics/index.rst
doc/topics/index.rst
+5
-0
setup.py
setup.py
+2
-1
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+3
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+69
-5
No files found.
doc/contents.rst
View file @
15f4ff5e
...
@@ -12,6 +12,7 @@ Contents:
...
@@ -12,6 +12,7 @@ Contents:
:maxdepth: 2
:maxdepth: 2
index
index
getting-started
topics/index
topics/index
reference
reference
...
...
doc/getting-started.rst
0 → 100644
View file @
15f4ff5e
This diff is collapsed.
Click to expand it.
doc/topics/index.rst
View file @
15f4ff5e
...
@@ -6,3 +6,8 @@ Buildout Topics
...
@@ -6,3 +6,8 @@ Buildout Topics
:maxdepth: 2
:maxdepth: 2
.. todo:
.. todo:
variables-extending-and-substitutions
writing-recipes
bootstrapping
buildout-and-packaging
setup.py
View file @
15f4ff5e
...
@@ -92,7 +92,8 @@ setup(
...
@@ -92,7 +92,8 @@ setup(
],
],
include_package_data
=
True
,
include_package_data
=
True
,
entry_points
=
entry_points
,
entry_points
=
entry_points
,
extras_require
=
dict
(
test
=
[
'zope.testing'
,
'manuel'
]),
extras_require
=
dict
(
test
=
[
'zope.testing'
,
'manuel'
,
'ZEO ==4.3.1'
,
'zc.zdaemonrecipe'
]),
zip_safe
=
False
,
zip_safe
=
False
,
classifiers
=
[
classifiers
=
[
'Intended Audience :: Developers'
,
'Intended Audience :: Developers'
,
...
...
src/zc/buildout/testing.py
View file @
15f4ff5e
...
@@ -212,6 +212,9 @@ def buildoutSetUp(test):
...
@@ -212,6 +212,9 @@ def buildoutSetUp(test):
root_logger
.
removeHandler
(
handler
)
root_logger
.
removeHandler
(
handler
)
for
handler
in
handlers_before_set_up
:
for
handler
in
handlers_before_set_up
:
root_logger
.
addHandler
(
handler
)
root_logger
.
addHandler
(
handler
)
bo_logger
=
logging
.
getLogger
(
'zc.buildout'
)
for
handler
in
bo_logger
.
handlers
[:]:
bo_logger
.
removeHandler
(
handler
)
register_teardown
(
restore_root_logger_handlers
)
register_teardown
(
restore_root_logger_handlers
)
base
=
tempfile
.
mkdtemp
(
'buildoutSetUp'
)
base
=
tempfile
.
mkdtemp
(
'buildoutSetUp'
)
...
...
src/zc/buildout/tests.py
View file @
15f4ff5e
...
@@ -13,12 +13,13 @@
...
@@ -13,12 +13,13 @@
#
#
##############################################################################
##############################################################################
from
zc.buildout.buildout
import
print_
from
zc.buildout.buildout
import
print_
from
zope.testing
import
renormalizing
from
zope.testing
import
renormalizing
,
setupstack
import
doctest
import
doctest
import
manuel.capture
import
manuel.capture
import
manuel.doctest
import
manuel.doctest
import
manuel.testing
import
manuel.testing
from
multiprocessing
import
Process
import
os
import
os
import
pkg_resources
import
pkg_resources
import
re
import
re
...
@@ -3422,10 +3423,14 @@ def updateSetup(test):
...
@@ -3422,10 +3423,14 @@ def updateSetup(test):
makeNewRelease
(
dist
.
key
,
ws
,
new_releases
)
makeNewRelease
(
dist
.
key
,
ws
,
new_releases
)
os
.
mkdir
(
os
.
path
.
join
(
new_releases
,
dist
.
key
))
os
.
mkdir
(
os
.
path
.
join
(
new_releases
,
dist
.
key
))
bootstrap_py
=
os
.
path
.
join
(
def
ancestor
(
path
,
level
):
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
while
level
>
0
:
os
.
path
.
dirname
(
__file__
)))),
path
=
os
.
path
.
dirname
(
path
)
'bootstrap'
,
'bootstrap.py'
)
level
-=
1
return
path
bootstrap_py
=
os
.
path
.
join
(
ancestor
(
__file__
,
4
),
'bootstrap'
,
'bootstrap.py'
)
def
bootstrapSetup
(
test
):
def
bootstrapSetup
(
test
):
buildout_txt_setup
(
test
)
buildout_txt_setup
(
test
)
...
@@ -3449,6 +3454,15 @@ normalize_S = (
...
@@ -3449,6 +3454,15 @@ normalize_S = (
'#!/usr/local/bin/python2.7'
,
'#!/usr/local/bin/python2.7'
,
)
)
def
run_buildout
(
command
):
os
.
environ
[
'HOME'
]
=
os
.
getcwd
()
# Make sure we don't get .buildout
args
=
command
.
strip
().
split
()
import
pkg_resources
buildout
=
pkg_resources
.
load_entry_point
(
'zc.buildout'
,
'console_scripts'
,
args
[
0
])
sys
.
stdout
=
sys
.
stderr
=
open
(
'out'
,
'w'
)
buildout
(
args
[
1
:])
def
test_suite
():
def
test_suite
():
test_suite
=
[
test_suite
=
[
manuel
.
testing
.
TestSuite
(
manuel
.
testing
.
TestSuite
(
...
@@ -3710,6 +3724,56 @@ def test_suite():
...
@@ -3710,6 +3724,56 @@ def test_suite():
unittest.makeSuite(UnitTests),
unittest.makeSuite(UnitTests),
]
]
docdir = os.path.join(ancestor(__file__, 4), '
doc
')
if os.path.exists(docdir) and not sys.platform.startswith('
win
'):
# Note that the purpose of the documentation tests are mainly
# to test the documentation, not to test buildout.
def docSetUp(test):
extra_options = (
" use-dependency-links=false"
# Leaving this here so we can uncomment to see what'
s
going
on
.
#" log-format=%(asctime)s____%(levelname)s_%(message)s -vvv"
" index="
+
os
.
path
.
join
(
ancestor
(
__file__
,
4
),
'doc'
)
)
def
run_buildout_in_process
(
command
=
'buildout'
):
process
=
Process
(
target
=
run_buildout
,
args
=
(
command
+
extra_options
,
),
)
process
.
daemon
=
True
process
.
start
()
process
.
join
(
99
)
if
process
.
is_alive
()
or
process
.
exitcode
:
print
(
read
())
def
read
(
path
=
'out'
):
with
open
(
path
)
as
f
:
return
f
.
read
()
def
write
(
text
,
path
):
with
open
(
path
,
'w'
)
as
f
:
f
.
write
(
text
)
test
.
globs
.
update
(
run_buildout
=
run_buildout_in_process
,
yup
=
lambda
cond
,
orelse
=
'Nope'
:
None
if
cond
else
orelse
,
nope
=
lambda
cond
,
orelse
=
'Nope'
:
orelse
if
cond
else
None
,
eq
=
lambda
a
,
b
:
None
if
a
==
b
else
(
a
,
b
),
eqs
=
lambda
a
,
*
b
:
None
if
set
(
a
)
==
set
(
b
)
else
(
a
,
b
),
read
=
read
,
write
=
write
,
)
setupstack
.
setUpDirectory
(
test
)
test_suite
.
append
(
manuel
.
testing
.
TestSuite
(
manuel
.
doctest
.
Manuel
()
+
manuel
.
capture
.
Manuel
(),
os
.
path
.
join
(
docdir
,
'getting-started.rst'
),
setUp
=
docSetUp
,
tearDown
=
setupstack
.
tearDown
))
# adding bootstrap.txt doctest to the suite
# adding bootstrap.txt doctest to the suite
# only if bootstrap.py is present
# only if bootstrap.py is present
if
os
.
path
.
exists
(
bootstrap_py
):
if
os
.
path
.
exists
(
bootstrap_py
):
...
...
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