Skip to content

Commit

Permalink
Fix bugs and update build toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
devmiek committed Oct 27, 2022
1 parent f098a87 commit 47cf5bf
Show file tree
Hide file tree
Showing 49 changed files with 161 additions and 235 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,4 @@ dmypy.json

# tencent cloud secret
secret.json
.DS_Store
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Handle.
Copyright (c) 2022 MIEK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
97 changes: 88 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,94 @@
#!/bin/sh
#
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

pip3 install build
rm -rf ./dist
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

BUILD_DIST_DIR_PATH=./dist
BUILD_PACKAGE_DIR_PATH=./packages
MAIN_PACKAGE_DIR_PATH=./

ensure_installed_build_toolbox() {
echo "checking build toolbox..."

if [ -z "$(which python3)" ]
then
echo 'error: Python3 must be installed'
exit 1
fi

if [ -z "$(which pip3)" ]
then
echo 'error: PIP3 must be installed'
exit 1
fi

pip3 install build -q
if [ ! $? -eq 0 ]
then
echo "error: failed to install build toolbox"
fi
}

clean_build_packages() {
if [ -d "${BUILD_DIST_DIR_PATH}" ]
then
echo "cleaning build packages..."
rm -rf "${BUILD_DIST_DIR_PATH}"
fi
}

get_package_name() {
if [ $1 = $MAIN_PACKAGE_DIR_PATH ]
then
echo 'main'
else
basename $1
fi
}

build_package() {
python3 -m build ./packages/$1 -o ./dist
package_name=$(get_package_name "${1}")

echo "building package: ${package_name}"
python3 -m build "${1}" -o "${BUILD_DIST_DIR_PATH}" > /dev/null

if [ ! $? -eq 0 ]
then
echo "error: failed to build package: ${package_name}"
exit 1
fi
}

build_all_packages() {
echo "building all packages..."
for package_path in $BUILD_PACKAGE_DIR_PATH/*
do
build_package $package_path &
done

wait
build_package $MAIN_PACKAGE_DIR_PATH

echo 'all packages are build'
}

build_package tencent-cloud-sdk-auth
build_package tencent-cloud-sdk-common
build_package tencent-cloud-sdk-core
build_package tencent-cloud-sdk-serverless-database
build_package tencent-cloud-sdk-serverless-functions
build_package ..
ensure_installed_build_toolbox
clean_build_packages
build_all_packages
4 changes: 1 addition & 3 deletions examples/invoke_cloud_function_async.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions examples/quickstart.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# quickstart is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/tencent-cloud-sdk-auth/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Handle.
Copyright (c) 2022 MIEK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 3 additions & 7 deletions packages/tencent-cloud-sdk-auth/setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# setup is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -41,8 +37,8 @@ def read_readme_content() -> str:
],
keywords = 'tencent-cloud sdk-python',
license = 'MIT License',
author = 'Tencent Cloud',
author_email = 'support@xiaoyy.org',
author = 'MIEK',
author_email = 'king@xiaoyy.org',
description = (
'Tencent Cloud SDK for Python components. '
'This package implements the access credential '
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.auth.__init__ is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.auth.secret is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions packages/tencent-cloud-sdk-auth/tencent/cloud/auth/helper.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.auth.helper is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions packages/tencent-cloud-sdk-auth/tests/cloud/auth/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tests.cloud.auth.__init__ is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tests.cloud.auth.credentials is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions packages/tencent-cloud-sdk-auth/tests/cloud/auth/helper.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tests.cloud.auth.helper is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/tencent-cloud-sdk-common/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Handle.
Copyright (c) 2022 MIEK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions packages/tencent-cloud-sdk-common/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include tencent/cloud/common/certifi/cacert.pem
15 changes: 6 additions & 9 deletions packages/tencent-cloud-sdk-common/setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# setup is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,7 +31,7 @@ def read_readme_content() -> str:

setuptools.setup(
name = 'tencent-cloud-sdk-common',
version = '0.1.4',
version = '0.1.5',
packages = [
'tencent.cloud.common',
'tencent.cloud.common.aiohttp',
Expand All @@ -52,8 +48,8 @@ def read_readme_content() -> str:
],
keywords = 'tencent-cloud sdk-python',
license = 'MIT License',
author = 'Tencent Cloud',
author_email = 'support@xiaoyy.org',
author = 'MIEK',
author_email = 'king@xiaoyy.org',
description = (
'Tencent Cloud SDK for Python components. '
'This package is the core component of the '
Expand All @@ -71,5 +67,6 @@ def read_readme_content() -> str:
'Operating System :: OS Independent',
'Development Status :: 5 - Production/Stable'
# 'Development Status :: 4 - Beta'
]
],
include_package_data=True
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.common.__init__ is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion packages/tencent-cloud-sdk-core/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Handle.
Copyright (c) 2022 MIEK

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 5 additions & 9 deletions packages/tencent-cloud-sdk-core/setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# setup is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -35,14 +31,14 @@ def read_readme_content() -> str:

setuptools.setup(
name = 'tencent-cloud-sdk-core',
version = '0.2.4',
version = '0.2.5',
packages = [
'tencent.cloud.core'
],
keywords = 'tencent-cloud sdk-python',
license = 'MIT License',
author = 'Tencent Cloud',
author_email = 'support@xiaoyy.org',
author = 'MIEK',
author_email = 'king@xiaoyy.org',
description = (
'Tencent Cloud SDK for Python components. '
'This package is the core component of the '
Expand All @@ -63,6 +59,6 @@ def read_readme_content() -> str:
],
install_requires = [
'tencent-cloud-sdk-auth>=0.2.2',
'tencent-cloud-sdk-common>=0.1.4'
'tencent-cloud-sdk-common>=0.1.5'
]
)
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.__init__ is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions packages/tencent-cloud-sdk-core/tencent/cloud/core/client.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.client is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 1 addition & 5 deletions packages/tencent-cloud-sdk-core/tencent/cloud/core/errors.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.errors is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 1 addition & 3 deletions packages/tencent-cloud-sdk-core/tencent/cloud/core/helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.proxies is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.version is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# tencent.cloud.core.waitable is python-3.6 source file

# MIT License
#
# Copyright (c) 2021 Handle.
# Copyright (c) 2022 MIEK
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down

0 comments on commit 47cf5bf

Please sign in to comment.