Skip to content

Commit

Permalink
Merge pull request #213 from ibm-watson-iot/actions
Browse files Browse the repository at this point in the history
Set up GitHub Actions & remove QuickStart support
  • Loading branch information
durera authored Jun 3, 2024
2 parents 96a7622 + cdab690 commit 7cc658f
Show file tree
Hide file tree
Showing 113 changed files with 466 additions and 13,928 deletions.
3 changes: 0 additions & 3 deletions .coveragerc

This file was deleted.

2 changes: 0 additions & 2 deletions .coveralls.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build Documentation

on:
push:
branches: [ '**' ]
tags-ignore: [ '**' ]

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]

- name: Install and Build
run: |
python -m pip install -q mkdocs
mkdocs build --verbose --clean --strict
- name: Deploy
uses: JamesIves/[email protected]
if: github.ref == 'refs/heads/master'
with:
branch: gh-pages
folder: site
61 changes: 61 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Python Package

on:
push:
branches: [ "*" ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
primary-config: ["true", "false"]
# There may be a better way to do this, but it was the first way I found to set a variable for specific matrix entry
exclude:
- python-version: "3.9"
primary-config: "true"
- python-version: "3.10"
primary-config: "false"
- python-version: "3.11"
primary-config: "true"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install .[dev] flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest (only on Python 3.11 to avoid concurrency issues)
if: ${{ (github.ref == 'refs/heads/actions') && (matrix.primary-config == 'true') }}
env:
ONE_JOB_ONLY_TESTS: ${{ matrix.primary-config }}
WIOTP_API_KEY: ${{ secrets.WIOTP_API_KEY }}
WIOTP_API_TOKEN: ${{ secrets.WIOTP_API_TOKEN }}
WIOTP_ORG_ID: ${{ secrets.WIOTP_ORG_ID }}
CLOUDANT_HOST: ${{ secrets.CLOUDANT_HOST }}
CLOUDANT_PORT: ${{ secrets.CLOUDANT_PORT }}
CLOUDANT_USERNAME: ${{ secrets.CLOUDANT_USERNAME }}
CLOUDANT_PASSWORD: ${{ secrets.CLOUDANT_PASSWORD }}
EVENTSTREAMS_API_KEY: ${{ secrets.EVENTSTREAMS_API_KEY }}
EVENTSTREAMS_ADMIN_URL: ${{ secrets.EVENTSTREAMS_ADMIN_URL }}
EVENTSTREAMS_BROKER1: ${{ secrets.EVENTSTREAMS_BROKER1 }}
EVENTSTREAMS_BROKER2: ${{ secrets.EVENTSTREAMS_BROKER2 }}
EVENTSTREAMS_BROKER3: ${{ secrets.EVENTSTREAMS_BROKER3 }}
EVENTSTREAMS_BROKER4: ${{ secrets.EVENTSTREAMS_BROKER4 }}
EVENTSTREAMS_BROKER5: ${{ secrets.EVENTSTREAMS_BROKER5 }}
EVENTSTREAMS_BROKER6: ${{ secrets.EVENTSTREAMS_BROKER6 }}
EVENTSTREAMS_USER: ${{ secrets.EVENTSTREAMS_USER }}
EVENTSTREAMS_PASSWORD: ${{ secrets.EVENTSTREAMS_PASSWORD }}
run: |
pytest
29 changes: 29 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Upload Python Package

on:
release:
types: [ published ]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install
run: |
python -m pip install --upgrade pip
pip install .[dev]
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ samples/deviceFactory/bin
samples/*.exe
samples/rbac-config.yaml
test/.DS_Store
/venv
pandoc-*-amd64.deb
README.rst
Binary file removed .tox.ini.swp
Binary file not shown.
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.PHONY: docs install test build clean

venv:
python3 -m venv venv

clean:
rm -rf venv

install: venv
. venv/bin/activate && python -m pip install --editable .[dev]

test: venv
. venv/bin/activate && pytest

build: venv
rm README.rst
. venv/bin/activate && python -m build

docs:
cd docs && make html
46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,59 @@
# Python for IBM Watson IoT Platform
Python for IBM Watson IoT Platform
===============================================================================

[![Build Status](https://travis-ci.org/ibm-watson-iot/iot-python.svg?branch=master)](https://travis-ci.org/ibm-watson-iot/iot-python)
[![Coverage Status](https://coveralls.io/repos/github/ibm-watson-iot/iot-python/badge.svg?branch=master)](https://coveralls.io/github/ibm-watson-iot/iot-python?branch=master)
[![GitHub issues](https://img.shields.io/github/issues/ibm-watson-iot/iot-python.svg)](https://github.com/ibm-watson-iot/iot-python/issues)
[![GitHub](https://img.shields.io/github/license/ibm-watson-iot/iot-python.svg)](https://github.com/ibm-watson-iot/iot-python/blob/master/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/wiotp-sdk.svg)](https://pypi.org/project/wiotp-sdk/)
![Project Status](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11-blue)
[![Downloads](https://pepy.tech/badge/ibmiotf)](https://pepy.tech/project/ibmiotf)
[![Downloads](https://pepy.tech/badge/wiotp-sdk)](https://pepy.tech/project/wiotp-sdk)
[![Code Style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

Python module for interacting with the [IBM Watson IoT Platform](https://internetofthings.ibmcloud.com).
Python module for interacting with **Maximo IoT** and **[IBM Watson IoT Platform](https://internetofthings.ibmcloud.com)**

- [Python 3.8](https://www.python.org/downloads/release/python-382/) (recommended)
- Python 3.7
- Python 3.6
- Python 3.11
- Python 3.10
- Python 3.9

Note: As of version 0.12, versions of Python less than 3.6 are not officially supported. Compatability with older versions of Python is not guaranteed.

## Product Withdrawal Notice
Product Withdrawal Notice
-------------------------------------------------------------------------------
Per the September 8, 2020 [announcement](https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?subtype=ca&infotype=an&appname=iSource&supplier=897&letternum=ENUS920-136#rprodnx) IBM Watson IoT Platform (5900-A0N) has been withdrawn from marketing effective **December 9, 2020**. As a result, updates to this project will be limited.


## Dependencies

Dependencies
-------------------------------------------------------------------------------
- [paho-mqtt](https://pypi.python.org/pypi/paho-mqtt)
- [iso8601](https://pypi.python.org/pypi/iso8601)
- [pytz](https://pypi.python.org/pypi/pytz)
- [requests](https://pypi.python.org/pypi/requests)


## Installation

Installation
-------------------------------------------------------------------------------
Install the [latest version](https://pypi.org/project/wiotp-sdk/) of the library with pip

```
# pip install wiotp-sdk
```


## Uninstall

Uninstall
-------------------------------------------------------------------------------
Uninstalling the module is simple.

```
# pip uninstall wiotp-sdk
```

## Legacy ibmiotf Module

Version `0.4.0` of the old [ibmiotf](https://pypi.python.org/pypi/ibmiotf) pre-release is still available, if you do not wish to upgrade to the new version, we have no plans to remove this from pypi at this time, however it will not be getting any updates.


## Documentation

Documentation
-------------------------------------------------------------------------------
https://ibm-watson-iot.github.io/iot-python/


## Supported Features

Supported Features
-------------------------------------------------------------------------------
- **Device Connectivity**: Connect your device(s) to Watson IoT Platform with ease using this library
- **Gateway Connectivity**: Connect your gateway(s) to Watson IoT Platform with ease using this library
- **Application connectivity**: Connect your application(s) to Watson IoT Platform with ease using this library
Expand All @@ -69,7 +65,3 @@ https://ibm-watson-iot.github.io/iot-python/
- **Scalable Applications**: Supports load balancing of MQTT subscriptions over multiple application instances.
- **Auto Reconnect**: All clients support automatic reconnect to the Platform in the event of a network interruption.
- **Websockets**: Support device/gateway/application connectivity to Watson IoT Platform using WebSocket


## Unsupported Features
- **Client side Certificate based authentication**: [Client side Certificate based authentication](https://console.ng.bluemix.net/docs/services/IoT/reference/security/RM_security.html)n
Loading

0 comments on commit 7cc658f

Please sign in to comment.