Skip to content

Commit 47cf5bf

Browse files
committed
Fix bugs and update build toolbox
1 parent f098a87 commit 47cf5bf

File tree

49 files changed

+161
-235
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+161
-235
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,4 @@ dmypy.json
130130

131131
# tencent cloud secret
132132
secret.json
133+
.DS_Store

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Handle.
3+
Copyright (c) 2022 MIEK
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

build.sh

Lines changed: 88 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,94 @@
11
#!/bin/sh
2+
#
3+
# Copyright (c) 2022 MIEK
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
214

3-
pip3 install build
4-
rm -rf ./dist
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
BUILD_DIST_DIR_PATH=./dist
24+
BUILD_PACKAGE_DIR_PATH=./packages
25+
MAIN_PACKAGE_DIR_PATH=./
26+
27+
ensure_installed_build_toolbox() {
28+
echo "checking build toolbox..."
29+
30+
if [ -z "$(which python3)" ]
31+
then
32+
echo 'error: Python3 must be installed'
33+
exit 1
34+
fi
35+
36+
if [ -z "$(which pip3)" ]
37+
then
38+
echo 'error: PIP3 must be installed'
39+
exit 1
40+
fi
41+
42+
pip3 install build -q
43+
if [ ! $? -eq 0 ]
44+
then
45+
echo "error: failed to install build toolbox"
46+
fi
47+
}
48+
49+
clean_build_packages() {
50+
if [ -d "${BUILD_DIST_DIR_PATH}" ]
51+
then
52+
echo "cleaning build packages..."
53+
rm -rf "${BUILD_DIST_DIR_PATH}"
54+
fi
55+
}
56+
57+
get_package_name() {
58+
if [ $1 = $MAIN_PACKAGE_DIR_PATH ]
59+
then
60+
echo 'main'
61+
else
62+
basename $1
63+
fi
64+
}
565

666
build_package() {
7-
python3 -m build ./packages/$1 -o ./dist
67+
package_name=$(get_package_name "${1}")
68+
69+
echo "building package: ${package_name}"
70+
python3 -m build "${1}" -o "${BUILD_DIST_DIR_PATH}" > /dev/null
71+
72+
if [ ! $? -eq 0 ]
73+
then
74+
echo "error: failed to build package: ${package_name}"
75+
exit 1
76+
fi
77+
}
78+
79+
build_all_packages() {
80+
echo "building all packages..."
81+
for package_path in $BUILD_PACKAGE_DIR_PATH/*
82+
do
83+
build_package $package_path &
84+
done
85+
86+
wait
87+
build_package $MAIN_PACKAGE_DIR_PATH
88+
89+
echo 'all packages are build'
890
}
991

10-
build_package tencent-cloud-sdk-auth
11-
build_package tencent-cloud-sdk-common
12-
build_package tencent-cloud-sdk-core
13-
build_package tencent-cloud-sdk-serverless-database
14-
build_package tencent-cloud-sdk-serverless-functions
15-
build_package ..
92+
ensure_installed_build_toolbox
93+
clean_build_packages
94+
build_all_packages

examples/invoke_cloud_function_async.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# MIT License
2-
#
3-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
42
#
53
# Permission is hereby granted, free of charge, to any person obtaining a copy
64
# of this software and associated documentation files (the "Software"), to deal

examples/quickstart.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# quickstart is python-3.6 source file
2-
3-
# MIT License
4-
#
5-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
62
#
73
# Permission is hereby granted, free of charge, to any person obtaining a copy
84
# of this software and associated documentation files (the "Software"), to deal

packages/tencent-cloud-sdk-auth/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Handle.
3+
Copyright (c) 2022 MIEK
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

packages/tencent-cloud-sdk-auth/setup.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# setup is python-3.6 source file
2-
3-
# MIT License
4-
#
5-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
62
#
73
# Permission is hereby granted, free of charge, to any person obtaining a copy
84
# of this software and associated documentation files (the "Software"), to deal
@@ -41,8 +37,8 @@ def read_readme_content() -> str:
4137
],
4238
keywords = 'tencent-cloud sdk-python',
4339
license = 'MIT License',
44-
author = 'Tencent Cloud',
45-
author_email = 'support@xiaoyy.org',
40+
author = 'MIEK',
41+
author_email = 'king@xiaoyy.org',
4642
description = (
4743
'Tencent Cloud SDK for Python components. '
4844
'This package implements the access credential '

packages/tencent-cloud-sdk-auth/tencent/cloud/auth/__init__.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# tencent.cloud.auth.__init__ is python-3.6 source file
2-
3-
# MIT License
4-
#
5-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
62
#
73
# Permission is hereby granted, free of charge, to any person obtaining a copy
84
# of this software and associated documentation files (the "Software"), to deal

packages/tencent-cloud-sdk-auth/tencent/cloud/auth/credentials.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# tencent.cloud.auth.secret is python-3.6 source file
2-
3-
# MIT License
4-
#
5-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
62
#
73
# Permission is hereby granted, free of charge, to any person obtaining a copy
84
# of this software and associated documentation files (the "Software"), to deal

packages/tencent-cloud-sdk-auth/tencent/cloud/auth/helper.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# tencent.cloud.auth.helper is python-3.6 source file
2-
3-
# MIT License
4-
#
5-
# Copyright (c) 2021 Handle.
1+
# Copyright (c) 2022 MIEK
62
#
73
# Permission is hereby granted, free of charge, to any person obtaining a copy
84
# of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)