-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
31 lines (26 loc) · 1018 Bytes
/
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import codecs
from setuptools import setup, find_packages
cwd = os.path.abspath(os.path.dirname(__file__))
metadata = codecs.open(os.path.join(cwd, 'tir', '__init__.py'), 'rb', 'utf-8').read()
def extract_metaitem(meta):
meta_match = re.search(r"""^__{meta}__\s+=\s+['\"]([^'\"]*)['\"]""".format(meta=meta)
,metadata
,re.MULTILINE)
if meta_match:
return meta_match.group(1)
raise RuntimeError('Unable to find __{meta}__ string.'.format(meta=meta))
setup(name='tir'
,version=extract_metaitem('version')
,description=extract_metaitem('description')
,author=extract_metaitem('author')
,author_email=extract_metaitem('email')
,maintainer=extract_metaitem('author')
,maintainer_email=extract_metaitem('email')
,platforms=['Any']
,packages=find_packages()
,install_requires=['requests', 'lxml']
,setup_requires=['pytest-runner'])