mirror of https://github.com/caronc/apprise
Chris Caron
5 months ago
committed by
GitHub
15 changed files with 16 additions and 274 deletions
@ -1,64 +0,0 @@ |
|||||||
# -*- coding: utf-8 -*- |
|
||||||
# BSD 2-Clause License |
|
||||||
# |
|
||||||
# Apprise - Push Notification Library. |
|
||||||
# Copyright (c) 2024, Chris Caron <lead2gold@gmail.com> |
|
||||||
# |
|
||||||
# Redistribution and use in source and binary forms, with or without |
|
||||||
# modification, are permitted provided that the following conditions are met: |
|
||||||
# |
|
||||||
# 1. Redistributions of source code must retain the above copyright notice, |
|
||||||
# this list of conditions and the following disclaimer. |
|
||||||
# |
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright notice, |
|
||||||
# this list of conditions and the following disclaimer in the documentation |
|
||||||
# and/or other materials provided with the distribution. |
|
||||||
# |
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
||||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
||||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
||||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
||||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
||||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
||||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
||||||
# POSSIBILITY OF SUCH DAMAGE. |
|
||||||
|
|
||||||
# Base |
|
||||||
FROM rockylinux:8 |
|
||||||
ENV container docker |
|
||||||
RUN ( \ |
|
||||||
cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ |
|
||||||
systemd-tmpfiles-setup.service ] || rm -f $i; done); \ |
|
||||||
rm -f /lib/systemd/system/multi-user.target.wants/*;\ |
|
||||||
rm -f /etc/systemd/system/*.wants/*;\ |
|
||||||
rm -f /lib/systemd/system/local-fs.target.wants/*; \ |
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ |
|
||||||
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ |
|
||||||
rm -f /lib/systemd/system/basic.target.wants/*;\ |
|
||||||
rm -f /lib/systemd/system/anaconda.target.wants/*; \ |
|
||||||
echo "assumeyes=1" >> /etc/yum.conf; \ |
|
||||||
dnf install -y epel-release; \ |
|
||||||
dnf install -y rpm-build rpmlint python3-pip python3-virtualenv rubygem-ronn \ |
|
||||||
dnf-plugins-core 'dnf-command(config-manager)' \ |
|
||||||
'dnf-command(builddep)' sudo rsync rpmdevtools; \ |
|
||||||
dnf config-manager --set-enabled powertools; |
|
||||||
|
|
||||||
COPY packaging/redhat/python-apprise.spec / |
|
||||||
# Place our build file into the path |
|
||||||
COPY bin/build-rpm.sh /usr/bin |
|
||||||
RUN rpmspec -q --buildrequires /python-apprise.spec | cut -f1 -d' ' | \ |
|
||||||
xargs dnf install -y |
|
||||||
|
|
||||||
# RPM Build Structure Setup |
|
||||||
ENV FLAVOR=rpmbuild OS=centos DIST=el8 |
|
||||||
RUN useradd builder -u 1000 -m -G users,wheel &>/dev/null && \ |
|
||||||
echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers |
|
||||||
|
|
||||||
VOLUME ["/apprise"] |
|
||||||
WORKDIR /apprise |
|
||||||
|
|
||||||
# RPMs should never be built as root |
|
||||||
USER builder |
|
@ -1,45 +0,0 @@ |
|||||||
# -*- coding: utf-8 -*- |
|
||||||
# BSD 2-Clause License |
|
||||||
# |
|
||||||
# Apprise - Push Notification Library. |
|
||||||
# Copyright (c) 2024, Chris Caron <lead2gold@gmail.com> |
|
||||||
# |
|
||||||
# Redistribution and use in source and binary forms, with or without |
|
||||||
# modification, are permitted provided that the following conditions are met: |
|
||||||
# |
|
||||||
# 1. Redistributions of source code must retain the above copyright notice, |
|
||||||
# this list of conditions and the following disclaimer. |
|
||||||
# |
|
||||||
# 2. Redistributions in binary form must reproduce the above copyright notice, |
|
||||||
# this list of conditions and the following disclaimer in the documentation |
|
||||||
# and/or other materials provided with the distribution. |
|
||||||
# |
|
||||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|
||||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|
||||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
|
||||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
|
||||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
|
||||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
||||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
||||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
||||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
||||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
||||||
# POSSIBILITY OF SUCH DAMAGE. |
|
||||||
|
|
||||||
# Base |
|
||||||
FROM python:3.6-buster |
|
||||||
RUN apt-get update && \ |
|
||||||
apt-get install -y --no-install-recommends libdbus-1-dev libgirepository1.0-dev build-essential musl-dev bash dbus && \ |
|
||||||
rm -rf /var/lib/apt/lists/* |
|
||||||
RUN pip install --no-cache-dir dbus-python PyGObject |
|
||||||
|
|
||||||
# Apprise Setup |
|
||||||
VOLUME ["/apprise"] |
|
||||||
WORKDIR /apprise |
|
||||||
COPY requirements.txt / |
|
||||||
COPY dev-requirements.txt / |
|
||||||
ENV PYTHONPATH /apprise |
|
||||||
ENV PYTHONPYCACHEPREFIX /apprise/__pycache__/py36 |
|
||||||
|
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -r /requirements.txt -r /dev-requirements.txt |
|
@ -1,39 +0,0 @@ |
|||||||
diff -Naur apprise-1.4.5/test/test_apprise_cli.py apprise-1.4.5-patched/test/test_apprise_cli.py
|
|
||||||
--- apprise-1.4.5/test/test_apprise_cli.py 2023-08-20 11:26:43.000000000 -0400
|
|
||||||
+++ apprise-1.4.5-patched/test/test_apprise_cli.py 2023-08-20 16:37:42.922342103 -0400
|
|
||||||
@@ -1027,9 +1027,6 @@
|
|
||||||
# Absolute path to __init__.py is okay
|
|
||||||
assert result.exit_code == 0
|
|
||||||
|
|
||||||
- # we can verify that it prepares our message
|
|
||||||
- assert result.stdout.strip() == 'info: - test body'
|
|
||||||
-
|
|
||||||
# Clear our working variables so they don't obstruct the next test
|
|
||||||
# This simulates an actual call from the CLI. Unfortunately through
|
|
||||||
# testing were occupying the same memory space so our singleton's
|
|
||||||
@@ -1049,9 +1046,6 @@
|
|
||||||
# an __init__.py is found on the inside of it
|
|
||||||
assert result.exit_code == 0
|
|
||||||
|
|
||||||
- # we can verify that it prepares our message
|
|
||||||
- assert result.stdout.strip() == 'info: - test body'
|
|
||||||
-
|
|
||||||
# Test double paths that are the same; this ensures we only
|
|
||||||
# load the plugin once
|
|
||||||
result = runner.invoke(cli.main, [
|
|
||||||
@@ -1183,15 +1177,6 @@
|
|
||||||
# Print our custom details to the screen
|
|
||||||
'--details',
|
|
||||||
])
|
|
||||||
- assert 'willfail' in result.stdout
|
|
||||||
- assert 'always failing...' in result.stdout
|
|
||||||
-
|
|
||||||
- assert 'clihook1' in result.stdout
|
|
||||||
- assert 'the original clihook entry' in result.stdout
|
|
||||||
- assert 'a duplicate of the clihook entry' not in result.stdout
|
|
||||||
-
|
|
||||||
- assert 'clihook2' in result.stdout
|
|
||||||
- assert 'Custom - clihook2' in result.stdout
|
|
||||||
|
|
||||||
# Note that the failure of the decorator carries all the way back
|
|
||||||
# to the CLI
|
|
@ -1,15 +0,0 @@ |
|||||||
diff -Naur apprise-1.6.0/test/test_plugin_macosx.py apprise-1.6.0.patched/test/test_plugin_macosx.py
|
|
||||||
--- apprise-1.6.0/test/test_plugin_macosx.py 2023-12-22 16:51:24.000000000 -0500
|
|
||||||
+++ apprise-1.6.0.patched/test/test_plugin_macosx.py 2023-12-22 17:38:35.720131819 -0500
|
|
||||||
@@ -42,9 +42,8 @@
|
|
||||||
logging.disable(logging.CRITICAL)
|
|
||||||
|
|
||||||
|
|
||||||
-if sys.platform not in ["darwin", "linux"]:
|
|
||||||
- pytest.skip("Only makes sense on macOS, but testable in Linux",
|
|
||||||
- allow_module_level=True)
|
|
||||||
+if sys.platform != "darwin":
|
|
||||||
+ pytest.skip("MacOS test only", allow_module_level=True)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
@ -1,29 +0,0 @@ |
|||||||
diff -Naur apprise-1.8.0/test/conftest.py apprise-1.8.0-patched/test/conftest.py
|
|
||||||
--- apprise-1.8.0/test/conftest.py 2024-06-01 21:28:32.102470720 -0400
|
|
||||||
+++ apprise-1.8.0-patched/test/conftest.py 2024-06-01 21:29:32.363754277 -0400
|
|
||||||
@@ -46,7 +46,7 @@
|
|
||||||
A_MGR = AttachmentManager()
|
|
||||||
|
|
||||||
|
|
||||||
-@pytest.fixture(scope="function", autouse=True)
|
|
||||||
+@pytest.fixture(autouse=True)
|
|
||||||
def mimetypes_always_available():
|
|
||||||
"""
|
|
||||||
A pytest session fixture which ensures mimetypes is set correctly
|
|
||||||
@@ -56,8 +56,8 @@
|
|
||||||
mimetypes.init(files=files)
|
|
||||||
|
|
||||||
|
|
||||||
-@pytest.fixture(scope="function", autouse=True)
|
|
||||||
-def no_throttling_everywhere(session_mocker):
|
|
||||||
+@pytest.fixture(autouse=True)
|
|
||||||
+def no_throttling_everywhere(mocker):
|
|
||||||
"""
|
|
||||||
A pytest session fixture which disables throttling on all notifiers.
|
|
||||||
It is automatically enabled.
|
|
||||||
@@ -68,4 +68,4 @@
|
|
||||||
A_MGR.unload_modules()
|
|
||||||
|
|
||||||
for plugin in N_MGR.plugins():
|
|
||||||
- session_mocker.patch.object(plugin, "request_rate_per_sec", 0)
|
|
||||||
+ mocker.patch.object(plugin, "request_rate_per_sec", 0)
|
|
Loading…
Reference in new issue