forked from gorakhargosh/watchdog
/
setup.py
74 lines (64 loc) · 2.04 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from setuptools import setup
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext
from distutils.util import get_platform
logging.basicConfig(level=logging.DEBUG)
def read_file(filename):
"""Reads the contents of a given file and returns it."""
return open(os.path.join(os.path.dirname(__file__), filename)).read()
# Determine platform to pick the implementation.
platform = get_platform()
logging.debug("Platform: " + platform)
if platform.startswith('macosx'):
platform = 'macosx'
elif platform.startswith('linux'):
platform = 'linux'
else:
platform = None
trove_classifiers = (
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python',
'Programming Language :: C',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Monitoring',
)
macosx_ext_modules = [
Extension(name='_fsevents',
sources=['watchdog/_fsevents.c'],
extra_link_args=['-framework', 'CoreFoundation',
'-framework', 'CoreServices'],
),
]
linux_ext_modules = [
]
ext_modules = {
'macosx': macosx_ext_modules,
'linux': linux_ext_modules,
}
setup(
name="watchdog",
version="0.1",
description="Filesystem events monitoring",
long_description=read_file('README'),
author="Gora Khargosh",
author_email="gora.khargosh@gmail.com",
license="MIT License",
cmdclass=dict(build_ext=build_ext),
url="http://github.com/gorakhargosh/watchdog",
keywords = "python filesystem monitoring monitor fsevents inotify",
classifiers=trove_classifiers,
ext_modules=ext_modules.get(platform, None),
packages=('watchdog',),
zip_safe=False,
py_modules=('watchdog'),
)