-
Notifications
You must be signed in to change notification settings - Fork 34
/
setup.py
76 lines (63 loc) · 2.53 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import os
import re
import setuptools
# Load long description
def load_long_description(desc_file):
return open(desc_file).read()
# Load keywords
def load_keywords(keywords_file):
with open(keywords_file, "r") as fin:
return ", ".join([line for line in map(str.strip, fin.read().splitlines())
if len(line) > 0 and not line.startswith("#")])
# Load version
def load_version(*path_parts):
version_file = os.path.join(*path_parts)
version_line = open(os.path.join(*path_parts)).read().rstrip()
vre = re.compile(r'__version__: str = "([^"]+)"')
matches = vre.findall(version_line)
if matches and len(matches) > 0:
return matches[0]
raise RuntimeError(f"Cannot find version string in {version_file}")
# Load requirements
def load_requirements(req_file):
with open(req_file, "r") as fin:
return [line for line in map(str.strip, fin.read().splitlines())
if len(line) > 0 and not line.startswith("#")]
# Load needed files
version = load_version("py_crypto_hd_wallet", "_version.py")
# Setup configuration
setuptools.setup(
name="py_crypto_hd_wallet",
version=version,
author="Emanuele Bellocchia",
author_email="[email protected]",
maintainer="Emanuele Bellocchia",
maintainer_email="[email protected]",
description="HD (Hierarchical Deterministic) wallet for cryptocurrencies based on bip_utils library",
long_description=load_long_description("README.md"),
long_description_content_type="text/markdown",
url="https://github.com/ebellocchia/py_crypto_hd_wallet",
download_url="https://github.com/ebellocchia/py_crypto_hd_wallet/archive/v%s.tar.gz" % version,
license="MIT",
test_suite="tests",
install_requires=load_requirements("requirements.txt"),
extras_require={
"develop": load_requirements("requirements-dev.txt"),
},
packages=setuptools.find_packages(exclude=["*tests*"]),
keywords=load_keywords("keywords.txt"),
platforms=["any"],
classifiers=[
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
],
python_requires=">=3.7",
)