Commit 7c5d5388 authored by Jason R. Coombs's avatar Jason R. Coombs

Trying a new technique. In this approach, setuptools is aware of its...

Trying a new technique. In this approach, setuptools is aware of its dependencies and when imported makes sure the vendored versions are present on sys.path.

--HG--
branch : feature/issue-229
parent 4d4dbd3c
......@@ -8,7 +8,6 @@ python:
- pypy
# command to run tests
script:
- export PYTHONPATH=`pwd`/six-*.egg
- python setup.py egg_info
- python setup.py test
- python setup.py ptr
......
......@@ -6,8 +6,6 @@ import sys
import textwrap
import contextlib
sys.path.append('six-1.7.3.egg')
# Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__)))
......
"""Extensions to the 'distutils' for large or complex distributions"""
__import__('setuptools.bootstrap').bootstrap.ensure_deps()
import os
import sys
import distutils.core
......
"""
When setuptools is installed in a clean environment, it doesn't have its
dependencies, so it can't run to install its dependencies. This module
checks those dependencies and if one or more are missing, it uses vendored
versions.
"""
import os
import sys
import glob
def ensure_deps():
"""
Detect if dependencies are installed and if not, use vendored versions.
"""
try:
__import__('six')
except ImportError:
use_vendor_deps()
def use_vendor_deps():
"""
Use vendored versions
"""
here = os.path.dirname(__file__)
eggs = glob.glob(here + '/_vendor/*.egg')
sys.path.extend(eggs)
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