Skip to content

Commit e4a3afd

Browse files
committed
Reformat files with black
1 parent 146fbd2 commit e4a3afd

File tree

2 files changed

+266
-161
lines changed

2 files changed

+266
-161
lines changed

setup.py

+42-27
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
# This file is part of cryptidy package
55

66

7-
__intname__ = 'cryptidy.setup'
8-
__author__ = 'Orsiris de Jong'
9-
__copyright__ = 'Copyright (C) 2021 Orsiris de Jong'
10-
__licence__ = 'BSD 3 Clause'
11-
__build__ = '2021031601'
7+
__intname__ = "cryptidy.setup"
8+
__author__ = "Orsiris de Jong"
9+
__copyright__ = "Copyright (C) 2021 Orsiris de Jong"
10+
__licence__ = "BSD 3 Clause"
11+
__build__ = "2021031601"
1212

1313
import os
1414
import sys
@@ -20,13 +20,16 @@
2020
def _read_file(filename):
2121
here = os.path.abspath(os.path.dirname(__file__))
2222
if sys.version_info[0] > 2:
23-
with open(os.path.join(here, filename), 'r', encoding='utf-8') as file_handle:
23+
with open(os.path.join(here, filename), "r", encoding="utf-8") as file_handle:
2424
return file_handle.read()
2525
else:
2626
# With python 2.7, open has no encoding parameter, resulting in TypeError
2727
# Fix with io.open (slow but works)
2828
from io import open as io_open
29-
with io_open(os.path.join(here, filename), 'r', encoding='utf-8') as file_handle:
29+
30+
with io_open(
31+
os.path.join(here, filename), "r", encoding="utf-8"
32+
) as file_handle:
3033
return file_handle.read()
3134

3235

@@ -38,9 +41,11 @@ def get_metadata(package_file):
3841
_metadata = {}
3942

4043
for line in _read_file(package_file).splitlines():
41-
if line.startswith('__version__') or line.startswith('__description__'):
42-
delim = '='
43-
_metadata[line.split(delim)[0].strip().strip('__')] = line.split(delim)[1].strip().strip('\'"')
44+
if line.startswith("__version__") or line.startswith("__description__"):
45+
delim = "="
46+
_metadata[line.split(delim)[0].strip().strip("__")] = (
47+
line.split(delim)[1].strip().strip("'\"")
48+
)
4449
return _metadata
4550

4651

@@ -53,36 +58,46 @@ def parse_requirements(filename):
5358
requirements_txt = _read_file(filename)
5459
install_requires = [
5560
str(requirement)
56-
for requirement
57-
in pkg_resources.parse_requirements(requirements_txt)
61+
for requirement in pkg_resources.parse_requirements(requirements_txt)
5862
]
5963
return install_requires
6064
except OSError:
61-
print('WARNING: No requirements.txt file found as "{}". Please check path or create an empty one'
62-
.format(filename))
65+
print(
66+
'WARNING: No requirements.txt file found as "{}". Please check path or create an empty one'.format(
67+
filename
68+
)
69+
)
6370

6471

65-
PACKAGE_NAME = 'cryptidy'
72+
PACKAGE_NAME = "cryptidy"
6673
package_path = os.path.abspath(PACKAGE_NAME)
67-
package_file = os.path.join(package_path, '__init__.py')
74+
package_file = os.path.join(package_path, "__init__.py")
6875
metadata = get_metadata(package_file)
69-
requirements = parse_requirements(os.path.join(package_path, 'requirements.txt'))
70-
long_description = _read_file('README.md')
76+
requirements = parse_requirements(os.path.join(package_path, "requirements.txt"))
77+
long_description = _read_file("README.md")
7178

7279
setuptools.setup(
7380
name=PACKAGE_NAME,
7481
packages=setuptools.find_packages(),
75-
version=metadata['version'],
82+
version=metadata["version"],
7683
install_requires=requirements,
77-
description=metadata['description'],
78-
license='BSD',
79-
author='NetInvent - Orsiris de Jong',
80-
author_email='[email protected]',
81-
url='https://github.com/netinvent/cryptidy',
82-
keywords=['cryptography', 'symmetric', 'asymmetric', 'high', 'level', 'api', 'easy'],
84+
description=metadata["description"],
85+
license="BSD",
86+
author="NetInvent - Orsiris de Jong",
87+
author_email="[email protected]",
88+
url="https://github.com/netinvent/cryptidy",
89+
keywords=[
90+
"cryptography",
91+
"symmetric",
92+
"asymmetric",
93+
"high",
94+
"level",
95+
"api",
96+
"easy",
97+
],
8398
long_description=long_description,
84-
long_description_content_type='text/markdown',
85-
pyton_requires='>=2.7',
99+
long_description_content_type="text/markdown",
100+
pyton_requires=">=2.7",
86101
classifiers=[
87102
"Development Status :: 5 - Production/Stable",
88103
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)