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
b2500b00
Commit
b2500b00
authored
Jun 29, 2018
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a zc.recipe.egg test case.
parent
9521ac53
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
2 deletions
+67
-2
src/zc/buildout/allow-unknown-extras.txt
src/zc/buildout/allow-unknown-extras.txt
+65
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+1
-1
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+1
-1
No files found.
src/zc/buildout/allow-unknown-extras.txt
0 → 100644
View file @
b2500b00
======================
Allow Unknown Extras
======================
Sometimes we need to allow unknown extras.
The ``allow-unknown-extras`` option lets us do that in a buildout
configuration, just as we can directly calling ``easy_install``
works exactly like the one provided in ``easy_install``.
Let's create a develop egg that requires a bogus extra.
>>> mkdir(sample_buildout, 'allowdemo')
>>> write(sample_buildout, 'allowdemo', 'dependencydemo.py',
... 'import eggrecipekss.core')
>>> write(sample_buildout, 'allowdemo', 'setup.py',
... '''from setuptools import setup; setup(
... name='allowdemo', py_modules=['dependencydemo'],
... zip_safe=True, version='1')
... ''')
Now let's configure the buildout to use the develop egg with a bogus extra.
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
... develop = allowdemo
... parts = eggs
...
... [eggs]
... recipe = zc.recipe.egg:eggs
... eggs = allowdemo[bad_extra]
... ''')
Now we can run the buildout and see that it fails:
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo'
Installing eggs...
...
While:
Installing eggs.
Error: Couldn't find the required extras. Add 'allow-unknown-extras=true' to the [buildout] configuration if this is acceptable.
If we flip the option on, the buildout succeeds
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
... develop = allowdemo
... parts = eggs
... allow-unknown-extras = true
...
... [eggs]
... recipe = zc.recipe.egg:eggs
... eggs = allowdemo[bad_extra]
... ''')
Now we can run the buildout and make sure all attempts to dist.plone.org fails::
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Develop: '/sample-buildout/allowdemo'
Installing eggs...
allowdemo 1 does not provide the extra 'bad_extra'
src/zc/buildout/tests.py
View file @
b2500b00
...
...
@@ -3712,7 +3712,7 @@ def test_suite():
doctest.DocFileSuite(
'
easy_install
.
txt
', '
downloadcache
.
txt
', '
dependencylinks
.
txt
',
'
allowhosts
.
txt
',
'
allowhosts
.
txt
',
'
allow
-
unknown
-
extras
.
txt
',
setUp=easy_install_SetUp,
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
b2500b00
...
...
@@ -84,7 +84,7 @@ class Eggs(object):
links
=
self
.
links
,
index
=
self
.
index
,
allow_hosts
=
self
.
allow_hosts
,
allow_unknown_extras
=
bool_option
(
buildout
[
'buildout'
]
,
'allow-unknown-extras'
)
allow_unknown_extras
=
bool_option
(
buildout
_section
,
'allow-unknown-extras'
)
)
return
orig_distributions
,
ws
...
...
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