-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·93 lines (83 loc) · 3.05 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
88
89
90
91
92
93
#!/usr/bin/env python
import sys
name = 'butter'
path = 'butter'
## Automatically determine project version ##
from setuptools import setup, find_packages
try:
from hgdistver import get_version
except ImportError:
def get_version():
import os
d = {'__name__':name}
# handle single file modules
if os.path.isdir(path):
module_path = os.path.join(path, '__init__.py')
else:
module_path = path
with open(module_path) as f:
try:
exec(f.read(), None, d)
except:
pass
return d.get("__version__", 0.1)
## Use py.test for "setup.py test" command ##
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
pytest.main(self.test_args)
## Try and extract a long description ##
readme = ""
for readme_name in ("README", "README.rst", "README.md",
"CHANGELOG", "CHANGELOG.rst", "CHANGELOG.md"):
try:
readme += open(readme_name).read() + "\n\n"
except (OSError, IOError):
continue
## Finally call setup ##
setup(
name = name,
version = get_version(),
packages = find_packages(),
author = "Da_Blitz",
author_email = "[email protected]",
maintainer=None,
maintainer_email=None,
description = "Library to interface to low level linux features (inotify, fanotify, timerfd, signalfd, eventfd) with asyncio support",
long_description = readme,
license = "MIT BSD",
keywords = "linux splice tee fanotify inotify eventfd signalfd timerfd aio clone unshare asyncio",
download_url = "http://blitz.works/butter/archive/tip.tar.bz2",
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: BSD License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: System :: Monitoring",
"Topic :: System :: Systems Administration",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: System Administrators",
"Intended Audience :: Developers",
],
platforms=None,
url = "http://blitz.works/butter/file/tip",
# entry_points = {"console_scripts":["hammerhead=hammerhead:main",
# "hammerhead-enter=hammerhead:setns"],
# },
# scripts = ['scripts/dosomthing'],
zip_safe = False,
setup_requires = [],
install_requires = ['cffi>=0.7.2'],
tests_require = ['tox', 'pytest', 'pytest-cov'],
cmdclass = {'test': PyTest},
ext_package = name,
)