File tree Expand file tree Collapse file tree 6 files changed +84
-21
lines changed
Expand file tree Collapse file tree 6 files changed +84
-21
lines changed Original file line number Diff line number Diff line change 1+ name : Python application
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - master
7+ push :
8+ branches :
9+ - master
10+
11+ jobs :
12+ build :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - uses : actions/checkout@v1
16+ - name : Set up Python 3.7
17+ uses : actions/setup-python@v1
18+ with :
19+ python-version : 3.7
20+ - name : Install dependencies
21+ run : |
22+ python -m pip install --upgrade pip
23+ pip install flake8
24+ - name : Lint with flake8
25+ run : |
26+ flake8 . --count --max-line-length=79 --statistics
Original file line number Diff line number Diff line change 22
33from os import path
44import functools
5- import gateway_addon
65import signal
76import sys
87import time
1211from pkg .tide_calendar_adapter import TideCalendarAdapter # noqa
1312
1413
15- _API_VERSION = {
16- 'min' : 2 ,
17- 'max' : 2 ,
18- }
1914_ADAPTER = None
2015
2116print = functools .partial (print , flush = True )
@@ -30,11 +25,6 @@ def cleanup(signum, frame):
3025
3126
3227if __name__ == '__main__' :
33- if gateway_addon .API_VERSION < _API_VERSION ['min' ] or \
34- gateway_addon .API_VERSION > _API_VERSION ['max' ]:
35- print ('Unsupported API version.' )
36- sys .exit (0 )
37-
3828 signal .signal (signal .SIGINT , cleanup )
3929 signal .signal (signal .SIGTERM , cleanup )
4030 _ADAPTER = TideCalendarAdapter (verbose = True )
Original file line number Diff line number Diff line change 1+ {
2+ "author" : " Mozilla IoT" ,
3+ "description" : " Tide calendar for Mozilla WebThings Gateway" ,
4+ "gateway_specific_settings" : {
5+ "webthings" : {
6+ "exec" : " python3 {path}/main.py" ,
7+ "primary_type" : " adapter" ,
8+ "strict_max_version" : " *" ,
9+ "strict_min_version" : " 0.10.0"
10+ }
11+ },
12+ "homepage_url" : " https://github.com/mozilla-iot/tide-calendar-adapter" ,
13+ "id" : " tide-calendar-adapter" ,
14+ "license" : " MPL-2.0" ,
15+ "manifest_version" : 1 ,
16+ "name" : " Tide Calendar" ,
17+ "options" : {
18+ "default" : {
19+ "stations" : [],
20+ "unit" : " ft"
21+ },
22+ "schema" : {
23+ "type" : " object" ,
24+ "required" : [
25+ " stations" ,
26+ " unit"
27+ ],
28+ "properties" : {
29+ "stations" : {
30+ "type" : " array" ,
31+ "description" : " List of NOAA station IDs" ,
32+ "items" : {
33+ "type" : " integer"
34+ }
35+ },
36+ "unit" : {
37+ "type" : " string" ,
38+ "description" : " Water level unit system" ,
39+ "enum" : [
40+ " english" ,
41+ " metric"
42+ ]
43+ }
44+ }
45+ }
46+ },
47+ "short_name" : " Tide" ,
48+ "version" : " 0.2.0"
49+ }
Original file line number Diff line number Diff line change 11{
22 "name" : " tide-calendar-adapter" ,
33 "display_name" : " Tide Calendar" ,
4- "version" : " 0.1 .0" ,
4+ "version" : " 0.2 .0" ,
55 "description" : " Tide calendar for Mozilla WebThings Gateway" ,
66 "author" : " Mozilla IoT" ,
77 "main" : " main.py" ,
2323 },
2424 "files" : [
2525 " LICENSE" ,
26+ " README.md" ,
2627 " SHA256SUMS" ,
2728 " lib" ,
2829 " main.py" ,
30+ " manifest.json" ,
2931 " pkg/__init__.py" ,
3032 " pkg/tide_calendar_adapter.py" ,
3133 " pkg/tide_calendar_device.py" ,
Original file line number Diff line number Diff line change 55version=$( grep version package.json | cut -d: -f2 | cut -d\" -f2)
66
77# Clean up from previous releases
8- rm -rf * .tgz package
9- rm -f SHA256SUMS
10- rm -rf lib
8+ rm -rf * .tgz package SHA256SUMS lib
119
1210# Prep new package
13- mkdir lib
14- mkdir package
11+ mkdir lib package
1512
1613# Pull down Python dependencies
17- pip3 install -r requirements.txt -t lib --no-binary pyHS100 --prefix " "
14+ pip3 install -r requirements.txt -t lib --no-binary pytz,requests --prefix " "
1815
1916# Put package together
20- cp -r lib pkg LICENSE package.json * .py package/
17+ cp -r lib pkg LICENSE manifest.json package.json * .py README.md package/
2118find package -type f -name ' *.pyc' -delete
2219find package -type d -empty -delete
2320
2421# Generate checksums
2522cd package
26- sha256sum * .py pkg/* .py LICENSE > SHA256SUMS
27- find lib -type f -exec sha256sum {} \; >> SHA256SUMS
23+ find . -type f \! -name SHA256SUMS -exec sha256sum {} \; >> SHA256SUMS
2824cd -
2925
3026# Make the tarball
Original file line number Diff line number Diff line change 1- pytz == 2019.1
1+ pytz == 2019.2
22requests == 2.22.0
You can’t perform that action at this time.
0 commit comments