diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-16 10:19:40 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-02-16 11:04:57 -0500 |
| commit | 7bb73a477de24069002516eb6eb1d755bed9d65b (patch) | |
| tree | 5a99e69846a4d5bf771a15273714c333f6e4cb5b /bootstrap.py | |
| parent | 43edec2506f901ab939390951383025682448edd (diff) | |
| download | external_python_setuptools-7bb73a477de24069002516eb6eb1d755bed9d65b.tar.gz external_python_setuptools-7bb73a477de24069002516eb6eb1d755bed9d65b.tar.bz2 external_python_setuptools-7bb73a477de24069002516eb6eb1d755bed9d65b.zip | |
Bootstrap the package unconditionally in setup.py. Fixes #2001.feature/implicit-bootstrap
Diffstat (limited to 'bootstrap.py')
| -rw-r--r-- | bootstrap.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/bootstrap.py b/bootstrap.py index 8fa9e4b5..43c7b2b2 100644 --- a/bootstrap.py +++ b/bootstrap.py @@ -1,16 +1,14 @@ """ If setuptools is not already installed in the environment, it's not possible to invoke setuptools' own commands. This routine will bootstrap this local -environment by creating a minimal egg-info directory and then invoking the -egg-info command to flesh out the egg-info directory. +environment by creating a minimal egg-info directory sufficient for +setuptools to build its own egg-info. """ from __future__ import unicode_literals import os -import sys import textwrap -import subprocess import io @@ -33,27 +31,17 @@ minimal_egg_info = textwrap.dedent(""" def ensure_egg_info(): - if os.path.exists('setuptools.egg-info'): - return - print("adding minimal entry_points") - add_minimal_info() - run_egg_info() + os.path.exists('setuptools.egg-info') or add_minimal_info() def add_minimal_info(): """ Build a minimal egg-info, enough to invoke egg_info """ - + print("Adding minimal entry_points.") os.mkdir('setuptools.egg-info') with io.open('setuptools.egg-info/entry_points.txt', 'w') as ep: ep.write(minimal_egg_info) -def run_egg_info(): - cmd = [sys.executable, 'setup.py', 'egg_info'] - print("Regenerating egg_info") - subprocess.check_call(cmd) - - __name__ == '__main__' and ensure_egg_info() |
