diff --git a/CHANGES.rst b/CHANGES.rst index db9ce74..56e3606 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -24,6 +24,9 @@ Changes - The ``wsgilog`` option has been deprecated, the old apache mod_wsgi script hasn't been used for a long time. +- Removed old pth option, previously used for pinax. Pinax uses proper python + packages since a long time, so it isn't needed anymore. + 1.11 (2014-11-21) ----------------- diff --git a/README.rst b/README.rst index 4934341..a1f1c43 100644 --- a/README.rst +++ b/README.rst @@ -55,10 +55,6 @@ extra-paths path for the `bin/*` scripts. Use this if you have code somewhere without a proper ``setup.py``. -pth-files - Adds paths found from a site `.pth` file to the extra-paths. - Useful for things like Pinax which maintains its own external_libs dir. - control-script The name of the script created in the bin folder. This script is the equivalent of the `manage.py` Django normally creates. By default it @@ -135,49 +131,6 @@ The next example shows you how to use some more of the options:: dotted-settings-path = projectconfig.production.settings -Example using .pth files -------------------------- - -Pinax uses a .pth file to add a bunch of libraries to its path; we can -specify it's directory to get the libraries it specified added to our -path:: - - [buildout] - parts = PIL - svncode - myproject - versions=versions - - [versions] - django = 1.3 - - [PIL] - recipe = zc.recipe.egg:custom - egg = PIL - find-links = http://dist.repoze.org/ - - [svncode] - recipe = iw.recipe.subversion - urls = http://svn.pinaxproject.com/pinax/tags/0.5.1rc1 pinax - - [myproject] - recipe = djangorecipe - eggs = - PIL - project = myproject - settings = settings - extra-paths = ${buildout:directory}/myproject/apps - ${svncode:location}/pinax/apps/external_apps - ${svncode:location}/pinax/apps/local_apps - pth-files = ${svncode:location}/pinax/libs/external_libs - wsgi = true - -Above, we use stock Pinax for pth-files and extra-paths paths for -apps, and our own project for the path that will be found first in the -list. Note that we expect our project to be checked out (e.g., by -svn:external) directly under this directory in to 'myproject'. - - Example with a Django version from a repository --------------------------------------------------- diff --git a/src/djangorecipe/recipe.py b/src/djangorecipe/recipe.py index 46de6b2..aa4bbdf 100644 --- a/src/djangorecipe/recipe.py +++ b/src/djangorecipe/recipe.py @@ -145,23 +145,8 @@ def make_wsgi_script(self, extra_paths, ws): def get_extra_paths(self): extra_paths = [self.buildout['buildout']['directory']] - - # Add libraries found by a site .pth files to our extra-paths. - if 'pth-files' in self.options: - import site - for pth_file in self.options['pth-files'].splitlines(): - pth_libs = site.addsitedir(pth_file, set()) - if not pth_libs: - self.log.warning( - "No site *.pth libraries found for pth_file=%s", - pth_file) - else: - self.log.info("Adding *.pth libraries=%s", pth_libs) - self.options['extra-paths'] += '\n' + '\n'.join(pth_libs) - pythonpath = [p.replace('/', os.path.sep) for p in self.options['extra-paths'].splitlines() if p.strip()] - extra_paths.extend(pythonpath) return extra_paths diff --git a/src/djangorecipe/tests/tests.py b/src/djangorecipe/tests/tests.py index bb81031..60df038 100644 --- a/src/djangorecipe/tests/tests.py +++ b/src/djangorecipe/tests/tests.py @@ -115,23 +115,6 @@ def test_extra_paths(self, manage, working_set): self.assertEqual(manage.call_args[0][0][-2:], ['somepackage', 'anotherpackage']) - @mock.patch('zc.recipe.egg.egg.Scripts.working_set', - return_value=(None, [])) - @mock.patch('site.addsitedir', return_value=['extra', 'dirs']) - def test_pth_files(self, addsitedir, working_set): - - # When a pth-files option is set the recipe will use that to add more - # paths to extra-paths. - self.recipe.options['version'] = '1.0' - - # The mock values needed to demonstrate the pth-files option. - self.recipe.options['pth-files'] = 'somedir' - self.recipe.install() - - self.assertEqual(addsitedir.call_args, (('somedir', set([])), {})) - # The extra-paths option has been extended. - self.assertEqual(self.recipe.options['extra-paths'], '\nextra\ndirs') - def test_settings_option(self): # The settings option can be used to specify the settings file # for Django to use. By default it uses `development`.