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

Switch to pydantic #359

Draft
wants to merge 137 commits into
base: 2.0.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
9a7079d
changed the core to use pydantic instead of json schema
liiight Feb 22, 2020
69aaea9
converted email to use the new schema model
liiight Feb 22, 2020
7df19cf
finished smtp
liiight Feb 23, 2020
0d19c2d
made email work with schema model
liiight Feb 23, 2020
d74c4a0
added base config to model
liiight Feb 23, 2020
6ec4547
refactored gitter
liiight Feb 23, 2020
80037b2
converted provider
liiight Feb 25, 2020
96805c8
converted provider
liiight Feb 25, 2020
d1c41fc
formatted mailgun
liiight Feb 26, 2020
4712f3d
fixed and verified mailgun
liiight Feb 27, 2020
4ea6a6c
fixed mail gun validation test
liiight Feb 27, 2020
972bb31
fixed mailgun test
liiight Feb 27, 2020
bf769ac
fixed email and tests
liiight Feb 27, 2020
060ad49
fixed gitter
liiight Feb 27, 2020
b2f698c
removed hipchat as its dead
liiight Feb 27, 2020
1cb4f35
removed hipchat from docs
liiight Feb 27, 2020
dc6cfdf
typos
liiight Feb 27, 2020
a24befc
removed hipchat from README.MD
liiight Feb 27, 2020
bf58cb1
added join options
liiight Feb 27, 2020
9d432ba
converted pagerduty
liiight Feb 27, 2020
36ce306
added to_dict method
liiight Feb 27, 2020
d6f5b3e
converted popcornnotify
liiight Feb 28, 2020
97c205b
converted pushbullet
liiight Feb 28, 2020
070fb8b
converted pushbullet
liiight Feb 28, 2020
a0df67e
implemented pushbullet file upload
liiight Feb 28, 2020
2db5cfd
minor tweak
liiight Feb 28, 2020
78cbc2d
tweak
liiight Feb 28, 2020
de3c2ee
refactored pushbullet devices
liiight Feb 28, 2020
bb9f568
converted pushover
liiight Feb 28, 2020
68e78f5
typo
liiight Feb 28, 2020
243a1e4
use baseschema class for gitter
liiight Feb 29, 2020
a5a8941
change order in join schema
liiight Feb 29, 2020
9d9487a
used schema helper to convert to dict
liiight Feb 29, 2020
d5442d9
converted simplepush.py
liiight Mar 1, 2020
e5dfd24
added more stuff
liiight Mar 1, 2020
a8ab8d5
added stub schema
liiight Mar 1, 2020
85f6670
added docstring
liiight Mar 1, 2020
f6a8824
added element
liiight Mar 1, 2020
88bdeb4
added image element
liiight Mar 1, 2020
0fa42b5
added multiselect menu
liiight Mar 1, 2020
140110b
added more elements
liiight Mar 1, 2020
4ad976b
added more elements
liiight Mar 1, 2020
318c1de
added more elements
liiight Mar 1, 2020
98ca28f
added all elements
liiight Mar 1, 2020
71f9008
tweak
liiight Mar 1, 2020
a8ed5d7
updated deps
liiight Mar 1, 2020
b0face3
added all blocks
liiight Mar 1, 2020
c4b2960
removed redundant fields
liiight Mar 1, 2020
757a406
finished slack schema
liiight Mar 3, 2020
761e77b
fixed schema issues
liiight Mar 3, 2020
34647fa
fixed tests
liiight Mar 3, 2020
7b42d27
added check for emoji
liiight Mar 3, 2020
ef3e9ff
made dynamic text object schema more strict
liiight Mar 3, 2020
2fb5231
fixed few schema bugs
liiight Mar 3, 2020
6de0437
fixed context schema
liiight Mar 3, 2020
4473716
fixed context schema
liiight Mar 3, 2020
98ea2bc
moved element group into blocks
liiight Mar 3, 2020
b79064b
added all import to slack main
liiight Mar 3, 2020
dc409ad
readded defaults for ease of use when building via pydantic objects7
liiight Mar 4, 2020
382bd07
renamed all the classes to get rid of the redundant Slack prefix
liiight Mar 4, 2020
f3f8671
renamed BlockTextObject to Text
liiight Mar 4, 2020
2deae45
added statuspage schema
liiight Mar 4, 2020
3240aa4
typo
liiight Mar 4, 2020
15c44de
completed statuspage
liiight Mar 5, 2020
dafbf92
renamed single_or_list to one_or_more_of
liiight Mar 5, 2020
6d9f372
added telegram schema
liiight Mar 5, 2020
01df67c
added chat id to schema
liiight Mar 5, 2020
85bf96b
tweaked error
liiight Mar 6, 2020
5480f25
tweaks
liiight Mar 8, 2020
322c5ea
more tweaks
liiight Mar 8, 2020
9179a4a
gitter tweaks
liiight Mar 8, 2020
de2d9e5
mailgun tweaks
liiight Mar 8, 2020
bff9d3e
e164
liiight Mar 8, 2020
d03a580
converted twilio
liiight Mar 8, 2020
567e20b
converted zulip
liiight Mar 8, 2020
9cb2b82
moved values to exclude to its own class attribute
liiight Mar 8, 2020
c6d06f7
name tweaks
liiight Mar 8, 2020
d5e2f08
made str enums inherit from str
liiight Mar 8, 2020
ec18e3e
started fixing tests
liiight Mar 8, 2020
3c11482
removed all references to all status consts
liiight Mar 8, 2020
aa914b9
fixing sanity tests
liiight Mar 8, 2020
56c2b46
fixed core tests
liiight Mar 8, 2020
9dbda3f
fixed file list tests
liiight Mar 9, 2020
5f89fd7
fixed some more tests
liiight Mar 9, 2020
731ee51
removed redundant utils
liiight Mar 9, 2020
9935ee1
removed another unused helper
liiight Mar 9, 2020
6a06f62
tweak
liiight Mar 9, 2020
73497ea
name tweak
liiight Mar 9, 2020
eec60db
minor tweak
liiight Mar 9, 2020
d348721
improved consistency
liiight Mar 9, 2020
1ef4079
added provider metadata test
liiight Mar 10, 2020
d5d592e
removed specific metadata tests
liiight Mar 10, 2020
2ad0fda
fixed pushover issue
liiight Mar 10, 2020
c1f3dfe
adding more tests
liiight Mar 10, 2020
7eaf4f6
removed missing required test
liiight Mar 10, 2020
d96c46a
fixed popcornnotify tests
liiight Mar 10, 2020
2a5f14e
updated some tests
liiight Mar 11, 2020
c6f2b1a
fixed some tests
liiight Nov 11, 2020
16c9b9b
removed use of urljoin
liiight Nov 11, 2020
ec10899
set skip in cli runner to remove noise until cli is fixed
liiight Nov 11, 2020
b0fca46
fixed join test
liiight Nov 11, 2020
8a4dd3d
change provider fixture class to module
liiight Nov 11, 2020
8671e00
removed all schema required checks as they are redundant
liiight Nov 11, 2020
4fd5e57
fixed more tests, fixed zulip logic
liiight Nov 11, 2020
9c51f7a
more fixes
liiight Nov 11, 2020
501051c
fixed more tests
liiight Nov 11, 2020
12484d1
added alias
liiight Nov 12, 2020
30a2a9a
fixed or skipped all tests
liiight Nov 12, 2020
5e27018
tweak
liiight Nov 12, 2020
681a234
changed logger
liiight Nov 12, 2020
b4adcdb
updated test to py3.8 and py3.9
liiight Nov 12, 2020
23459d0
Revert "updated test to py3.8 and py3.9"
liiight Nov 12, 2020
01d58c9
added ResourceSchema tests
liiight Nov 12, 2020
7d229c6
added types to core
liiight Nov 12, 2020
2c1300b
Update pythonpackage.yml
liiight Nov 13, 2020
d4b16a5
Update pythonpackage.yml
liiight Nov 13, 2020
d61f6c8
set setuptools
liiight Nov 13, 2020
f34ff68
set dev install
liiight Nov 13, 2020
63b6dbd
added typing extensions to requirements
liiight Nov 13, 2020
234b88c
added typing extensions to requirements
liiight Nov 13, 2020
35e828f
updated dev requirements
liiight Nov 13, 2020
b050ce2
catch import error
liiight Nov 13, 2020
d6733b9
removed limit for typing_extensions
liiight Nov 13, 2020
df2a7c0
added environ tests that loads types. Closes #387
liiight Nov 13, 2020
2a4d65a
tweaked dict_from_environs
liiight Nov 13, 2020
8e81b96
removed text_to_bool util as it is no longer needed
liiight Nov 13, 2020
0fbd6aa
change provider registry to be dynamically init
liiight Nov 13, 2020
9c7dd84
added pytest options
liiight Nov 13, 2020
e9931b0
updated pre-commit
liiight Nov 13, 2020
f351c4f
log tweak
liiight Nov 13, 2020
1fbe224
added test to load data using schema aliases from environment variables
liiight Nov 13, 2020
f782af0
fixed twilio
liiight Nov 13, 2020
da55dac
fix codecov
liiight Nov 13, 2020
0e55dcd
tweak
liiight Nov 13, 2020
2dab13c
fixed tests
liiight Nov 13, 2020
9429224
fixed some flake8 stuff
liiight Nov 13, 2020
80a5d04
added SchemaValidationError test
liiight Nov 13, 2020
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
11 changes: 5 additions & 6 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [3.6, 3.7]
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
Expand All @@ -19,12 +19,11 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip setuptools
pip install setuptools==45
pip install -e .
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Test with pytest
run: pytest --cov=./
run: pytest --cov=./ --cov-report=xml
env:
NOTIFIERS_EMAIL_PASSWORD: ${{secrets.NOTIFIERS_EMAIL_PASSWORD}}
NOTIFIERS_EMAIL_TO: ${{secrets.NOTIFIERS_EMAIL_TO}}
Expand Down Expand Up @@ -60,6 +59,6 @@ jobs:
NOTIFIERS_ZULIP_TO: ${{secrets.NOTIFIERS_ZULIP_TO}}
- name: Upload coverage to Codecov
if: success()
uses: codecov/[email protected].2
uses: codecov/[email protected].14
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
19 changes: 11 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v3.3.0
hooks:
- id: check-toml
- id: check-yaml
- id: check-json
- id: pretty-format-json
args: ['--autofix']
- id: trailing-whitespace
- id: flake8
args: ['--max-line-length=120']
additional_dependencies: ['flake8-mutable', 'flake8-comprehensions']
- repo: https://github.com/psf/black
rev: 19.3b0
rev: 19.10b0
hooks:
- id: black
language_version: python3.6
- repo: https://github.com/asottile/reorder_python_imports
rev: v1.6.1
rev: v2.3.5
hooks:
- id: reorder-python-imports
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.3
hooks:
- id: reorder-python-imports
- id: flake8
args: [ '--max-line-length=120',]
additional_dependencies: [ 'flake8-mutable', 'flake8-comprehensions', 'flake8-bugbear' ]
2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Got an app or service and you want to enable your users to use notifications wit
# Supported providers


