mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
import setuptools if SETUPTOOLS env var exists
Default to importing distutils unless the user has created an environment variable named SETUPTOOLS in which case import setuptools
This commit is contained in:
parent
0911c130a7
commit
7d89ee3783
1 changed files with 9 additions and 5 deletions
14
setup.py
14
setup.py
|
@ -14,12 +14,16 @@ from distutils.sysconfig import get_python_lib, PREFIX
|
|||
# Use setuptools if available, else fallback to distutils.
|
||||
# As an example, setuptools is available in virtualenvs and buildouts through
|
||||
# Setuptools or Distribute.
|
||||
try:
|
||||
from setuptools import setup
|
||||
with_setuptools = True
|
||||
except ImportError:
|
||||
with_setuptools = False
|
||||
if 'SETUPTOOLS' in os.environ:
|
||||
try:
|
||||
from setuptools import setup
|
||||
with_setuptools = True
|
||||
except:
|
||||
with_setuptools = False
|
||||
|
||||
if with_setuptools == False:
|
||||
from distutils.core import setup
|
||||
with_setuptools = False
|
||||
|
||||
|
||||
exec(compile(open("salt/version.py").read(), "salt/version.py", 'exec'))
|
||||
|
|
Loading…
Add table
Reference in a new issue