Switch to four-spaces indentation in setup.py
(imported from commit 621e5755e8cfd7117e012f4245de0916e45060bb)
This commit is contained in:
parent
f9a800b046
commit
1f77ee4389
52
setup.py
52
setup.py
|
@ -9,18 +9,18 @@ import sys
|
||||||
import itertools
|
import itertools
|
||||||
|
|
||||||
def version():
|
def version():
|
||||||
version_py = os.path.join(os.path.dirname(__file__), "zulip", "__init__.py")
|
version_py = os.path.join(os.path.dirname(__file__), "zulip", "__init__.py")
|
||||||
with open(version_py) as in_handle:
|
with open(version_py) as in_handle:
|
||||||
version_line = itertools.dropwhile(lambda x: not x.startswith("__version__"),
|
version_line = itertools.dropwhile(lambda x: not x.startswith("__version__"),
|
||||||
in_handle).next()
|
in_handle).next()
|
||||||
version = version_line.split('=')[-1].strip().replace('"', '')
|
version = version_line.split('=')[-1].strip().replace('"', '')
|
||||||
return version
|
return version
|
||||||
|
|
||||||
def recur_expand(target_root, dir):
|
def recur_expand(target_root, dir):
|
||||||
for root, _, files in os.walk(dir):
|
for root, _, files in os.walk(dir):
|
||||||
paths = [os.path.join(root, f) for f in files]
|
paths = [os.path.join(root, f) for f in files]
|
||||||
if len(paths):
|
if len(paths):
|
||||||
yield os.path.join(target_root, root), paths
|
yield os.path.join(target_root, root), paths
|
||||||
|
|
||||||
# We should be installable with either setuptools or distutils.
|
# We should be installable with either setuptools or distutils.
|
||||||
package_info = dict(
|
package_info = dict(
|
||||||
|
@ -53,23 +53,23 @@ setuptools_info = dict(
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
package_info.update(setuptools_info)
|
package_info.update(setuptools_info)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from distutils.core import setup
|
from distutils.core import setup
|
||||||
from distutils.version import LooseVersion
|
from distutils.version import LooseVersion
|
||||||
# Manual dependency check
|
# Manual dependency check
|
||||||
try:
|
try:
|
||||||
import simplejson
|
import simplejson
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print >>sys.stderr, "simplejson is not installed"
|
print >>sys.stderr, "simplejson is not installed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
try:
|
try:
|
||||||
import requests
|
import requests
|
||||||
assert(LooseVersion(requests.__version__) >= LooseVersion('0.12.1'))
|
assert(LooseVersion(requests.__version__) >= LooseVersion('0.12.1'))
|
||||||
except (ImportError, AssertionError):
|
except (ImportError, AssertionError):
|
||||||
print >>sys.stderr, "requests >=0.12.1 is not installed"
|
print >>sys.stderr, "requests >=0.12.1 is not installed"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
setup(**package_info)
|
setup(**package_info)
|
||||||
|
|
Loading…
Reference in a new issue