-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
87 lines (73 loc) · 2.56 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
77
78
79
80
81
82
83
84
85
86
87
import os
from setuptools import setup
from setuptools import find_packages
from functown import __version__
import pathlib
from glob import glob
__status__ = "Package"
__copyright__ = "Copyright 2024"
__license__ = "MIT License"
__author__ = "Felix Geilert"
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
def versions_in_requirements(file):
lines = file.read().splitlines()
versions = [line for line in lines if not line.isspace() and "--" not in line]
return list(versions)
HERE = pathlib.Path(__file__).parent
def load_req(extra: str = None, all: bool = False):
if all is True:
reqs_files = glob(str(HERE / "requirements*.txt"))
reqs = []
for file in reqs_files:
with open(file) as f:
reqs += versions_in_requirements(f)
# make unique
reqs = list(set(reqs))
return reqs
# load regular requirements
file = "requirements.txt"
if extra:
file = f"requirements-{extra}.txt"
with open(HERE / file) as f:
required_list = versions_in_requirements(f)
return required_list
setup(
name="functown",
version=__version__,
description="Various Helper Tools to make working with azure functions easier",
long_description=long_description,
long_description_content_type="text/markdown",
keywords="azure functions",
url="https://github.com/felixnext/python-functown",
download_url="https://github.com/felixnext/python-functown/releases/tag/v0.1.0-alpha",
author="Felix Geilert",
license="MIT License",
packages=find_packages(
include=["functown", "functown.*"],
),
install_requires=load_req(),
setup_requires=["pytest-runner", "flake8"],
tests_require=load_req(all=True),
extras_require={
"flatbuffer": load_req("flatbuffer"),
"protobuf": load_req("protobuf"),
"insights": load_req("insights"),
"jwt": load_req("jwt"),
"pandas": load_req("pandas"),
},
include_package_data=True,
zip_safe=False,
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"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",
],
)