Skip to content

Commit

Permalink
adding cache compatibility for zc.buildout
Browse files Browse the repository at this point in the history
  • Loading branch information
toumorokoshi committed Mar 1, 2015
1 parent e6cc2fe commit ce570bb
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
15 changes: 15 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,18 @@ can cause eggs to be installed incorrectly (due to a misdetected root path)
## Tests TODO

* test to allow user paths in uranium script.

## Buildout compatiblity

We have to work with the buildout dictionary being an option set for a download cache:

Some plugins use it: https://github.com/gawel/gp.recipe.node/blob/master/gp/recipe/node/__init__.py#L75

Download object: https://github.com/buildout/buildout/blob/master/src/zc/buildout/download.py#L51

to do so, we need:

* 'download-cache' option
* 'directory' option
* 'offline' option
* 'install-from-cache'
3 changes: 3 additions & 0 deletions uranium/buildout_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,8 @@ def _buildout(self):
""" return a buildout """
return {
'directory': self._uranium.root,
'download-cache': '.cache',
'install-from-cache': 'false',
'offline': 'false',
'parts-directory': self._uranium.parts_directory
}
25 changes: 25 additions & 0 deletions uranium/tests/test_buildout_adapter/test_buildout_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,28 @@ def test_buildout_parts_directory(self):
"""
eq_(self.buildout['buildout']['parts-directory'],
os.path.join(self.temp_dir, 'parts'))

def test_download_cache(self):
"""
buildout provides a download cache.
we should use that.
"""
eq_(self.buildout['buildout']['download-cache'], '.cache')

def test_offline(self):
"""
uranium does not currently support an offline proprty,
so always return false.
"""
# configparser only supports strings.
# uranium should support real values
eq_(self.buildout['buildout']['offline'], 'false')

def test_install_from_cache(self):
"""
uranium does not currently support an offline proprty,
so always return false.
"""
# configparser only supports strings.
# uranium should support real values
eq_(self.buildout['buildout']['install-from-cache'], 'false')

0 comments on commit ce570bb

Please sign in to comment.