Skip to content

Commit 6875e23

Browse files
committed
restructure setup.py
1 parent ac7ade5 commit 6875e23

File tree

1 file changed

+42
-22
lines changed

1 file changed

+42
-22
lines changed

setup.py

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
2+
3+
import os
34

45
from setuptools import Extension, setup
56

6-
__version__ = '1.0.0'
7+
NAME = 'bchlib'
8+
VERSION = '1.0.0'
9+
DESCRIPTION = 'A python wrapper module for the Linux kernel BCH library.',
10+
URL = 'https://github.com/jkent/python-bchlib'
11+
12+
AUTHOR = 'Jeff Kent'
13+
REQUIRES_PYTHON = '>=3.6.0'
14+
15+
BCHLIB_EXT_SRC = [
16+
'src/bch.c',
17+
'src/bchlib.c',
18+
]
719

8-
bchlib_src = ['src/bchlib.c',
9-
'src/bch.c']
10-
bchlib_dep = ['src/bch.h']
20+
BCHLIB_EXT_DEP = [
21+
'src/bch.h',
22+
]
1123

12-
bchlib_ext = Extension('bchlib', bchlib_src, depends=bchlib_dep,
24+
BCHLIB_EXT = Extension('bchlib', BCHLIB_EXT_SRC, depends=BCHLIB_EXT_DEP,
1325
extra_compile_args=['-std=c99'])
1426

15-
setup(name='bchlib', version = __version__,
16-
ext_modules = [bchlib_ext],
17-
description = 'A python wrapper module for the kernel BCH library.',
18-
url = 'https://github.com/jkent/python-bchlib',
19-
author = 'Jeff Kent',
20-
author_email = '[email protected]',
21-
maintainer = 'Jeff Kent',
22-
maintainer_email = '[email protected]',
23-
license = 'GNU GPLv2',
24-
classifiers = [
25-
'Development Status :: 4 - Beta',
26-
'Intended Audience :: Developers',
27+
here = os.path.abspath(os.path.dirname(__file__))
28+
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
29+
long_description = '\n' + f.read()
30+
31+
setup(
32+
name=NAME,
33+
version=VERSION,
34+
description=DESCRIPTION,
35+
long_description=long_description,
36+
long_description_content_type='text/markdown',
37+
author=AUTHOR,
38+
author_email=EMAIL,
39+
python_requires=REQUIRES_PYTHON,
40+
url=URL,
41+
ext_modules=[BCHLIB_EXT],
42+
include_package_data=True,
43+
license='GNU GPLv2',
44+
classifiers=[
2745
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
28-
'Operating System :: POSIX :: Linux',
29-
'Programming Language :: C',
46+
'Programming Language :: Python',
3047
'Programming Language :: Python :: 3',
48+
'Programming Language :: Python :: 3.6',
49+
'Programming Language :: Python :: Implementation :: CPython',
50+
'Programming Language :: Python :: Implementation :: PyPy',
51+
'Intended Audience :: Developers',
3152
'Topic :: Security :: Cryptography',
32-
'Topic :: Software Development :: Libraries :: Python Modules',
33-
],
53+
],
3454
)

0 commit comments

Comments
 (0)