black: Reformat skipping string normalization.
This commit is contained in:
parent
5580c68ae5
commit
fba21bb00d
178 changed files with 6562 additions and 4469 deletions
|
@ -8,20 +8,24 @@ from typing import Any, Dict, Generator, List, Tuple
|
|||
with open("README.md") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
|
||||
def version() -> str:
|
||||
version_py = os.path.join(os.path.dirname(__file__), "zulip", "__init__.py")
|
||||
with open(version_py) as in_handle:
|
||||
version_line = next(itertools.dropwhile(lambda x: not x.startswith("__version__"),
|
||||
in_handle))
|
||||
version_line = next(
|
||||
itertools.dropwhile(lambda x: not x.startswith("__version__"), in_handle)
|
||||
)
|
||||
version = version_line.split('=')[-1].strip().replace('"', '')
|
||||
return version
|
||||
|
||||
|
||||
def recur_expand(target_root: Any, dir: Any) -> Generator[Tuple[str, List[str]], None, None]:
|
||||
for root, _, files in os.walk(dir):
|
||||
paths = [os.path.join(root, f) for f in files]
|
||||
if len(paths):
|
||||
yield os.path.join(target_root, root), paths
|
||||
|
||||
|
||||
# We should be installable with either setuptools or distutils.
|
||||
package_info = dict(
|
||||
name='zulip',
|
||||
|
@ -56,22 +60,24 @@ package_info = dict(
|
|||
'zulip-send=zulip.send:main',
|
||||
'zulip-api-examples=zulip.api_examples:main',
|
||||
'zulip-matrix-bridge=integrations.bridge_with_matrix.matrix_bridge:main',
|
||||
'zulip-api=zulip.cli:cli'
|
||||
'zulip-api=zulip.cli:cli',
|
||||
],
|
||||
},
|
||||
package_data={'zulip': ["py.typed"]},
|
||||
) # type: Dict[str, Any]
|
||||
|
||||
setuptools_info = dict(
|
||||
install_requires=['requests[security]>=0.12.1',
|
||||
'matrix_client',
|
||||
'distro',
|
||||
'click',
|
||||
],
|
||||
install_requires=[
|
||||
'requests[security]>=0.12.1',
|
||||
'matrix_client',
|
||||
'distro',
|
||||
'click',
|
||||
],
|
||||
)
|
||||
|
||||
try:
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
package_info.update(setuptools_info)
|
||||
package_info['packages'] = find_packages(exclude=['tests'])
|
||||
|
||||
|
@ -82,7 +88,8 @@ except ImportError:
|
|||
# Manual dependency check
|
||||
try:
|
||||
import requests
|
||||
assert(LooseVersion(requests.__version__) >= LooseVersion('0.12.1'))
|
||||
|
||||
assert LooseVersion(requests.__version__) >= LooseVersion('0.12.1')
|
||||
except (ImportError, AssertionError):
|
||||
print("requests >=0.12.1 is not installed", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue