Skip to content

Commit

Permalink
Update simulator to support python 3.9 (#378)
Browse files Browse the repository at this point in the history
* Update to py 3.9

* Test on Ubuntu18.04

* Update cicd job names

* Update version
  • Loading branch information
marianan authored Mar 3, 2022
1 parent 6f669ad commit 9fc0674
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependencies versions
ARG PYTHON_VERSION="3.7.10"
ARG PYTHON_VERSION="3.9.10"

# see https://hub.docker.com/_/python/?tab=tag
FROM python:${PYTHON_VERSION}-buster
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[![PyPI version](https://badge.fury.io/py/iotedgehubdev.svg)](https://badge.fury.io/py/iotedgehubdev)

## 0.14.11 - 2022-03-01
* Update Python support to 3.9

## 0.14.11 - 2022-02-10
* Update Device Twin API version to include support for Arrays in desired properties

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following table compares the requirements to run your solution on the IoT Ed
[Windows](https://docs.docker.com/docker-for-windows/install/), [macOS](https://docs.docker.com/docker-for-mac/install/) or [Linux](https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-docker-ce)

2. Install [Docker Compose (1.20.0+)](https://docs.docker.com/compose/install/#install-compose) (***Linux only***. *Compose has already been included in Windows/macOS Docker CE installation*)
3. Install [Python (3.5/3.6/3.7/3.8) and Pip](https://www.python.org/)
3. Install [Python (3.5/3.6/3.7/3.8/3.9) and Pip](https://www.python.org/)
4. Install **iotedgehubdev** by running the following command in your terminal:
```
pip install --upgrade iotedgehubdev
Expand Down
2 changes: 1 addition & 1 deletion iotedgehubdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
pkg_resources.declare_namespace(__name__)

__author__ = 'Microsoft Corporation'
__version__ = '0.14.11'
__version__ = '0.14.12'
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe'
__production__ = 'iotedgehubdev'
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
autopep8
backports.unittest-mock
click
docker==5.0.0
docker==5.0.3
flake8
pyOpenSSL>=20.0.1
python-dotenv
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from setuptools import find_packages, setup

VERSION = '0.14.11'
VERSION = '0.14.12'
# If we have source, validate that our version numbers match
# This should prevent uploading releases with mismatched versions.
try:
Expand All @@ -27,7 +27,7 @@

dependencies = [
'click',
'docker==5.0.0',
'docker==5.0.3',
'pyOpenSSL>=20.0.1',
'requests>=2.25.1',
'applicationinsights==0.11.9',
Expand Down Expand Up @@ -56,7 +56,7 @@
'iotedgehubdev = iotedgehubdev.cli:main',
],
},
python_requires='>=3.5, <3.9',
python_requires='>=3.5, <3.10',
classifiers=[
# As from http://pypi.python.org/pypi?%3Aaction=list_classifiers
# 'Development Status :: 1 - Planning',
Expand All @@ -79,6 +79,7 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',

'Topic :: Software Development :: Libraries :: Python Modules',
]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py37
envlist=py37, py38, py39

[testenv]
commands=
Expand Down
69 changes: 63 additions & 6 deletions vsts_ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,72 @@ jobs:
- job: MacOS
pool:
vmImage: macOS-latest
strategy:
matrix:
Python37:
python.version: "3.7"
TOXENV: "py37"
Python38:
python.version: "3.8"
TOXENV: "py38"
Python39:
python.version: "3.9"
TOXENV: "py39"
maxParallel: 1
steps:
- template: darwin/continuous-build-darwin.yml

- job: Windows
pool:
vmImage: windows-2019
strategy:
matrix:
Python37:
python.version: "3.7"
TOXENV: "py37"
Python38:
python.version: "3.8"
TOXENV: "py38"
Python39:
python.version: "3.9"
TOXENV: "py39"
maxParallel: 1
steps:
- template: win32/continuous-build-win32.yml

- job: Linux
- job: Linux1804
pool:
vmImage: ubuntu-18.04
strategy:
matrix:
Python37:
python.version: "3.7"
TOXENV: "py37"
Python38:
python.version: "3.8"
TOXENV: "py38"
Python39:
python.version: "3.9"
TOXENV: "py39"
maxParallel: 1
steps:
- template: linux/continuous-build-linux.yml

- job: Linux2004
pool:
vmImage: ubuntu-20.04
strategy:
matrix:
Python37:
python.version: "3.7"
TOXENV: "py37"
Python38:
python.version: "3.8"
TOXENV: "py38"
Python39:
python.version: "3.9"
TOXENV: "py39"
maxParallel: 1
steps:
- template: linux/continuous-build-linux.yml

Expand Down Expand Up @@ -50,21 +104,23 @@ jobs:
dependsOn:
- MacOS
- Windows
- Linux
- Linux1804
- Linux2004
pool:
name: Azure-IoT-EdgeExperience-1ES-Hosted-Windows
demands:
- ImageOverride -equals MMS2019TLS
steps:
- template: standalone-binaries/continuous-build-standalone-binaries-win32.yml
condition: and(succeeded('Windows'), succeeded('Linux'))
condition: and(succeeded('Windows'), succeeded('Linux1804'), succeeded('Linux2004'))

- job: PublishDropFile
dependsOn:
- MacOS
- Windows
- Linux
condition: and(succeeded('Windows'), succeeded('Linux'))
- Linux1804
- Linux2004
condition: and(succeeded('Windows'), succeeded('Linux1804'), succeeded('Linux2004'))
pool:
name: Azure-IoT-EdgeExperience-1ES-Hosted-Linux
demands:
Expand Down Expand Up @@ -154,7 +210,8 @@ jobs:
dependsOn:
- MacOS
- Windows
- Linux
- Linux1804
- Linux2004
- PublishDropFile
- PublishStandaloneBinariesForWin32
condition: and(succeeded(), eq(dependencies.PublishDropFile.outputs['PublishFlag.PYPI_PUBLISH_FLAG'], 'true'))
Expand Down
11 changes: 5 additions & 6 deletions vsts_ci/darwin/continuous-build-darwin.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
steps:
- task: UsePythonVersion@0
displayName: "Use Python 3.7"
inputs:
versionSpec: 3.7
versionSpec: "$(python.version)"
addToPath: true
architecture: "x64"

- script: |
az extension add --name azure-iot
az --version
displayName: "Install Azure Cli iot extension"
az extension add --name azure-iot
displayName: "Install Azure Cli Extension"
- script: |
pip install --upgrade pip
Expand All @@ -33,8 +32,8 @@ steps:
brew services start docker-machine
brew install docker-compose
docker version
sudo -E tox
displayName: "Install docker and run tests against iotedgehubdev source code with tox"
sudo -E `which tox` -e "$(TOXENV)"
displayName: "Run tests against iotedgehubdev source code"
env:
DARWIN_DEVICE_CONNECTION_STRING: $(DARWIN_DEVICE_CONNECTION_STRING)
IOTHUB_CONNECTION_STRING: $(IOTHUB_CONNECTION_STRING)
Expand Down
16 changes: 7 additions & 9 deletions vsts_ci/linux/continuous-build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
steps:
- task: UsePythonVersion@0
displayName: "Use Python 3.7"
inputs:
versionSpec: 3.7
versionSpec: "$(python.version)"
addToPath: true
architecture: "x64"

- script: |
pip install --upgrade pip
pip install --upgrade tox
az extension add --name azure-iot
az --version
displayName: "Update and install required tools"
az extension add --name azure-iot
displayName: "Install Azure Cli Extension"
- script: |
sudo -E `which tox`
displayName: "Run tests against iotedgehubdev source code with tox"
pip install --upgrade pip
pip install --upgrade tox
sudo -E `which tox` -e "$(TOXENV)"
displayName: "Run tests against iotedgehubdev source code"
env:
LINUX_DEVICE_CONNECTION_STRING: $(LINUX_DEVICE_CONNECTION_STRING)
IOTHUB_CONNECTION_STRING: $(IOTHUB_CONNECTION_STRING)
CONTAINER_REGISTRY_SERVER: $(CONTAINER_REGISTRY_SERVER)
CONTAINER_REGISTRY_USERNAME: $(CONTAINER_REGISTRY_USERNAME)
CONTAINER_REGISTRY_PASSWORD: $(CONTAINER_REGISTRY_PASSWORD)
TEST_CA_KEY_PASSPHASE: $(TEST_CA_KEY_PASSPHASE)
TOXENV: py36,py37
22 changes: 11 additions & 11 deletions vsts_ci/win32/continuous-build-win32.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
addToPath: true
architecture: "x64"

- powershell: |
choco install azure-cli
$env:Path += ";C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
az extension add --name azure-iot
az --version
displayName: "Install Azure Cli And Azure Cli Extension"
az extension add --name azure-iot
displayName: "Install Azure Cli Extension"
- powershell: |
$env:Path += ";C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin"
choco install python --version 3.7.9
$env:Path += ";C:\Python37;C:\Python37\Scripts"
python -m pip install --upgrade pip
pip install tox
tox
pip install --upgrade pip
pip install --upgrade tox
tox -e "$(TOXENV)"
displayName: "Run tests against iotedgehubdev source code"
env:
WINDOWS_DEVICE_CONNECTION_STRING: $(WINDOWS_DEVICE_CONNECTION_STRING)
Expand All @@ -21,4 +22,3 @@ steps:
CONTAINER_REGISTRY_USERNAME: $(CONTAINER_REGISTRY_USERNAME)
CONTAINER_REGISTRY_PASSWORD: $(CONTAINER_REGISTRY_PASSWORD)
TEST_CA_KEY_PASSPHASE: $(TEST_CA_KEY_PASSPHASE)
TOXENV: py36,py37

0 comments on commit 9fc0674

Please sign in to comment.