-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Dependencies. Misc improvements (#130)
- Update setup.py version to 0.5.7 - Update dependencies - Small improvements - Reduce default MQTT keep-alive values (see Issue #128) - Simplify README - Better error message if `cmake` not installed (see [forum issue](https://forums.aws.amazon.com/thread.jspa?threadID=316634&tstart=0)) - CI improvements - Set up Github secrets so MQTT tests will run again - Alter credentials tests so they can't accidentally leak secrets - `ManyLinuxCI` action uses `AWSCrtPython` action.
- Loading branch information
Showing
19 changed files
with
143 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint | ||
|
||
on: [push] | ||
|
||
jobs: | ||
clang-format: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: clang-format lint | ||
uses: DoozyX/[email protected] | ||
with: | ||
# List of extensions to check | ||
extensions: c,h | ||
|
||
autopep8: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and Test | ||
run: | | ||
python3 -m pip install --upgrade setuptools | ||
python3 -m pip install --upgrade autopep8 | ||
python3 -m autopep8 --exit-code --diff --recursive awscrt test .builder setup.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,24 @@ | ||
## AWS Crt Python | ||
## AWS CRT Python | ||
|
||
Python bindings for the AWS Common Runtime | ||
|
||
## License | ||
|
||
This library is licensed under the Apache 2.0 License. | ||
This library is licensed under the Apache 2.0 License. | ||
|
||
## Building the Wheel | ||
## Installation | ||
|
||
This builds the wheel itself | ||
To install from pip: | ||
````bash | ||
<path to your python binary> setup.py sdist bdist_wheel | ||
python -m pip install awscrt | ||
```` | ||
|
||
You'll want to do this for every version of Python: | ||
2.7m, 2.7mu, 3.4m, 3.5m, 3.6m, and 3.7m | ||
|
||
Don't worry, it will only do a full build on the first run. All the others will just reuse the artifacts. | ||
|
||
### Intel Linux | ||
On linux, assuming you built on an ancient distro (GLIBC is <= 2.5), you'll need to have python inspect the artifact | ||
and ensure it's compatible: | ||
|
||
````bash | ||
auditwheel show dist/<your output wheel> | ||
```` | ||
|
||
If everything is good to go, you'll see a line that says: | ||
|
||
following platform tag: "manylinux1_\<arch\>". | ||
|
||
One thing to keep in mind, you'll need a version of libcrypto build as a static lib with position independent code (-fPIC). | ||
DO NOT use the shared lib version of libcrypto or the wheel will not pass this test. | ||
|
||
Now you'll need to have the wheel renamed to something compatible with pypi: | ||
|
||
To install from Github: | ||
````bash | ||
auditwheel repair --plat manylinux1_x86_64 -w dist dist/<your image name> | ||
git clone https://github.com/awslabs/aws-crt-python.git | ||
cd aws-crt-python | ||
git submodule update --init | ||
python -m pip install . | ||
```` | ||
|
||
After doing this, I like to delete all of the old wheel images for making the next step easier: | ||
|
||
### ARM Linux | ||
The process is similar to Intel, but we haven't built the wheels yet. We'll update this document when we finally get that finished. | ||
|
||
## Publishing | ||
Upload to pypi: | ||
|
||
````bash | ||
<path to your python binary> -m twine upload --repository-url <the repo> dist/* | ||
```` | ||
|
||
## Using From Your Python Application | ||
|
||
Normally, you just declare `aws_crt` as a dependency in your setup.py file. | ||
|
||
### Installing from pip | ||
````bash | ||
pip install aws_crt | ||
```` | ||
To use from your Python application, declare `awscrt` as a dependency in your `setup.py` file. |
Submodule aws-c-auth
updated
4 files
+1 −0 | README.md | |
+2 −2 | cmake/aws-c-auth-config.cmake | |
+6 −4 | include/aws/auth/auth.h | |
+2 −0 | tests/credentials_tests.c |
Submodule aws-c-cal
updated
23 files
+66 −0 | .gitignore | |
+6 −5 | CMakeLists.txt | |
+2 −2 | cmake/aws-c-cal-config.cmake | |
+45 −0 | include/aws/cal/cal.h | |
+165 −0 | include/aws/cal/ecc.h | |
+228 −0 | include/aws/cal/private/der.h | |
+35 −0 | include/aws/cal/private/ecc.h | |
+68 −0 | source/cal.c | |
+0 −0 | source/darwin/commoncrypto_hmac.c | |
+0 −0 | source/darwin/commoncrypto_md5.c | |
+0 −0 | source/darwin/commoncrypto_sha256.c | |
+599 −0 | source/darwin/securityframework_ecc.c | |
+511 −0 | source/der.c | |
+221 −0 | source/ecc.c | |
+381 −0 | source/unix/opensslcrypto_ecc.c | |
+0 −0 | source/unix/opensslcrypto_hash.c | |
+0 −0 | source/unix/opensslcrypto_hmac.c | |
+470 −0 | source/windows/bcrypt_ecc.c | |
+0 −0 | source/windows/bcrypt_hash.c | |
+0 −0 | source/windows/bcrypt_hmac.c | |
+32 −0 | tests/CMakeLists.txt | |
+517 −0 | tests/der_test.c | |
+659 −0 | tests/ecc_test.c |
Submodule aws-c-common
updated
31 files
Submodule aws-c-compression
updated
4 files
+66 −0 | .gitignore | |
+2 −2 | cmake/aws-c-compression-config.cmake | |
+22 −0 | include/aws/compression/compression.h | |
+3 −3 | include/aws/compression/error.h |
Submodule aws-c-http
updated
50 files
Submodule aws-c-io
updated
48 files
Submodule aws-c-mqtt
updated
13 files
+90 −0 | .github/workflows/ci.yml | |
+0 −23 | .github/workflows/mac-osx-ci.yml | |
+3 −0 | builder.json | |
+2 −2 | cmake/aws-c-mqtt-config.cmake | |
+6 −3 | include/aws/mqtt/mqtt.h | |
+1 −0 | include/aws/mqtt/private/client_impl.h | |
+50 −27 | source/client.c | |
+4 −1 | source/client_channel_handler.c | |
+5 −0 | source/topic_tree.c | |
+9 −1 | tests/CMakeLists.txt | |
+1,046 −0 | tests/connection_state_test.c | |
+419 −0 | tests/mqtt_mock_server_handler.h | |
+9 −4 | tests/packet_encoding_test.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,19 @@ def determine_generator_args(): | |
return [] | ||
|
||
|
||
cmake_found = False | ||
|
||
|
||
def check_cmake_installed(): | ||
global cmake_found | ||
if not cmake_found: | ||
try: | ||
subprocess.check_call(['cmake', '--version']) | ||
cmake_found = True | ||
except Exception: | ||
raise Exception("'cmake' not found. cmake must be installed to build from source.") | ||
|
||
|
||
class AwsLib(object): | ||
def __init__(self, name, extra_cmake_args=[]): | ||
self.name = name | ||
|
@@ -110,6 +123,8 @@ def __init__(self, name, extra_cmake_args=[]): | |
|
||
class awscrt_build_ext(setuptools.command.build_ext.build_ext): | ||
def _build_dependency(self, aws_lib): | ||
check_cmake_installed() | ||
|
||
prev_cwd = os.getcwd() # restore cwd at end of function | ||
lib_source_dir = os.path.join(PROJECT_DIR, 'aws-common-runtime', aws_lib.name) | ||
|
||
|
@@ -229,7 +244,7 @@ def awscrt_ext(): | |
|
||
setuptools.setup( | ||
name="awscrt", | ||
version="0.5.6", | ||
version="0.5.7", | ||
author="Amazon Web Services, Inc", | ||
author_email="[email protected]", | ||
description="A common runtime for AWS Python projects", | ||
|
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.