-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
50 lines (43 loc) · 1.61 KB
/
setup.py
File metadata and controls
50 lines (43 loc) · 1.61 KB
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
#!/usr/bin/env python
from setuptools import setup, Extension
import re
import os
def read_file(filename, encoding='utf-8'):
with open(filename, 'r', encoding=encoding) as f:
return f.read()
def get_version():
"""
Extract the version number from arraydeque.c.
It looks for a line of the form:
#define ARRAYDEQUE_VERSION "x.y.z"
"""
with open('arraydeque.c', 'r', encoding='utf-8') as f:
content = f.read()
match = re.search(r'#define\s+ARRAYDEQUE_VERSION\s+"([^"]+)"', content)
if match:
return match.group(1)
raise RuntimeError('Unable to find version string in arraydeque.c.')
here = os.path.abspath(os.path.dirname(__file__))
setup(
name='arraydeque',
version=get_version(),
description='Array-backed deque implementation written in C for fast double-ended operations.',
long_description=read_file('README.md'),
long_description_content_type='text/markdown',
author='Grant Jenks',
author_email='grant.jenks@gmail.com',
url='https://github.com/grantjenks/python-arraydeque',
license='Apache 2.0',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: C',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: Implementation :: CPython',
],
ext_modules=[Extension('arraydeque', sources=['arraydeque.c'])],
python_requires='>=3.8',
)