Skip to content

Commit b69eb72

Browse files
committed
fix setup.py
1 parent fa1fc71 commit b69eb72

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
22
setup module for Alibaba Cloud OSS SDK V2.
33
"""
4-
5-
import os
4+
import re
5+
import os.path
6+
from io import open
67
from setuptools import setup, find_packages
78

89
PACKAGE_NAME = "alibabacloud-oss-v2"
@@ -11,13 +12,15 @@
1112
AUTHOR = "Alibaba Cloud OSS SDK"
1213
AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
1314
URL = "https://github.com/aliyun/alibabacloud-oss-python-sdk-v2"
14-
VERSION = __import__(PACKAGE_FOLDER_PATH).__version__
1515
REQUIRES = [
1616
"requests>=2.18.4",
1717
"cryptography>=2.1.4",
1818
"crcmod-plus>=2.1.0"
1919
]
2020

21+
with open(os.path.join(PACKAGE_FOLDER_PATH, "_version.py"), "r") as fd:
22+
VERSION = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1) # type: ignore
23+
2124
if not VERSION:
2225
raise RuntimeError('Cannot find version information')
2326

@@ -52,6 +55,6 @@
5255
"Programming Language :: Python :: 3.10",
5356
"Programming Language :: Python :: 3.11",
5457
"Programming Language :: Python :: 3.12",
55-
'License :: OSI Approved :: Apache License 2.0',
58+
"License :: OSI Approved :: Apache Software License",
5659
)
5760
)

0 commit comments

Comments
 (0)