diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-07-23 13:26:53 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-07-23 13:26:53 -0400 |
commit | cc5004500ea05e868f9a661500f3fd29a4d05037 (patch) | |
tree | 93ff9972b09bb8477eb88a3cac402b10b8d43b0b /setup.py | |
parent | 09ca40cc931c611952d344b96d1d6a5bfd6b502c (diff) | |
download | external_python_setuptools-cc5004500ea05e868f9a661500f3fd29a4d05037.tar.gz external_python_setuptools-cc5004500ea05e868f9a661500f3fd29a4d05037.tar.bz2 external_python_setuptools-cc5004500ea05e868f9a661500f3fd29a4d05037.zip |
Move imports to the top
Diffstat (limited to 'setup.py')
-rwxr-xr-x | setup.py | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -7,6 +7,9 @@ import io import os import sys import textwrap +from distutils.util import convert_path + +import setuptools # Allow to run setup.py from another directory. os.chdir(os.path.dirname(os.path.abspath(__file__))) @@ -19,16 +22,13 @@ def require_metadata(): src_root = None -from distutils.util import convert_path +def read_commands(): + command_ns = {} + init_path = convert_path('setuptools/command/__init__.py') + with open(init_path) as init_file: + exec(init_file.read(), command_ns) + return command_ns['__all__'] -command_ns = {} -init_path = convert_path('setuptools/command/__init__.py') -with open(init_path) as init_file: - exec(init_file.read(), command_ns) - -SETUP_COMMANDS = command_ns['__all__'] - -import setuptools scripts = [] @@ -101,7 +101,7 @@ setup_params = dict( entry_points={ "distutils.commands": [ "%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals() - for cmd in SETUP_COMMANDS + for cmd in read_commands() ], "distutils.setup_keywords": [ "eager_resources = setuptools.dist:assert_string_list", |