4
4
# This file is part of cryptidy package
5
5
6
6
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"
12
12
13
13
import os
14
14
import sys
20
20
def _read_file (filename ):
21
21
here = os .path .abspath (os .path .dirname (__file__ ))
22
22
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 :
24
24
return file_handle .read ()
25
25
else :
26
26
# With python 2.7, open has no encoding parameter, resulting in TypeError
27
27
# Fix with io.open (slow but works)
28
28
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 :
30
33
return file_handle .read ()
31
34
32
35
@@ -38,9 +41,11 @@ def get_metadata(package_file):
38
41
_metadata = {}
39
42
40
43
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
+ )
44
49
return _metadata
45
50
46
51
@@ -53,36 +58,46 @@ def parse_requirements(filename):
53
58
requirements_txt = _read_file (filename )
54
59
install_requires = [
55
60
str (requirement )
56
- for requirement
57
- in pkg_resources .parse_requirements (requirements_txt )
61
+ for requirement in pkg_resources .parse_requirements (requirements_txt )
58
62
]
59
63
return install_requires
60
64
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
+ )
63
70
64
71
65
- PACKAGE_NAME = ' cryptidy'
72
+ PACKAGE_NAME = " cryptidy"
66
73
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" )
68
75
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" )
71
78
72
79
setuptools .setup (
73
80
name = PACKAGE_NAME ,
74
81
packages = setuptools .find_packages (),
75
- version = metadata [' version' ],
82
+ version = metadata [" version" ],
76
83
install_requires = requirements ,
77
- description = metadata ['description' ],
78
- license = 'BSD' ,
79
- author = 'NetInvent - Orsiris de Jong' ,
80
-
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
+
88
+ url = "https://github.com/netinvent/cryptidy" ,
89
+ keywords = [
90
+ "cryptography" ,
91
+ "symmetric" ,
92
+ "asymmetric" ,
93
+ "high" ,
94
+ "level" ,
95
+ "api" ,
96
+ "easy" ,
97
+ ],
83
98
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" ,
86
101
classifiers = [
87
102
"Development Status :: 5 - Production/Stable" ,
88
103
"Intended Audience :: Developers" ,
0 commit comments