[Pushover](https://pushover.net/), [SimplePush](https://simplepush.io/), [Slack](https://api.slack.com/), [Gmail](https://www.google.com/gmail/about/), Email (SMTP), [Telegram](https://telegram.org/), [Gitter](https://gitter.im), [Pushbullet](https://www.pushbullet.com), [Join](https://joaoapps.com/join/), [Hipchat](https://www.hipchat.com/docs/apiv2), [Zulip](https://zulipchat.com/), [Twilio](https://www.twilio.com/), [Pagerduty](https://www.pagerduty.com), [Mailgun](https://www.mailgun.com/), [PopcornNotify](https://popcornnotify.com), [StatusPage.io](https://statuspage.io)
[Pushover](https://pushover.net/), [SimplePush](https://simplepush.io/), [Slack](https://api.slack.com/), [Gmail](https://www.google.com/gmail/about/), Email (SMTP), [Telegram](https://telegram.org/), [Gitter](https://gitter.im), [Pushbullet](https://www.pushbullet.com), [Join](https://joaoapps.com/join/), [Zulip](https://zulipchat.com/), [Twilio](https://www.twilio.com/), [Pagerduty](https://www.pagerduty.com), [Mailgun](https://www.mailgun.com/), [PopcornNotify](https://popcornnotify.com), [StatusPage.io](https://statuspage.io)

# Advantages

Expand Down
105 changes: 55 additions & 50 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,56 +2,61 @@
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file dev-requirements.txt dev-requirements.in
# pip-compile dev-requirements.in
#
alabaster==0.7.11 # via sphinx
aspy.yaml==1.1.1 # via pre-commit
atomicwrites==1.1.5 # via pytest
attrs==19.3.0 # via hypothesis, pytest
babel==2.6.0 # via sphinx
bumpversion==0.5.3
certifi==2018.4.16 # via requests
cfgv==2.0.0 # via pre-commit
alabaster==0.7.12 # via sphinx
appdirs==1.4.4 # via virtualenv
attrs==20.3.0 # via hypothesis, pytest
babel==2.9.0 # via sphinx
bump2version==1.0.1 # via bumpversion
bumpversion==0.6.0 # via -r dev-requirements.in
certifi==2020.11.8 # via requests
cfgv==3.2.0 # via pre-commit
chardet==3.0.4 # via requests
codecov==2.0.15
coverage==4.5.1 # via codecov, pytest-cov
decorator==4.4.1 # via retry
docutils==0.14 # via sphinx
hypothesis==5.4.1
identify==1.1.4 # via pre-commit
idna==2.7 # via requests
imagesize==1.0.0 # via sphinx
importlib-metadata==0.18 # via pluggy, pytest
jinja2==2.10.1 # via sphinx
markupsafe==1.0 # via jinja2
more-itertools==4.2.0 # via pytest
nodeenv==1.3.2 # via pre-commit
packaging==17.1 # via pytest, sphinx
pluggy==0.12.0 # via pytest
pre-commit==2.0.1
py==1.5.4 # via pytest, retry
pygments==2.2.0 # via sphinx
pyparsing==2.2.0 # via packaging
pytest-cov==2.7.1
pytest==5.0.1
pytz==2018.5 # via babel
pyyaml==5.1 # via aspy.yaml, pre-commit
requests==2.23.0 # via codecov, sphinx
retry==0.9.2
six==1.11.0 # via cfgv, more-itertools, packaging
snowballstemmer==1.2.1 # via sphinx
sortedcontainers==2.1.0 # via hypothesis
sphinx-autodoc-annotation==1.0.post1
sphinx-rtd-theme==0.4.3
sphinx==2.2.1
sphinxcontrib-applehelp==1.0.1 # via sphinx
sphinxcontrib-devhelp==1.0.1 # via sphinx
sphinxcontrib-htmlhelp==1.0.2 # via sphinx
codecov==2.1.10 # via -r dev-requirements.in
coverage==5.3 # via codecov, pytest-cov
decorator==4.4.2 # via retry
distlib==0.3.1 # via virtualenv
docutils==0.16 # via sphinx
filelock==3.0.12 # via virtualenv
hypothesis==5.41.2 # via -r dev-requirements.in
identify==1.5.9 # via pre-commit
idna==2.10 # via requests
imagesize==1.2.0 # via sphinx
importlib-metadata==2.0.0 # via pluggy, pre-commit, pytest, virtualenv
importlib-resources==3.3.0 # via pre-commit, virtualenv
iniconfig==1.1.1 # via pytest
jinja2==2.11.2 # via sphinx
markupsafe==1.1.1 # via jinja2
nodeenv==1.5.0 # via pre-commit
packaging==20.4 # via pytest, sphinx
pluggy==0.13.1 # via pytest
pre-commit==2.8.2 # via -r dev-requirements.in
py==1.9.0 # via pytest, retry
pygments==2.7.2 # via sphinx
pyparsing==2.4.7 # via packaging
pytest-cov==2.10.1 # via -r dev-requirements.in
pytest==6.1.2 # via -r dev-requirements.in, pytest-cov
pytz==2020.4 # via babel
pyyaml==5.3.1 # via pre-commit
requests==2.25.0 # via codecov, sphinx
retry==0.9.2 # via -r dev-requirements.in
six==1.15.0 # via packaging, virtualenv
snowballstemmer==2.0.0 # via sphinx
sortedcontainers==2.3.0 # via hypothesis
sphinx-autodoc-annotation==1.0.post1 # via -r dev-requirements.in
sphinx-rtd-theme==0.5.0 # via -r dev-requirements.in
sphinx==3.3.1 # via -r dev-requirements.in, sphinx-autodoc-annotation, sphinx-rtd-theme
sphinxcontrib-applehelp==1.0.2 # via sphinx
sphinxcontrib-devhelp==1.0.2 # via sphinx
sphinxcontrib-htmlhelp==1.0.3 # via sphinx
sphinxcontrib-jsmath==1.0.1 # via sphinx
sphinxcontrib-qthelp==1.0.2 # via sphinx
sphinxcontrib-serializinghtml==1.1.3 # via sphinx
toml==0.9.4 # via pre-commit
urllib3==1.24.2 # via requests
virtualenv==16.0.0 # via pre-commit
wcwidth==0.1.7 # via pytest
zipp==0.5.1 # via importlib-metadata
sphinxcontrib-qthelp==1.0.3 # via sphinx
sphinxcontrib-serializinghtml==1.1.4 # via sphinx
toml==0.10.2 # via pre-commit, pytest
urllib3==1.26.2 # via requests
virtualenv==20.1.0 # via pre-commit
zipp==3.4.0 # via importlib-metadata, importlib-resources

# The following packages are considered to be unsafe in a requirements file:
# setuptools
1 change: 1 addition & 0 deletions notifiers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging

from . import providers # noqa: F401
from ._version import __version__
from .core import all_providers
from .core import get_notifier
Expand Down
Loading