Commit ff62dbc5 authored by rossp's avatar rossp

151820: Add the distribution directory to sys.path when running
the setup.py script so that the setup.py script can import modules
from the distribution directory.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@81246 62d5b8a3-27da-0310-9561-8e5933582275
parent d4bd9c8f
......@@ -33,6 +33,9 @@ Feature Changes
Bugs Fixed
----------
- 151820: Develop failed if the setup.py script imported modules in
the distribution directory.
- The setup command wasn't documented.
- The setup command failed if run in a directory without specifying a
......
......@@ -994,6 +994,7 @@ if _interactive:
runsetup_template = """
import sys
sys.path.insert(0, %(setupdir)r)
sys.path.insert(0, %(setuptools)r)
import os, setuptools
......
......@@ -2328,9 +2328,37 @@ We get an error if we specify anything but true or false:
"""
def develop_with_modules():
"""
Distribution setup scripts can import modules in the distribution directory:
>>> mkdir('foo')
>>> write('foo', 'bar.py',
... '''# empty
... ''')
>>> write('foo', 'setup.py',
... '''
... import bar
... from setuptools import setup
... setup(name="foo")
... ''')
>>> write('buildout.cfg',
... '''
... [buildout]
... develop = foo
... parts =
... ''')
>>> print system(join('bin', 'buildout')),
Develop: '/sample-buildout/foo'
>>> ls('develop-eggs')
- foo.egg-link
- zc.recipe.egg.egg-link
"""
######################################################################
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment