1 | ''' setup '''
|
2 |
|
3 | import json
|
4 | import semver
|
5 | import setuptools
|
6 |
|
7 |
|
8 | def versioning(version: str) -> str:
|
9 | """version to specification"""
|
10 | sem_ver = semver.parse(version)
|
11 |
|
12 | major = sem_ver['major']
|
13 | minor = sem_ver['minor']
|
14 | patch = str(sem_ver['patch'])
|
15 |
|
16 | if minor % 2:
|
17 | patch = 'dev' + patch
|
18 |
|
19 | fin_ver = '%d.%d.%s' % (
|
20 | major,
|
21 | minor,
|
22 | patch,
|
23 | )
|
24 |
|
25 | return fin_ver
|
26 |
|
27 |
|
28 | def setup() -> None:
|
29 | """setup"""
|
30 | with open('../README.md', 'r') as fh:
|
31 | long_description = fh.read()
|
32 |
|
33 | with open('../package.json') as f:
|
34 | pkg = json.load(f)
|
35 | version = versioning(pkg['version'])
|
36 |
|
37 | setuptools.setup(
|
38 | name='chatie-grpc',
|
39 | version=version,
|
40 | author='Huan LI (李卓桓)',
|
41 | author_email='zixia@zixia.net',
|
42 | description='gRPC for Chatie',
|
43 | long_description=long_description,
|
44 | long_description_content_type='text/markdown',
|
45 | license='Apache-2.0',
|
46 | url='https://github.com/chatie/grpc',
|
47 | packages=setuptools.find_packages("src"),
|
48 | package_dir={'': 'src'},
|
49 | classifiers=[
|
50 | 'Programming Language :: Python :: 3.7',
|
51 | 'License :: OSI Approved :: Apache Software License',
|
52 | 'Operating System :: OS Independent',
|
53 | ],
|
54 | install_requires=['betterproto', 'grpclib']
|
55 | )
|
56 |
|
57 |
|
58 | setup()
|