-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
65 lines (54 loc) · 1.67 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
#!/usr/bin/env python3
import os
import sys
from setuptools import find_packages, setup, Extension
_cur_dir = os.path.dirname(os.path.abspath(__file__))
def get_file_content(rel_path):
return open(os.path.join(_cur_dir, rel_path)).read()
ext_opts = {}
if sys.version_info >= (3, 2):
ext_opts['py_limited_api'] = True
ext = Extension(
'pysetns.ext',
sources=['src/ext.c'],
**ext_opts
)
add_opts = {'setup_requires': []}
if sys.version_info >= (3, 7):
add_opts['setup_requires'].append('setuptools-git-versioning')
add_opts['setuptools_git_versioning'] = {
'enabled': True,
'template': '{tag}.{ccount}',
'dev_template': '{tag}.{ccount}',
'dirty_template': '{tag}.{ccount}',
}
setup(
name='pysetns',
url='https://github.com/baskiton/pysetns',
project_urls={
'Source': 'https://github.com/baskiton/pysetns',
'Bug Tracker': 'https://github.com/baskiton/pysetns/issues',
},
license='MIT',
author='Alexander Baskikh',
author_email='[email protected]',
description='Python wrapper for setns Linux syscall.',
long_description=get_file_content('README.md'),
long_description_content_type='text/markdown',
packages=find_packages(exclude=('docs', 'examples')),
install_requires=[
],
ext_modules=[ext],
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Operating System :: POSIX :: Linux',
'Topic :: System :: Operating System Kernels :: Linux',
],
keywords='linux kernel namespace setns',
python_requires='>=3',
package_data={
'': ['examples/*']
},
**add_opts,
)