forked from shimakaze-git/jpndlpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
68 lines (58 loc) · 1.82 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from codecs import open
from os import path
import re
package_name = 'jpndlpy'
root_dir = path.abspath(path.dirname(__file__))
with open(path.join(root_dir, package_name, '__init__.py')) as f:
init_text = f.read()
version = re.search(
r'__version__\s*=\s*[\'\"](.+?)[\'\"]', init_text
).group(1)
license = re.search(
r'__license__\s*=\s*[\'\"](.+?)[\'\"]', init_text
).group(1)
author = re.search(
r'__author__\s*=\s*[\'\"](.+?)[\'\"]', init_text
).group(1)
author_email = re.search(
r'__author_email__\s*=\s*[\'\"](.+?)[\'\"]', init_text
).group(1)
url = re.search(r'__url__\s*=\s*[\'\"](.+?)[\'\"]', init_text).group(1)
assert version
assert license
assert author
assert author_email
assert url
with open('requirements.txt') as f:
requirements = f.read().splitlines()
with open('README.md', encoding='utf-8') as f:
long_description = f.read()
setup(
name=package_name,
version=version,
packages=find_packages(exclude=('tests')),
test_suite='tests',
author=author,
author_email=author_email,
description="requests wrapper library for obtaining book information from the Japan National Diet Library.",
long_description=long_description,
long_description_content_type='text/markdown',
license=license,
keywords="python requests",
url=url,
python_requires='~=3.4, !=2.7.*',
install_requires=requirements,
classifiers=[
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: BSD License',
],
)
# python setup.py sdist bdist_wheel
# or
# make build
# create dist directory