Commit cc500450 authored by Jason R. Coombs's avatar Jason R. Coombs

Move imports to the top

parent 09ca40cc
...@@ -7,6 +7,9 @@ import io ...@@ -7,6 +7,9 @@ import io
import os import os
import sys import sys
import textwrap import textwrap
from distutils.util import convert_path
import setuptools
# Allow to run setup.py from another directory. # Allow to run setup.py from another directory.
os.chdir(os.path.dirname(os.path.abspath(__file__))) os.chdir(os.path.dirname(os.path.abspath(__file__)))
...@@ -19,16 +22,13 @@ def require_metadata(): ...@@ -19,16 +22,13 @@ def require_metadata():
src_root = None 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 = [] scripts = []
...@@ -101,7 +101,7 @@ setup_params = dict( ...@@ -101,7 +101,7 @@ setup_params = dict(
entry_points={ entry_points={
"distutils.commands": [ "distutils.commands": [
"%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals() "%(cmd)s = setuptools.command.%(cmd)s:%(cmd)s" % locals()
for cmd in SETUP_COMMANDS for cmd in read_commands()
], ],
"distutils.setup_keywords": [ "distutils.setup_keywords": [
"eager_resources = setuptools.dist:assert_string_list", "eager_resources = setuptools.dist:assert_string_list",
......
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