Skip to content

Commit

Permalink
update awscrt to 0.11.19. Remove support for python3.5 as it's EOL (#194
Browse files Browse the repository at this point in the history
)

- update awscrt to 0.11.19. Remove support for python3.5 as it's EOL
- Version and metadata of life updates
  • Loading branch information
TingDaoK authored May 14, 2021
1 parent 8b16659 commit 0e4e91f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 16 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# AWS IoT Device SDK v2 for Python

[![Version](https://img.shields.io/pypi/v/awsiotsdk.svg?style=flat)](https://pypi.org/project/awsiotsdk/)

This document provides information about the AWS IoT Device SDK v2 for Python.

If you have any issues or feature requests, please file an issue or pull request.
Expand Down Expand Up @@ -27,7 +30,7 @@ to Python by the `awscrt` package ([PyPI](https://pypi.org/project/awscrt/)) ([G
## Installation

### Minimum Requirements
* Python 3.5+
* Python 3.6+

### Install from PyPI
```
Expand Down
10 changes: 6 additions & 4 deletions awsiot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import json
from typing import Any, Callable, Dict, Optional, Tuple, TypeVar

__version__ = '1.0.0-dev'

T = TypeVar('T')

PayloadObj = Dict[str, Any]
Expand All @@ -30,7 +32,7 @@ class MqttServiceClient:
"""

def __init__(self, mqtt_connection: mqtt.Connection):
self._mqtt_connection = mqtt_connection # type: mqtt.Connection
self._mqtt_connection = mqtt_connection # type: mqtt.Connection

@property
def mqtt_connection(self) -> mqtt.Connection:
Expand All @@ -50,7 +52,7 @@ def unsubscribe(self, topic: str) -> Future:
`Future` whose result will be `None` when the server
has acknowledged the unsubscribe.
"""
future = Future() # type: Future
future = Future() # type: Future
try:
def on_unsuback(unsuback_future):
if unsuback_future.exception():
Expand Down Expand Up @@ -80,7 +82,7 @@ def _publish_operation(self, topic: str, qos: int, payload: Optional[PayloadObj]
server has acknowledged the message, or an exception if the
publish fails.
"""
future = Future() # type: Future
future = Future() # type: Future
try:
def on_puback(puback_future):
if puback_future.exception():
Expand Down Expand Up @@ -135,7 +137,7 @@ def _subscribe_operation(self,
Note that messages may arrive before the subscription is acknowledged.
"""

future = Future() # type: Future
future = Future() # type: Future
try:
def on_suback(suback_future):
try:
Expand Down
17 changes: 11 additions & 6 deletions builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
},
"manylinux": {
"post_build_steps": [
["echo", "------ Python 3.9 ------"],
["/opt/python/cp39-cp39/bin/python", "-m", "pip", "install", "--upgrade", "pip", "setuptools"],
["/opt/python/cp39-cp39/bin/python", "-m", "pip", "install", ".", "--verbose"],
["/opt/python/cp39-cp39/bin/python", "-m", "pip", "install", "boto3", "autopep8"],
["/opt/python/cp39-cp39/bin/python", "-m", "unittest", "discover", "--verbose"],
["echo", "------ Python 3.8 ------"],
["/opt/python/cp38-cp38/bin/python", "-m", "pip", "install", "--upgrade", "pip", "setuptools"],
["/opt/python/cp38-cp38/bin/python", "-m", "pip", "install", ".", "--verbose"],
["/opt/python/cp38-cp38/bin/python", "-m", "pip", "install", "boto3", "autopep8"],
["/opt/python/cp38-cp38/bin/python", "-m", "unittest", "discover", "--verbose"],
["echo", "------ Python 3.7 ------"],
["/opt/python/cp37-cp37m/bin/python", "-m", "pip", "install", "--upgrade", "pip", "setuptools"],
["/opt/python/cp37-cp37m/bin/python", "-m", "pip", "install", ".", "--verbose"],
Expand All @@ -32,12 +42,7 @@
["/opt/python/cp36-cp36m/bin/python", "-m", "pip", "install", "--upgrade", "pip", "setuptools"],
["/opt/python/cp36-cp36m/bin/python", "-m", "pip", "install", ".", "--verbose"],
["/opt/python/cp36-cp36m/bin/python", "-m", "pip", "install", "boto3", "autopep8"],
["/opt/python/cp36-cp36m/bin/python", "-m", "unittest", "discover", "--verbose"],
["echo", "------ Python 3.5 ------"],
["/opt/python/cp35-cp35m/bin/python", "-m", "pip", "install", "--upgrade", "pip", "setuptools"],
["/opt/python/cp35-cp35m/bin/python", "-m", "pip", "install", ".", "--verbose"],
["/opt/python/cp35-cp35m/bin/python", "-m", "pip", "install", "boto3", "autopep8"],
["/opt/python/cp35-cp35m/bin/python", "-m", "unittest", "discover", "--verbose"]
["/opt/python/cp36-cp36m/bin/python", "-m", "unittest", "discover", "--verbose"]
],
"run_tests": false,
"_comment": "manylinux has all its own build steps, turn off 'tests' which is where normal build steps are declared. using data to program sucks"
Expand Down
2 changes: 1 addition & 1 deletion continuous-delivery/publish_to_prod_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ phases:
- pypirc=$(aws secretsmanager get-secret-value --secret-id "prod/aws-crt-python/.pypirc" --query "SecretString" | cut -f2 -d\") && echo "$pypirc" > ~/.pypirc
- export PKG_VERSION=$(git describe --tags | cut -f2 -dv)
- echo "Updating package version to ${PKG_VERSION}"
- sed --in-place -E "s/version='.+'/version='${PKG_VERSION}'/" setup.py
- sed --in-place -E "s/__version__ = '.+'/__version__ = '${PKG_VERSION}'/" awsiot/__init__.py
build:
commands:
- echo Build started on `date`
Expand Down
2 changes: 1 addition & 1 deletion continuous-delivery/publish_to_test_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ phases:
- cd aws-iot-device-sdk-python-v2
- export PKG_VERSION=$(git describe --tags | cut -f2 -dv)
- echo "Updating package version to ${PKG_VERSION}"
- sed --in-place -E "s/version='.+'/version='${PKG_VERSION}'/" setup.py
- sed --in-place -E "s/__version__ = '.+'/__version__ = '${PKG_VERSION}'/" awsiot/__init__.py
build:
commands:
- echo Build started on `date`
Expand Down
27 changes: 24 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,34 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.

import codecs
import re
import os
from setuptools import setup, find_packages

VERSION_RE = re.compile(r""".*__version__ = ["'](.*?)['"]""", re.S)
PROJECT_DIR = os.path.dirname(os.path.realpath(__file__))


def _load_readme():
readme_path = os.path.join(PROJECT_DIR, 'README.md')
with codecs.open(readme_path, 'r', 'utf-8') as f:
return f.read()


def _load_version():
init_path = os.path.join(PROJECT_DIR, 'awsiot', '__init__.py')
with open(init_path) as fp:
return VERSION_RE.match(fp.read()).group(1)


setup(
name='awsiotsdk',
version='1.0.0-dev',
version=_load_version(),
license='License :: OSI Approved :: Apache Software License',
description='AWS IoT SDK based on the AWS Common Runtime',
long_description=_load_readme(),
long_description_content_type='text/markdown',
author='AWS SDK Common Runtime Team',
url='https://github.com/aws/aws-iot-device-sdk-python-v2',
packages=find_packages(include=['awsiot*']),
Expand All @@ -19,7 +40,7 @@
"Operating System :: OS Independent",
],
install_requires=[
'awscrt==0.11.17',
'awscrt==0.11.19',
],
python_requires='>=3.5',
python_requires='>=3.6',
)

0 comments on commit 0e4e91f

Please sign in to comment.