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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
768a2fed
Commit
768a2fed
authored
Feb 21, 2017
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests for bootstrapping docs
parent
a6e11bdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
4 deletions
+84
-4
doc/topics/bootstrapping.rst
doc/topics/bootstrapping.rst
+79
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+5
-4
No files found.
doc/topics/bootstrapping.rst
View file @
768a2fed
...
@@ -41,6 +41,16 @@ the buildout in the current directory:
...
@@ -41,6 +41,16 @@ the buildout in the current directory:
buildout bootstrap
buildout bootstrap
.. -> src
>>> import os
>>> eqs(os.listdir("."))
>>> write("[buildout]\nparts=\n", 'buildout.cfg')
>>> run_buildout(src)
>>> eqs(os.listdir("."),
... 'buildout.cfg', 'out', 'eggs', 'bin', 'develop-eggs', 'parts')
If you have any other buildouts that have local ``buildout`` scripts, you
If you have any other buildouts that have local ``buildout`` scripts, you
can use their ``buildout`` scripts:
can use their ``buildout`` scripts:
...
@@ -60,12 +70,34 @@ If you download::
...
@@ -60,12 +70,34 @@ If you download::
https://bootstrap.pypa.io/bootstrap-buildout.py
https://bootstrap.pypa.io/bootstrap-buildout.py
.. -> url
And then run it:
And then run it:
.. code-block:: console
.. code-block:: console
python bootstrap-buildout.py
python bootstrap-buildout.py
.. -> src
>>> os.mkdir('fresh'); os.chdir('fresh')
>>> eqs(os.listdir("."))
>>> from six.moves.urllib import request
>>> f = request.urlopen(url)
>>> write(f.read().decode('ascii'), 'bootstrap-buildout.py')
>>> f.close()
>>> write("[buildout]\nparts=\n", 'buildout.cfg')
>>> import subprocess, sys
>>> src = src.replace('python', sys.executable).split()
>>> p = subprocess.Popen(
... src, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
... env=dict(HOME='zzzzz'))
>>> if p.wait():
... print(p.stderr.read())
>>> eqs(os.listdir("."), 'bootstrap-buildout.py',
... 'buildout.cfg', 'eggs', 'bin', 'develop-eggs', 'parts')
>>> os.chdir('..')
It will download the software needed to run Buildout and install it in
It will download the software needed to run Buildout and install it in
the current directory.
the current directory.
...
@@ -104,12 +136,38 @@ If you don't have one, you can use the :ref:`init subcommand
...
@@ -104,12 +136,38 @@ If you don't have one, you can use the :ref:`init subcommand
buildout init
buildout init
.. -> src
>>> os.mkdir('init'); os.chdir('init')
>>> eqs(os.listdir("."))
>>> run_buildout(src)
>>> eqs(os.listdir("."),
... 'buildout.cfg', 'out', 'eggs', 'bin', 'develop-eggs', 'parts')
>>> os.chdir('..')
This can be used with the bootstrapping script as well:
This can be used with the bootstrapping script as well:
.. code-block:: console
.. code-block:: console
python bootstrap-buildout.py init
python bootstrap-buildout.py init
.. -> src
>>> os.mkdir('fresh2'); os.chdir('fresh2')
>>> eqs(os.listdir("."))
>>> f = request.urlopen(url)
>>> write(f.read().decode('ascii'), 'bootstrap-buildout.py')
>>> f.close()
>>> src = src.replace('python', sys.executable).split()
>>> p = subprocess.Popen(
... src, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
... env=dict(HOME='zzzzz'))
>>> if p.wait():
... print(p.stderr.read())
>>> eqs(os.listdir("."), 'bootstrap-buildout.py',
... 'buildout.cfg', 'eggs', 'bin', 'develop-eggs', 'parts')
This creates an empty Buildout configuration:
This creates an empty Buildout configuration:
.. code-block:: ini
.. code-block:: ini
...
@@ -117,6 +175,14 @@ This creates an empty Buildout configuration:
...
@@ -117,6 +175,14 @@ This creates an empty Buildout configuration:
[buildout]
[buildout]
parts =
parts =
.. -> src
>>> eq(src, read('buildout.cfg'))
>>> os.chdir('..')
>>> os.chdir('init')
>>> eq(src, read('buildout.cfg'))
>>> os.chdir('..')
If you know you're going to use some packages, you can supply
If you know you're going to use some packages, you can supply
requirements on the command line after ``init``:
requirements on the command line after ``init``:
...
@@ -124,6 +190,14 @@ requirements on the command line after ``init``:
...
@@ -124,6 +190,14 @@ requirements on the command line after ``init``:
buildout init ZODB six
buildout init ZODB six
.. -> src
>>> os.mkdir('init2'); os.chdir('init2')
>>> eqs(os.listdir("."))
>>> run_buildout(src)
>>> eqs(os.listdir("."), '.installed.cfg',
... 'buildout.cfg', 'out', 'eggs', 'bin', 'develop-eggs', 'parts')
In which case it will generate and run a buildout that uses them. The
In which case it will generate and run a buildout that uses them. The
command above would generate a buildout configuration file:
command above would generate a buildout configuration file:
...
@@ -139,6 +213,11 @@ command above would generate a buildout configuration file:
...
@@ -139,6 +213,11 @@ command above would generate a buildout configuration file:
ZODB
ZODB
six
six
.. -> src
>>> eq(src, read('buildout.cfg'))
>>> os.chdir('..')
This can provide an easy way to experiment with a package without
This can provide an easy way to experiment with a package without
adding it to your Python environment or creating a virtualenv.
adding it to your Python environment or creating a virtualenv.
src/zc/buildout/tests.py
View file @
768a2fed
...
@@ -3690,10 +3690,10 @@ def test_suite():
...
@@ -3690,10 +3690,10 @@ def test_suite():
" index="
+
os
.
path
.
join
(
ancestor
(
__file__
,
4
),
'doc'
)
" index="
+
os
.
path
.
join
(
ancestor
(
__file__
,
4
),
'doc'
)
)
)
def
run_buildout_in_process
(
command
=
'buildout'
):
def
run_buildout_in_process
(
command
=
'buildout'
):
process
=
Process
(
command
=
command
.
split
(
' '
,
1
)
target
=
run_buildout
,
command
.
insert
(
1
,
extra_options
)
args
=
(
command
+
extra_options
,
),
command
=
' '
.
join
(
command
)
)
process
=
Process
(
target
=
run_buildout
,
args
=
(
command
,
)
)
process
.
daemon
=
True
process
.
daemon
=
True
process
.
start
()
process
.
start
()
process
.
join
(
99
)
process
.
join
(
99
)
...
@@ -3723,6 +3723,7 @@ def test_suite():
...
@@ -3723,6 +3723,7 @@ def test_suite():
manuel
.
testing
.
TestSuite
(
manuel
.
testing
.
TestSuite
(
manuel
.
doctest
.
Manuel
()
+
manuel
.
capture
.
Manuel
(),
manuel
.
doctest
.
Manuel
()
+
manuel
.
capture
.
Manuel
(),
os
.
path
.
join
(
docdir
,
'getting-started.rst'
),
os
.
path
.
join
(
docdir
,
'getting-started.rst'
),
os
.
path
.
join
(
docdir
,
'topics'
,
'bootstrapping.rst'
),
setUp
=
docSetUp
,
tearDown
=
setupstack
.
tearDown
setUp
=
docSetUp
,
tearDown
=
setupstack
.
tearDown
))
))
...
...
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