-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
79 lines (67 loc) · 1.92 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from typing import List
from setuptools import find_packages, setup
# Package meta-data.
NAME = "pyfacebook"
PACKAGE = "pyfacebook"
DESCRIPTION = "Handler to send Facebook Messenger API."
URL = "https://github.com/luismayta/pyfacebook"
EMAIL = "slovacus@gmail.com"
AUTHOR = "@slovacus"
def find_version(fname: str) -> str:
"""Attempts to find the version number in the file names fname.
Raises RuntimeError if not found.
"""
version = ""
with open(fname, "r") as filename:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in filename:
match = reg.match(line)
if match:
version = match.group(1)
break
if not version:
raise RuntimeError("Cannot find version information")
return version
__version__: str = find_version("pyfacebook/__init__.py")
def read(fname: str) -> str:
with open(fname) as filename:
content = filename.read()
return content
required: List[str] = ["python-magic >= 0.4.13", "requests >=2.18.4", "verify >=1.1.1"]
setup(
name=PACKAGE,
version=__version__,
author=AUTHOR,
author_email=EMAIL,
description=DESCRIPTION,
url=URL,
license="BSD",
packages=find_packages(exclude=["tests"]),
install_requires=required,
tests_require=[
"pytest>=3.7.2",
"PyHamcrest==1.10.1",
"pytest-cov",
"pytest-flask",
"pytest-mock==3.11.1",
"pytest-runner",
],
extras_require={
"docs": ["mock", "sphinx>=1.7.2"],
"tests": [
"sphinx",
"pytest-cache",
"pytest-cov",
"pytest-flakes",
"pytest-pep8",
"pytest-runner",
"jinja2",
"pygments",
],
},
long_description=read("README.rst"),
classifiers=["License :: OSI Approved :: BSD License"],
)