-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
80 lines (68 loc) · 2.35 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
import setuptools
import subprocess
from codecs import open
from os import path
from setuptools import Distribution
from setuptools.command.build_py import build_py
class BinaryDistribution(Distribution):
def has_ext_modules(foo):
return True
with open("README.md", "r") as fh:
long_description = fh.read()
def read(file):
here = path.abspath(path.dirname(__file__))
with open(path.join(here, file), encoding="utf-8") as f:
return f.read()
requires = [req for req in read("requirements.txt").split("\n") if "=" in req]
class my_build_py(build_py):
def run(self):
# honor the --dry-run flag
if not self.dry_run:
return_value = subprocess.call(["./native_build.sh"])
if return_value != 0:
raise ValueError("build.sh returned non zero exit code")
build_py.run(self)
setuptools.setup(
name="gosnmp-traps-python",
version="1.0.0",
# The project's main homepage.
url="https://github.com/ftpsolutions/gosnmp-traps-python",
# Author details
author="Edward @ FTP Technologies",
author_email="[email protected]",
# Choose your license
license="MIT",
description="gosnmp-traps-python",
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
cmdclass={
"build_py": my_build_py,
},
package_data={
"": ["*.so"],
},
include_package_data=True,
# Force the egg to unzip
zip_safe=False,
install_requires=requires,
# Ensures that distributable copies are platform-specific and not universal
distclass=BinaryDistribution,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: Developers",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 3 :: Only",
# OS Support
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
],
)