-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
59 lines (49 loc) · 1.41 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
import os
import subprocess
import sys
from setuptools import setup, find_packages
if sys.version_info < (3, 8):
raise RuntimeError(
"PaConvert use new AST syntax and only supports Python version >= 3.8 now.")
with open('requirements.txt') as f:
REQUIREMENTS = f.read().splitlines()
with open("README.md", "r")as f:
LONG_DESCRIPTION = f.read()
packages = [
'paconvert',
'paconvert.transformer',
]
package_data = {
'paconvert' : ['api_mapping.json', 'attribute_mapping.json']
}
def get_tag():
try:
cmd = ['git', 'tag']
git_tag = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0].strip()
git_tag = git_tag.decode()
except:
git_tag = '0.0.0'
if not git_tag:
git_tag = '0.0.0'
return git_tag
setup(
name='paconvert',
version=get_tag(),
author='PaddlePaddle',
keywords=('code convert', 'paddle', 'paddlepaddle'),
url='https://github.com/PaddlePaddle/PaConvert.git',
packages = packages,
package_data = package_data,
install_requires=REQUIREMENTS,
description='Code Convert to PaddlePaddle Toolkit',
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
license="Apache License 2.0",
python_requires=">=3.8",
setup_requires=['wheel'],
entry_points={
'console_scripts': [
'paconvert=paconvert.main:main',
]
}
)