-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
70 lines (56 loc) · 1.84 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
# -*- coding: utf-8 -*-
import os
from codecs import open
from typing import Dict
try:
from setuptools import find_packages, setup
except:
raise ImportError("setuptools is required ...")
here = os.path.abspath(os.path.dirname(__file__))
# load the package's __version__.py module as a dictionary
about: Dict[str, str] = {}
with open(os.path.join(here, "wlanpi_core", "__version__.py"), "r", "utf-8") as f:
exec(f.read(), about)
def parse_requires(_list):
requires = list()
trims = ["#", "piwheels.org"]
for require in _list:
if any(match in require for match in trims):
continue
requires.append(require)
requires = list(filter(None, requires)) # remove "" from list
return requires
# important to collect various modules in the package directory
packages = find_packages(exclude=("tests",))
with open("testing.txt") as f:
testing = f.read().splitlines()
testing = parse_requires(testing)
extras = {"testing": testing}
with open("requirements.txt") as f:
requirements = f.read().splitlines()
requires = parse_requires(requirements)
setup(
name=about["__title__"],
version=about["__version__"],
description=about["__description__"],
author=about["__author__"],
author_email=about["__author_email__"],
url=about["__url__"],
python_requires="~=3.9",
license=about["__license__"],
classifiers=[
"Natural Language :: English",
"Development Status :: 1 - Planning",
"Programming Language :: Python :: 3.9",
"Intended Audience :: System Administrators",
"Topic :: Utilities",
],
packages=packages,
project_urls={
"Documentation": "https://docs.wlanpi.com",
"Source": "https://github.com/wlan-pi/wlanpi-core",
},
include_package_data=True,
install_requires=requires,
extras_require=extras,
)