Skip to content

Commit

Permalink
Merge branch 'develop' for release 1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesoff committed Jun 6, 2021
2 parents a418720 + b4e624a commit 7ba0df4
Show file tree
Hide file tree
Showing 162 changed files with 7,103 additions and 1,486 deletions.
38 changes: 38 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: develop
ignore:
- dependency-name: boto3
- dependency-name: black
versions:
- 21.4b0
- dependency-name: pylint
versions:
- 2.7.0
- 2.7.1
- 2.7.3
- 2.7.4
- 2.8.1
- dependency-name: urllib3
versions:
- 1.26.4
- dependency-name: pytest
versions:
- 6.2.3
- dependency-name: colorlog
versions:
- 4.8.0
- dependency-name: flake8
versions:
- 3.9.0
- dependency-name: ping3
versions:
- 2.7.0
- dependency-name: arrow
versions:
- 1.0.3
17 changes: 11 additions & 6 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: ['3.6', '3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }}

steps:
Expand All @@ -22,14 +22,19 @@ jobs:
run: pip --version
- name: Update pip
run: pip install --upgrade pip
- name: Install pipenv
run: pip install pipenv
- name: pipenv install
run: pipenv --bare install --dev
- name: Install poetry
run: pip install poetry
- name: poetry install
run: poetry install
- name: check code style with black
run: make black
if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' }} # broken in 3.6 currently
- name: flake8 tests
run: make flake8
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' }}
- name: bandit
run: make bandit
if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' }}
- name: mypy
run: make mypy
if: ${{ matrix.python-version == '3.8' || matrix.python-version == '3.9' }}
16 changes: 9 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: ['3.6', '3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }}

steps:
Expand All @@ -24,18 +24,20 @@ jobs:
run: pip --version
- name: Update pip
run: pip install --upgrade pip
- name: Install pipenv
run: pip install pipenv
- name: pipenv install
run: pipenv --bare install --dev
- name: Install poetry
run: pip install poetry==1.1.4
- name: poetry install
run: poetry install
- name: Integration tests
run: make integration-tests
- name: Integration tests (threaded)
run: make integration-tests-threaded
- name: Config environment variables tests
run: make env-test
- name: Unit tests
run: make unit-test
- name: Network logger tests
run: make network-test
- name: Upload to codecov
run: pipenv run codecov --token="${{ secrets.CODECOV_TOKEN }}"
- name: Output coverage report
run: poetry run coverage xml -i
- uses: codecov/codecov-action@v1
12 changes: 7 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
python-version: ['3.6', '3.7', '3.8', '3.9']
name: Python ${{ matrix.python-version }} (Windows)

steps:
Expand All @@ -22,14 +22,16 @@ jobs:
run: pip --version
- name: Update pip
run: pip install --user --upgrade pip
- name: Install pipenv
run: pip install pipenv
- name: pipenv install
run: pipenv --bare install --dev
- name: Install poetry
run: pip install poetry==1.1.4
- name: poetry install
run: poetry install
- name: create HTML output folder
run: mkdir html
- name: Integration tests
run: make integration-tests
- name: Integration tests (threaded)
run: make integration-tests-threaded
- name: Unit tests
run: make unit-test
- uses: codecov/codecov-action@v1
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ network.log
.coverage.*
.ring_token.cache
simplemonitor.code-workspace
client.log
master.log
coverage.xml
_build
old_docs
docs/_build
*.log
.tox
pyrightconfig.json
48 changes: 24 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: tests/test_alerter.py
- id: flake8
- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
hooks:
- id: mypy
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: tests/test_alerter.py
- id: flake8
- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.3
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21 # pick the isort version you'd like to use from https://github.com/pre-commit/mirrors-isort/releases
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.782
hooks:
- id: mypy
26 changes: 26 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
1.11:
* Run monitors multithreaded
* Add TLS certificate expiry monitor
* Add unifi failover/watchdog monitors
* Add sms77 alerter
* Add twilio SMS alerter
* Add fileloggerng logger with rotation support
* Add seq logger
* Improve timezone support for alerters
* Add option to only listen on IPv4 for remote instances
* Make group filtering work on remote monitors
* Add "_all" group
* Add enabled option for monitors
* Improve HASS logger
* Add new remote logging protocol
* Remove pickle support for remote instances
* Add client_name option for remote logging
* Add descriptions to alerters and loggers
* Add support for cc field in SMTP logger
* Use jinja2 template for HTML logger rendering
* Add map output option for HTML logger
* Add gps property to monitors, currently only used for map output
* Rewrite documentation, now built with Sphinx and hosted at RTD
* Use poetry for project/dependency management
* Assorted code refactoring and bugfixes

1.10:
* REQUIRE PYTHON >= 3.6.2
* New style HTML page for HTML logger
Expand Down
9 changes: 7 additions & 2 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ Ed
Erwin
Fred
FvDxxx
G
Herman
James
Jamie
Joe
John
MattK
Michał
Paolo
Expand All @@ -22,12 +25,14 @@ User
Valentin
Wayward
WoJ
andrew
andronkyr
dan
dependabot-preview[bot]
dependabot[bot]
danieldh206
error454
graham
nvnwater
pheuzoune
r4r3
rarosalion
shakreiner
Expand Down
33 changes: 18 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,55 +1,58 @@
.PHONY: flake8 dist twine twine-test integration-tests env-test network-test black mypy linting mypy-strict bandit bandit-strict

ifeq ($(OS),Windows_NT)
ENVPATH := $(shell python -c "import os.path; import sys; print(os.path.join(sys.exec_prefix, 'Scripts'))")\\
MOCKSPATH := tests\mocks;
INTEGRATION_CONFIG := tests/monitor-windows.ini
else
ENVPATH := $(shell pipenv --venv)/bin/
MOCKSPATH := $(PWD)/tests/mocks:
INTEGRATION_CONFIG := tests/monitor.ini
endif
PIPENV := $(shell which pipenv)
PIPENV := $(shell which poetry)

flake8:
pipenv run flake8 *.py simplemonitor/
poetry run flake8 *.py simplemonitor/

integration-tests:
PATH="$(MOCKSPATH)$(PATH)" $(PIPENV) run coverage run monitor.py -1 -v -d -f $(INTEGRATION_CONFIG) -j 1

integration-tests-threaded:
PATH="$(MOCKSPATH)$(PATH)" $(PIPENV) run coverage run monitor.py -1 -v -d -f $(INTEGRATION_CONFIG)

env-test:
env TEST_VALUE=myenv pipenv run coverage run --append monitor.py -t -f tests/monitor-env.ini
env TEST_VALUE=myenv poetry run coverage run --append monitor.py -t -f tests/monitor-env.ini

unit-test:
pipenv run coverage run --append -m unittest discover -s tests
poetry run pytest --cov-append --cov=simplemonitor tests

network-test:
pipenv run tests/test-network.sh
rm -f master.log
rm -f client.log
poetry run tests/test-network.sh

dist:
rm -f dist/simplemonitor-*
pipenv run python setup.py sdist bdist_wheel
poetry run python setup.py sdist bdist_wheel

twine-test:
pipenv run python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*
poetry run python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

twine:
pipenv run python -m twine upload dist/*
poetry run python -m twine upload dist/*

black:
pipenv run black --check --diff *.py simplemonitor/
poetry run black --check --diff *.py simplemonitor/

mypy:
pipenv run mypy *.py simplemonitor/
poetry run mypy *.py simplemonitor/

mypy-strict:
pipenv run mypy --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --disallow-untyped-decorators *.py simplemonitor/
poetry run mypy --disallow-untyped-calls --disallow-untyped-defs --disallow-incomplete-defs --disallow-untyped-decorators *.py simplemonitor/

bandit:
pipenv run bandit -r -ll *.py simplemonitor/
poetry run bandit -r -ll *.py simplemonitor/

bandit-strict:
pipenv run bandit -r -l *.py simplemonitor/
poetry run bandit -r -l *.py simplemonitor/

linting: black flake8 mypy bandit

Expand Down
31 changes: 0 additions & 31 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 7ba0df4

Please sign in to comment.