Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC 0.9.1 #18

Merged
merged 45 commits into from
Apr 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
d889dfc
Add Github Actions
DomAmato Mar 3, 2020
889b1b9
Update issue templates
DomAmato Mar 18, 2020
ccc06fb
wait for the process to be terminated (#17)
DomAmato Jan 3, 2020
50e7d2b
Properly handle when parsing other types of SMS PDUs (#16)
DomAmato Jan 3, 2020
22074be
Add chunking for messeages over 512 bytes (#15)
DomAmato Jan 3, 2020
6b36f54
Update test_Modem.py
DomAmato Jan 3, 2020
eeca8f9
check python and pip versions (#19)
DomAmato Jan 7, 2020
1ee0189
simplify version check
DomAmato Jan 7, 2020
cdddf6c
check python and pip version for update too
DomAmato Jan 7, 2020
4b6e2a2
call super.disconnect instead of connect (ensures event network.disco…
akumlehn Mar 3, 2020
cde545a
remove extraneous parenthesis (#24)
DomAmato Mar 24, 2020
a63eaba
include token
DomAmato Mar 24, 2020
b41028b
remove extraneous parenthesis (#26)
DomAmato Mar 25, 2020
e8fcaed
remove travis and rename actions
DomAmato Mar 24, 2020
4dbbb14
use pytest instead of coverage
DomAmato Mar 25, 2020
3996463
only test on 3.7 for now
DomAmato Mar 25, 2020
535e359
Allow sending raw AT commands to the modem (#28)
DomAmato Apr 3, 2020
ce138c8
Fix PPP Errors with disconnect and routing (#32)
DomAmato Apr 23, 2020
477e711
Concat to bytes not str (#33)
DomAmato May 4, 2020
bd52942
properly convert bytestring ascii value
DomAmato May 9, 2020
cfef0f5
convert from ascii int value to int
DomAmato May 20, 2020
0566314
make it possible to renable at sockets (#36)
DomAmato Jun 6, 2020
7c45b17
include support for Huawei Modem E372 (#21)
HectorMendez Jul 10, 2020
653481d
Add BG96 Support (#37)
DomAmato Jul 10, 2020
12f485e
try adding config on develop
DomAmato Jul 10, 2020
82affa9
add some more github actions (#41)
DomAmato Jul 11, 2020
0a53d69
add dependency label to config
DomAmato Jul 11, 2020
a52ecae
Dont encode buffer (#39)
DomAmato Jul 14, 2020
aa97656
add more info to release
DomAmato Jul 14, 2020
26e2421
Bump actions/setup-python from v1 to v2.0.2 (#51)
dependabot[bot] Jul 18, 2020
52ae291
Update psutil requirement from ~=5.6.3 to ~=5.7.2 (#50)
dependabot[bot] Jul 18, 2020
56a8f03
Update hjson requirement from ~=3.0.0 to ~=3.0.1 (#48)
dependabot[bot] Jul 18, 2020
fe7c9a4
Update pyudev requirement from ~=0.21.0 to ~=0.22.0 (#45)
dependabot[bot] Jul 18, 2020
1cac5d5
Update requests requirement from ~=2.22.0 to ~=2.24.0 (#44)
dependabot[bot] Jul 18, 2020
7d59380
add section for dependencies
DomAmato Jul 18, 2020
94e0d59
fix broken python actions
DomAmato Jan 5, 2021
19b1a04
Update psutil requirement from ~=5.7.2 to ~=5.8.0 (#70)
dependabot[bot] Jan 5, 2021
96c3468
Update pyusb requirement from ~=1.0.2 to ~=1.1.0 (#59)
dependabot[bot] Jan 5, 2021
2f92ec8
Update requests requirement from ~=2.24.0 to ~=2.25.1 (#67)
dependabot[bot] Jan 5, 2021
7157d82
Update pyserial requirement from ~=3.4.0 to ~=3.5 (#72)
dependabot[bot] Jan 5, 2021
99dde7a
Strip AT command result prefix when issued command ends with ? or % (#6)
TomPethtel Jan 17, 2021
e205937
Fix type for BG96 (#77)
rbalik Mar 9, 2021
bacbf38
allow setting APN (#79)
DomAmato Apr 27, 2021
582c8dc
properly handle bytes when reading from an open socket (#74)
DomAmato Apr 30, 2021
a622ee1
Update pyusb requirement from ~=1.1.0 to ~=1.1.1 (#75)
dependabot[bot] Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Help us stomp out bugs!
title: ''
labels: bug
assignees: ''

---

<!-- If you run into SDK issues, please go [here](https://community.hologram.io/c/hardware/sdk) for help and support:
-->
### Describe the problem


### Expected behavior
<!-- Please describe what you think the program should be doing here. -->


### Actual behavior
<!-- Please provide any useful debug logs/output here. This will help us diagnose
problems that you might have. Full stack traces can be extremely helpful here. -->


### Steps to reproduce the behavior
<!--Please provide the exact command(s) to reproduce the error. If it's non-deterministic,
try your best to describe your observations that might help us troubleshoot the error. -->

### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:
- **Python SDK installed via PyPI or GitHub**:
- **SDK version (use command below)**:
- **Python version**:
- **Hardware (modem) model**:

<!--
We will be adding an environment capture script soon for your convenience.

You can obtain the Python SDK version with:
`hologram version` -->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->

**Describe the solution you'd like**
<!-- A clear and concise description of what you want to happen. -->

**Describe alternatives you've considered**
<!-- A clear and concise description of any alternative solutions or features you've considered. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->
52 changes: 52 additions & 0 deletions .github/changelog-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name-template: 'v$RESOLVED_VERSION 🌈'

tag-template: 'v$RESOLVED_VERSION'

categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'debt'
- title: '🛠 Dependency Updates'
labels:
- 'dependencies'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'

version-resolver:
major:
labels:
- 'major'
- 'breaking'
minor:
labels:
- 'minor'
- 'feature'
patch:
labels:
- 'patch'
- 'bugfix'
- 'debt'
- 'dependencies'
default: patch

exclude-labels:
- 'skip-changelog'

template: |
## Changes

$CHANGES

**Release Date:** <DATE>
**Release Engineer:** $CONTRIBUTORS
**Previous Release:** $PREVIOUS_TAG
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Basic dependabot.yml file with
# minimum configuration for two package managers
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"


# Enable version updates for python pip
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
19 changes: 19 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Changelog Drafter

on:
push:
# develop is our tracking branch
branches:
- develop

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: changelog-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2.0.2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
39 changes: 39 additions & 0 deletions .github/workflows/testlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python Test and Lint

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with coverage and coveralls
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pip install coveralls pytest-cov
pytest --cov=Hologram tests/
coveralls
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Hologram/Api/Api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

HOLOGRAM_REST_API_BASEURL = 'https://dashboard.hologram.io/api/1'

class Api():
class Api:

def __init__(self, apikey='', username='', password=''):
# Logging setup.
Expand Down
2 changes: 1 addition & 1 deletion Hologram/Authentication/AES/AESCipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.backends import default_backend

class AESCipher():
class AESCipher:

# EFFECTS: Constructor that sets the IV to
def __init__(self, iv, key):
Expand Down
2 changes: 1 addition & 1 deletion Hologram/Authentication/Authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import logging
from logging import NullHandler

class Authentication():
class Authentication:

def __init__(self, credentials):
self.credentials = credentials
Expand Down
2 changes: 1 addition & 1 deletion Hologram/Cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

__version__ = '0.9.0'

class Cloud():
class Cloud:

def __repr__(self):
return type(self).__name__
Expand Down
8 changes: 5 additions & 3 deletions Hologram/CustomCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ def acceptIncomingConnection(self):
self._receive_cv.acquire()

if self.socketClose:
self.logger.debug('Closing socket connection')
self._receive_cv.release()
break

Expand All @@ -325,22 +326,23 @@ def __incoming_connection_thread(self, clientsocket):
clientsocket.settimeout(RECEIVE_TIMEOUT)

# Keep parsing the received data until timeout or receive no more data.
recv = ''
recv = b''
while True:
try:
result = clientsocket.recv(MAX_RECEIVE_BYTES)
self.logger.debug('Received message: %s', result)
except socket.timeout:
break
if not result:
break
recv += result

self.logger.info('Received message: %s', recv)
self.logger.info('Received message: %s', recv.decode())

self._receive_buffer_lock.acquire()

# Append received message into receive buffer
self._receive_buffer.append(recv)
self._receive_buffer.append(recv.decode())
self.logger.debug('Receive buffer: %s', self._receive_buffer)

self._receive_buffer_lock.release()
Expand Down
2 changes: 1 addition & 1 deletion Hologram/Event/Event.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# LICENSE: Distributed under the terms of the MIT License
import logging

class Event():
class Event:
_funcLookupTable = {}
def __init__(self):
self.__dict__ = self._funcLookupTable
Expand Down
13 changes: 10 additions & 3 deletions Hologram/HologramCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,10 @@ def popReceivedSMS(self):
def __parse_hologram_json_result(self, result):
try:
resultList = json.loads(result)
resultList[0] = int(resultList[0])
if isinstance(resultList, bytes):
resultList[0] = int(chr(resultList[0]))
else:
resultList[0] = int(resultList[0])
except ValueError:
self.logger.error('Server replied with invalid JSON [%s]', result)
resultList = [ERR_UNKNOWN]
Expand All @@ -200,8 +203,12 @@ def __parse_hologram_compact_result(self, result):
return [ERR_UNKNOWN]

resultList = []
for x in result:
resultList.append(int(x))
if isinstance(result, bytes):
for x in result:
resultList.append(int(chr(x)))
else:
for x in result:
resultList.append(int(x))

if len(resultList) == 0:
resultList = [ERR_UNKNOWN]
Expand Down
Loading