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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
49a79832
Commit
49a79832
authored
Apr 06, 2022
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: issues with auto-discovery
Solution: be explicit instead of relying on auto-discovery
parent
d08c74fb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
+23
-14
doc/getting-started.rst
doc/getting-started.rst
+2
-1
doc/topics/implicit-parts.rst
doc/topics/implicit-parts.rst
+2
-1
doc/topics/variables-extending-and-substitutions.rst
doc/topics/variables-extending-and-substitutions.rst
+4
-2
src/zc/buildout/tests/buildout.txt
src/zc/buildout/tests/buildout.txt
+4
-4
src/zc/buildout/tests/test_all.py
src/zc/buildout/tests/test_all.py
+11
-6
No files found.
doc/getting-started.rst
View file @
49a79832
...
...
@@ -692,11 +692,12 @@ Fortunately, an application setup script can be minimal. Here's an
example
::
from
setuptools
import
setup
setup
(
name
=
'main'
,
install_requires
=
[
'bobo'
,
'six'
])
setup
(
name
=
'main'
,
py_modules
=
'main'
,
install_requires
=
[
'bobo'
,
'six'
])
..
->
src
>>>
write
(
src
,
'setup.py'
)
>>>
write
(
'pass'
,
'main.py'
)
We
suggest
copying
and
modifying
the
example
above
,
using
it
as
boilerplate
.
As
is
probably
clear
,
the
setup
arguments
used
are
:
...
...
doc/topics/implicit-parts.rst
View file @
49a79832
...
...
@@ -28,7 +28,8 @@ are dependencies of the named parts. For example, in
.. -> src
>>> write(src, 'buildout.cfg')
>>> write("from setuptools import setup; setup(name='myapp')", 'setup.py')
>>> write("from setuptools import setup; setup(name='myapp', py_modules=['myapp'])", 'setup.py')
>>> write("pass", 'myapp.py')
>>> run_buildout('buildout annotate')
>>> run_buildout()
>>> print(read()) # doctest: +ELLIPSIS
...
...
doc/topics/variables-extending-and-substitutions.rst
View file @
49a79832
...
...
@@ -363,7 +363,8 @@ when running buildout:
.. -> src
>>> write("import setuptools; setuptools.setup(name='a')", "setup.py")
>>> write("import setuptools; setuptools.setup(name='a', py_modules=['a'])", "setup.py")
>>> write('pass', 'a.py')
>>> write("""
... [buildout]
... develop=.
...
...
@@ -376,8 +377,9 @@ when running buildout:
... b=1
... """, "buildout.cfg")
>>> os.mkdir('b')
>>> write("import setuptools; setuptools.setup(name='b', version=1)",
>>> write("import setuptools; setuptools.setup(name='b',
py_modules=['b'],
version=1)",
... "b", "setup.py")
>>> write('pass', 'b.py')
>>> run_buildout(src.replace('/path/to/other/project', 'b'))
>>> eqs(ls('develop-eggs'), 'b.egg-link', 'a.egg-link')
...
...
src/zc/buildout/tests/buildout.txt
View file @
49a79832
...
...
@@ -1166,7 +1166,7 @@ We also have to update our setup script::
... debug = debug:Debug
... environ = environ:Environ
... ''')
... setup(name="recipes", entry_points=entry_points)
... setup(name="recipes", entry_points=entry_points
, py_modules=['debug', 'environ']
)
... """)
We've rearranged the script a bit to make the entry points easier to
...
...
@@ -2264,7 +2264,7 @@ recipe::
... [zc.buildout.uninstall]
... service = service:uninstall_service
... ''')
... setup(name="recipes", entry_points=entry_points)
... setup(name="recipes", entry_points=entry_points
, py_modules=['debug', 'environ', 'service']
)
... """)
Here's how these recipes could be used in a buildout::
...
...
@@ -2375,7 +2375,7 @@ the ``mkdir`` recipe::
... uninstall_service = service:uninstall_service
... mkdir = backup:backup_directory
... ''')
... setup(name="recipes", entry_points=entry_points)
... setup(name="recipes", entry_points=entry_points
, py_modules=['debug', 'environ', 'service', 'backup']
)
... """)
Now we can use it with a ``mkdir`` part::
...
...
@@ -2439,7 +2439,7 @@ rest of the examples::
... mkdir = mkdir:Mkdir
... debug = debug:Debug
... ''')
... setup(name="recipes", entry_points=entry_points)
... setup(name="recipes", entry_points=entry_points
, py_modules=['debug', 'environ', 'service', 'backup']
)
... """)
...
...
src/zc/buildout/tests/test_all.py
View file @
49a79832
...
...
@@ -1238,11 +1238,13 @@ def extensions_installed_as_eggs_work_in_offline_mode():
'''
def
changes_in_svn_or_
CVS
_dont_affect_sig
():
def
changes_in_svn_or_
git
_dont_affect_sig
():
"""
If we have a develop recipe, it's signature shouldn't be affected to
changes in .git, .svn or CVS directories.
changes in .git, .svn directories.
CVS directories used to work as well but do not anymore.
>>> mkdir('recipe')
>>> write('recipe', 'setup.py',
...
...
@@ -1276,14 +1278,14 @@ changes in .git, .svn or CVS directories.
>>> mkdir('recipe', '.git')
>>> mkdir('recipe', '.svn')
>>> mkdir('recipe', 'CVS')
>>>
# deprecated CVS
mkdir('recipe', 'CVS')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe'
Updating foo.
>>> write('recipe', '.git', 'x', '1')
>>> write('recipe', '.svn', 'x', '1')
>>> write('recipe', 'CVS', 'x', '1')
>>>
# deprecated CVS
write('recipe', 'CVS', 'x', '1')
>>> print_(system(join(sample_buildout, 'bin', 'buildout')), end='')
Develop: '/sample-buildout/recipe'
...
...
@@ -1640,6 +1642,7 @@ def whine_about_unused_options():
... """
... from setuptools import setup
... setup(name = "foo",
... py_modules=['foo'],
... entry_points = {'zc.buildout': ['default = foo:Foo']},
... )
... """)
...
...
@@ -2039,8 +2042,9 @@ if sys.version_info > (2, 4):
>>> write('setup.py',
... '''
... from setuptools import setup
... setup(name='zc.buildout.testexit', entry_points={
... 'zc.buildout': ['default = testexitrecipe:x']})
... setup(name='zc.buildout.testexit',
... py_modules=['testexitrecipe'],
... entry_points={'zc.buildout': ['default = testexitrecipe:x']})
... ''')
>>> write('testexitrecipe.py',
...
...
@@ -2101,6 +2105,7 @@ def bug_59270_recipes_always_start_in_buildout_dir():
... '''
... from setuptools import setup
... setup(name='bad.test',
... py_modules=['bad_recipe'],
... entry_points={'zc.buildout': ['default=bad_recipe:Bad']},)
... ''')
...
...
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