|
1 | 1 | # -*- coding: utf-8 -*-
|
| 2 | +from codecs import open |
2 | 3 | import os
|
3 | 4 | import re
|
4 | 5 | from setuptools import setup, Extension
|
|
7 | 8 |
|
8 | 9 | shellinford_cc = glob.glob('cpp_src/*.cc')
|
9 | 10 | shellinford_headers = glob.glob('cpp_src/*.h')
|
10 |
| -with open(os.path.join('shellinford', '__init__.py'), 'r') as f: |
| 11 | +with open(os.path.join('shellinford', '__init__.py'), 'r', encoding='utf8') as f: |
11 | 12 | version = re.compile(
|
12 |
| - r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1) |
| 13 | + r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1) |
13 | 14 |
|
14 |
| -setup ( |
15 |
| - name = 'shellinford', |
16 |
| - version = version, |
17 |
| - author = "Yukino Ikegami", |
| 15 | +setup( |
| 16 | + name='shellinford', |
| 17 | + version=version, |
| 18 | + author="Yukino Ikegami", |
18 | 19 |
|
19 | 20 | url='https://github.com/ikegami-yukino/shellinford-python',
|
20 |
| - description = """Wavelet Matrix/Tree succinct data structure for full text search (using shellinford C++ library)""", |
21 |
| - long_description = open('README.rst').read() + "\n" + open('CHANGES.rst').read(), |
22 |
| - keywords = ['full text search', 'FM-index', 'Wavelet Matrix'], |
| 21 | + description="""Wavelet Matrix/Tree succinct data structure for full text search (using shellinford C++ library)""", |
| 22 | + long_description='%s\n\n%s' % (open('README.rst', encoding='utf8').read(), |
| 23 | + open('CHANGES.rst', encoding='utf8').read()), |
| 24 | + keywords=['full text search', 'FM-index', 'Wavelet Matrix'], |
23 | 25 |
|
24 |
| - ext_modules = [ |
| 26 | + ext_modules=[ |
25 | 27 | Extension(
|
26 | 28 | '_shellinford',
|
27 | 29 | sources=['shellinford_wrap.cxx'] + shellinford_cc,
|
28 | 30 | include_dirs=['cpp_src'],
|
29 | 31 | depends=shellinford_headers,
|
30 |
| - language = "c++" |
| 32 | + language="c++" |
31 | 33 | ),
|
32 | 34 | ],
|
33 | 35 |
|
|
48 | 50 | 'Topic :: Scientific/Engineering :: Information Analysis',
|
49 | 51 | 'Topic :: Text Processing :: Linguistic',
|
50 | 52 | 'Topic :: Text Processing :: Indexing'
|
51 |
| - ], |
| 53 | + ], |
52 | 54 | )
|
0 commit comments