diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-02-24 11:49:51 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-02-24 11:49:51 -0500 |
commit | 3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6 (patch) | |
tree | 2286b3cd70544e0089f658e17ddb3fed4126b356 /bootstrap.py | |
parent | 4c560effc96a75f337193bc164ad4117b0e333ab (diff) | |
download | external_python_setuptools-3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6.tar.gz external_python_setuptools-3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6.tar.bz2 external_python_setuptools-3d0cc355fb5e8012cb8c72f0e25042a5a44f31d6.zip |
Revert "Merge pull request #933 from pypa/feature/581-depend-not-bundle"
This reverts commit 089cdeb489a0fa94d11b7307b54210ef9aa40511, reversing
changes made to aaec654d804cb78dbb6391afff721a63f26a71cd.
Diffstat (limited to 'bootstrap.py')
-rw-r--r-- | bootstrap.py | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/bootstrap.py b/bootstrap.py index ee3b53c8..24d7093c 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -5,14 +5,7 @@ environment by creating a minimal egg-info directory and then invoking the egg-info command to flesh out the egg-info directory. """ -from __future__ import unicode_literals - import os -import io -import re -import contextlib -import tempfile -import shutil import sys import textwrap import subprocess @@ -48,8 +41,7 @@ def build_egg_info(): """ os.mkdir('setuptools.egg-info') - filename = 'setuptools.egg-info/entry_points.txt' - with io.open(filename, 'w', encoding='utf-8') as ep: + with open('setuptools.egg-info/entry_points.txt', 'w') as ep: ep.write(minimal_egg_info) @@ -61,44 +53,9 @@ def run_egg_info(): subprocess.check_call(cmd) -def gen_deps(): - with io.open('setup.py', encoding='utf-8') as strm: - text = strm.read() - pattern = r'install_requires=\[(.*?)\]' - match = re.search(pattern, text, flags=re.M|re.DOTALL) - reqs = eval(match.group(1).replace('\n', '')) - with io.open('requirements.txt', 'w', encoding='utf-8') as reqs_file: - reqs_file.write('\n'.join(reqs)) - - -@contextlib.contextmanager -def install_deps(): - "Just in time make the deps available" - import pip - tmpdir = tempfile.mkdtemp() - args = [ - 'install', - '-t', tmpdir, - '-r', 'requirements.txt', - ] - pip.main(args) - os.environ['PYTHONPATH'] = tmpdir - try: - yield tmpdir - finally: - shutil.rmtree(tmpdir) - - def main(): ensure_egg_info() - gen_deps() - try: - # first assume dependencies are present - run_egg_info() - except Exception: - # but if that fails, try again with dependencies just in time - with install_deps(): - run_egg_info() + run_egg_info() __name__ == '__main__' and main() |