mirror of https://github.com/caronc/apprise
Python 3.9 Beta CI added & Fedora 33 Rawhide support (#265)
parent
3b8b790871
commit
ffcde046b0
|
@ -19,6 +19,8 @@ matrix:
|
||||||
env: TOXENV=py37
|
env: TOXENV=py37
|
||||||
- python: "3.8"
|
- python: "3.8"
|
||||||
env: TOXENV=py38
|
env: TOXENV=py38
|
||||||
|
- python: "3.9-dev"
|
||||||
|
env: TOXENV=py39
|
||||||
- python: "pypy2.7-6.0"
|
- python: "pypy2.7-6.0"
|
||||||
env: TOXENV=pypy
|
env: TOXENV=pypy
|
||||||
- python: "pypy3.5-6.0"
|
- python: "pypy3.5-6.0"
|
||||||
|
|
|
@ -142,14 +142,6 @@ class NotifySimplePush(NotifyBase):
|
||||||
# Default Event Name
|
# Default Event Name
|
||||||
self.event = None
|
self.event = None
|
||||||
|
|
||||||
# Encrypt Message (providing support is available)
|
|
||||||
if self.password and self.user and not CRYPTOGRAPHY_AVAILABLE:
|
|
||||||
# Provide the end user at least some notification that they're
|
|
||||||
# not getting what they asked for
|
|
||||||
self.logger.warning(
|
|
||||||
'SimplePush extended encryption is not supported by this '
|
|
||||||
'system.')
|
|
||||||
|
|
||||||
# Used/cached in _encrypt() function
|
# Used/cached in _encrypt() function
|
||||||
self._iv = None
|
self._iv = None
|
||||||
self._iv_hex = None
|
self._iv_hex = None
|
||||||
|
@ -189,6 +181,15 @@ class NotifySimplePush(NotifyBase):
|
||||||
Perform SimplePush Notification
|
Perform SimplePush Notification
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
# Encrypt Message (providing support is available)
|
||||||
|
if self.password and self.user and not CRYPTOGRAPHY_AVAILABLE:
|
||||||
|
# Provide the end user at least some notification that they're
|
||||||
|
# not getting what they asked for
|
||||||
|
self.logger.warning(
|
||||||
|
"Authenticated SimplePush Notifications are not supported by "
|
||||||
|
"this system; `pip install cryptography`.")
|
||||||
|
return False
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
'User-Agent': self.app_id,
|
'User-Agent': self.app_id,
|
||||||
'Content-type': "application/x-www-form-urlencoded",
|
'Content-type': "application/x-www-form-urlencoded",
|
||||||
|
|
|
@ -82,9 +82,11 @@ BuildRequires: python-six
|
||||||
BuildRequires: python2-click >= 5.0
|
BuildRequires: python2-click >= 5.0
|
||||||
BuildRequires: python-markdown
|
BuildRequires: python-markdown
|
||||||
%if 0%{?rhel} && 0%{?rhel} <= 7
|
%if 0%{?rhel} && 0%{?rhel} <= 7
|
||||||
|
BuildRequires: python-cryptography
|
||||||
BuildRequires: python-babel
|
BuildRequires: python-babel
|
||||||
BuildRequires: python-yaml
|
BuildRequires: python-yaml
|
||||||
%else
|
%else
|
||||||
|
BuildRequires: python2-cryptography
|
||||||
BuildRequires: python2-babel
|
BuildRequires: python2-babel
|
||||||
BuildRequires: python2-yaml
|
BuildRequires: python2-yaml
|
||||||
%endif
|
%endif
|
||||||
|
@ -140,6 +142,7 @@ BuildRequires: python%{python3_pkgversion}-click >= 5.0
|
||||||
BuildRequires: python%{python3_pkgversion}-markdown
|
BuildRequires: python%{python3_pkgversion}-markdown
|
||||||
BuildRequires: python%{python3_pkgversion}-yaml
|
BuildRequires: python%{python3_pkgversion}-yaml
|
||||||
BuildRequires: python%{python3_pkgversion}-babel
|
BuildRequires: python%{python3_pkgversion}-babel
|
||||||
|
BuildRequires: python%{python3_pkgversion}-cryptography
|
||||||
Requires: python%{python3_pkgversion}-requests
|
Requires: python%{python3_pkgversion}-requests
|
||||||
Requires: python%{python3_pkgversion}-requests-oauthlib
|
Requires: python%{python3_pkgversion}-requests-oauthlib
|
||||||
Requires: python%{python3_pkgversion}-six
|
Requires: python%{python3_pkgversion}-six
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import pytest
|
||||||
import apprise
|
import apprise
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -43,6 +44,8 @@ import logging
|
||||||
logging.disable(logging.CRITICAL)
|
logging.disable(logging.CRITICAL)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
'cryptography' not in sys.modules, reason="requires cryptography")
|
||||||
def test_simplepush_plugin(tmpdir):
|
def test_simplepush_plugin(tmpdir):
|
||||||
"""
|
"""
|
||||||
API: NotifySimplePush Plugin()
|
API: NotifySimplePush Plugin()
|
||||||
|
@ -73,11 +76,15 @@ def test_simplepush_plugin(tmpdir):
|
||||||
reload(sys.modules['apprise.Apprise'])
|
reload(sys.modules['apprise.Apprise'])
|
||||||
reload(sys.modules['apprise'])
|
reload(sys.modules['apprise'])
|
||||||
|
|
||||||
# imported and therefore the extra encryption offered by SimplePush is
|
# Without the cryptography library objects can still be instantiated
|
||||||
# not available...
|
# however notifications will fail
|
||||||
obj = apprise.Apprise.instantiate('spush://salt:pass@valid_api_key')
|
obj = apprise.Apprise.instantiate('spush://salt:pass@valid_api_key')
|
||||||
assert obj is not None
|
assert obj is not None
|
||||||
|
|
||||||
|
# We can't notify with a user/pass combo and no cryptography library
|
||||||
|
assert obj.notify(
|
||||||
|
title="test message title", body="message body") is False
|
||||||
|
|
||||||
# Tidy-up / restore things to how they were
|
# Tidy-up / restore things to how they were
|
||||||
os.unlink(str(suite.join("{}.py".format(module_name))))
|
os.unlink(str(suite.join("{}.py".format(module_name))))
|
||||||
reload(sys.modules['apprise.plugins.NotifySimplePush'])
|
reload(sys.modules['apprise.plugins.NotifySimplePush'])
|
||||||
|
|
12
tox.ini
12
tox.ini
|
@ -1,5 +1,5 @@
|
||||||
[tox]
|
[tox]
|
||||||
envlist = py27,py35,py36,py37,py38,pypy,pypy3,coverage-report
|
envlist = py27,py35,py36,py37,py38,py39,pypy,pypy3,coverage-report
|
||||||
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
@ -65,6 +65,16 @@ commands =
|
||||||
coverage run --parallel -m pytest {posargs}
|
coverage run --parallel -m pytest {posargs}
|
||||||
flake8 . --count --show-source --statistics
|
flake8 . --count --show-source --statistics
|
||||||
|
|
||||||
|
[testenv:py39]
|
||||||
|
deps=
|
||||||
|
dbus-python
|
||||||
|
-r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/dev-requirements.txt
|
||||||
|
commands =
|
||||||
|
python setup.py compile_catalog
|
||||||
|
coverage run --parallel -m pytest {posargs}
|
||||||
|
flake8 . --count --show-source --statistics
|
||||||
|
|
||||||
[testenv:pypy]
|
[testenv:pypy]
|
||||||
deps=
|
deps=
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
|
|
Loading…
Reference in New Issue