1+ #!/usr/bin/env python
12from setuptools import setup , Extension
23import re
4+ import os
5+
6+
7+ def read_file (filename , encoding = 'utf-8' ):
8+ with open (filename , 'r' , encoding = encoding ) as f :
9+ return f .read ()
310
411
512def get_version ():
613 """
714 Extract the version number from arraydeque.c.
8- Looks for a line of the form:
9- #define ARRAYDEQUE_VERSION "0.1.0 "
15+ It looks for a line of the form:
16+ #define ARRAYDEQUE_VERSION "x.y.z "
1017 """
1118 with open ('arraydeque.c' , 'r' , encoding = 'utf-8' ) as f :
1219 content = f .read ()
@@ -16,11 +23,29 @@ def get_version():
1623 raise RuntimeError ('Unable to find version string in arraydeque.c.' )
1724
1825
19- module = Extension ( 'arraydeque' , sources = [ 'arraydeque.c' ] )
26+ here = os . path . abspath ( os . path . dirname ( __file__ ) )
2027
2128setup (
2229 name = 'arraydeque' ,
2330 version = get_version (),
24- description = 'Array-backed deque implementation' ,
25- ext_modules = [module ],
31+ description = 'Array-backed deque implementation written in C for fast double-ended operations.' ,
32+ long_description = read_file ('README.md' ),
33+ long_description_content_type = 'text/markdown' ,
34+ author = 'Grant Jenks' ,
35+ author_email = 'grant.jenks@gmail.com' ,
36+ url = 'https://github.com/grantjenks/python-arraydeque' ,
37+ license = 'Apache License 2.0' ,
38+ license_files = ['LICENSE' ],
39+ classifiers = [
40+ 'Development Status :: 5 - Production/Stable' ,
41+ 'Intended Audience :: Developers' ,
42+ 'Topic :: Software Development :: Libraries' ,
43+ 'License :: OSI Approved :: Apache Software License' ,
44+ 'Programming Language :: C' ,
45+ 'Programming Language :: Python' ,
46+ 'Programming Language :: Python :: 3' ,
47+ 'Programming Language :: Python :: Implementation :: CPython' ,
48+ ],
49+ ext_modules = [Extension ('arraydeque' , sources = ['arraydeque.c' ])],
50+ python_requires = '>=3.8' ,
2651)
0 commit comments