Dropped Python v3.6 (and EPEL8) support (#1155)

This commit is contained in:
Chris Caron
2024-07-06 19:51:23 -04:00
committed by GitHub
parent 75660322f4
commit bca25c9ece
15 changed files with 16 additions and 274 deletions

View File

@@ -2,12 +2,12 @@
This directory contains any supporting files to grant usage of Apprise in various distributions.
### RPM Based Packages
* [EPEL](https://fedoraproject.org/wiki/EPEL) based distributions are only supported if they are of v8 or higher. This includes:
* Red Hat 8.x (or higher)
* Scientific OS 8.x (or higher)
* Oracle Linux 8.x (or higher)
* Rocky Linux 8.x (or higher)
* Alma Linux 8.x (or higher)
* [EPEL](https://fedoraproject.org/wiki/EPEL) based distributions are only supported if they are of v9 or higher. This includes:
* Red Hat 9.x (or higher)
* Scientific OS 9.x (or higher)
* Oracle Linux 9.x (or higher)
* Rocky Linux 9.x (or higher)
* Alma Linux 9.x (or higher)
* Fedora 29 (or higher)
Provided you are connected to the [EPEL repositories](https://fedoraproject.org/wiki/EPEL), the following will just work for you:

View File

@@ -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

View File

@@ -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

View File

@@ -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)

View File

@@ -61,25 +61,6 @@ Summary: A simple wrapper to many popular notification services used toda
License: BSD
URL: https://github.com/caronc/%{pypi_name}
Source0: %{url}/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
# RHEL/Rocky 8 ship with Click v6.7 which does not support the .stdout
# directive used in the unit testing. This patch just makes it so our package
# continues to be compatible with these linux distributions
Patch0: %{pypi_name}-click67-support.patch
# RHEL/Rocky 8 ship with Pytest v3.4.2 which does not support the
# session_mocker fixture. This patch removes the session_mocker
# Patch thanks to Andreas Motl and his PR:
# - https://github.com/caronc/apprise/pull/763
Patch1: %{pypi_name}-pytest-session_mocker-removal.patch
# RHEL/Rocky 8 ship with Pytest v3.4.2 which does not support the
# tmp_path fixture. This patch removes the macos testing as it
# leverages this unavailabe fixture.
# At the end of the day, the macos testing it is not needed by a
# RHEL/Fedora environment anyway for obvious reasons.
Patch2: %{pypi_name}-no-macosx-testing.patch
BuildArch: noarch
%description %{common_description}
@@ -119,18 +100,7 @@ Requires: python%{python3_pkgversion}-certifi
Requires: python%{python3_pkgversion}-yaml
Recommends: python%{python3_pkgversion}-paho-mqtt
%if 0%{?rhel} && 0%{?rhel} <= 8
BuildRequires: python%{python3_pkgversion}-dataclasses
Requires: python%{python3_pkgversion}-dataclasses
%endif
%if %{with tests}
%if 0%{?rhel} >= 9
# Do not import python3-mock
%else
# python-mock switched to unittest.mock
BuildRequires: python%{python3_pkgversion}-mock
%endif
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pytest-mock
BuildRequires: python%{python3_pkgversion}-pytest-runner
@@ -142,14 +112,6 @@ BuildRequires: python%{python3_pkgversion}-pytest-xdist
%prep
%setup -q -n %{pypi_name}-%{version}
%if 0%{?rhel} && 0%{?rhel} <= 8
# Rocky/RHEL 8 click v6.7 unit testing support
%patch0 -p1
# Rocky/RHEL 8 Drop session_mocker support
%patch1 -p1
# Rocky/RHEL 8 Lose MacOSX Testing
%patch2 -p1
%endif
# 2023.08.27: This test fails for some uknown reason only during the test
# section of this RPM, but works completley fine under all other circumstances.
@@ -161,14 +123,6 @@ BuildRequires: python%{python3_pkgversion}-pytest-xdist
# at this time; remove failing test until this is resolved
%{__rm} test/test_apprise_translations.py
%if 0%{?rhel} >= 9
# Do nothing
%else
# CentOS 8.x requires python-mock (cororlates with import ab)ve
find test -type f -name '*.py' -exec \
sed -i -e 's|^from unittest import mock|import mock|g' {} \;
%endif
%build
%py3_build