SHA256
1
0
forked from pool/python-ntfy

Compare commits

8 Commits

Author SHA256 Message Date
17c2a80972 Accepting request 1315896 from devel:languages:python
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1315896
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ntfy?expand=0&rev=16
2025-11-06 17:14:31 +00:00
Matthias Bach
f663a18ff4 - Add avoid_tainting_the_default_config.patch and remove spec-file
based workaround for test isolation issues.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ntfy?expand=0&rev=35
2025-10-29 20:52:38 +00:00
424828b771 Accepting request 1314209 from devel:languages:python
- Update to version 2.7.1
  * Fix Matrix backend fails wheen trying to send messages with
    unicode in them.
  * Make theme icons available for linux backend.
  * Swap Slacker for Slack SDK.
  * Add compatibility with emoji 2.0.
  * Compatility with Python 311, 3.12, and 3.13.
- Drop emoji-2.0-compatibility.patch merged upstream.
- Drop python-311-compat.patch merged upstream.
- Drop python-312-compat.patch merged upstream.
- Added a workaround for a test isolation issue affecting the
  configuration tests.
- Switch service file from old disabled to modern manual run mode.

OBS-URL: https://build.opensuse.org/request/show/1314209
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ntfy?expand=0&rev=15
2025-10-29 20:06:06 +00:00
Matthias Bach
44fb8d309d - Update to version 2.7.1
* Fix Matrix backend fails wheen trying to send messages with
    unicode in them.
  * Make theme icons available for linux backend.
  * Swap Slacker for Slack SDK.
  * Add compatibility with emoji 2.0.
  * Compatility with Python 311, 3.12, and 3.13.
- Drop emoji-2.0-compatibility.patch merged upstream.
- Drop python-311-compat.patch merged upstream.
- Drop python-312-compat.patch merged upstream.
- Added a workaround for a test isolation issue affecting the
  configuration tests.
- Switch service file from old disabled to modern manual run mode.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ntfy?expand=0&rev=33
2025-10-28 21:10:01 +00:00
0e76d1f402 Accepting request 1284179 from devel:languages:python
- Convert to libalternatives

OBS-URL: https://build.opensuse.org/request/show/1284179
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ntfy?expand=0&rev=14
2025-06-10 07:07:50 +00:00
eb2302a290 - Convert to libalternatives
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ntfy?expand=0&rev=31
2025-06-09 12:37:34 +00:00
5d87528257 Accepting request 1281969 from devel:languages:python
- Convert to pip-based build

OBS-URL: https://build.opensuse.org/request/show/1281969
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-ntfy?expand=0&rev=13
2025-06-02 20:01:33 +00:00
734cb6e2cc - Convert to pip-based build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-ntfy?expand=0&rev=29
2025-06-02 14:43:43 +00:00
9 changed files with 98 additions and 135 deletions

View File

@@ -1,15 +1,15 @@
<services>
<service name="obs_scm" mode="disabled">
<service name="obs_scm" mode="manual">
<param name="url">https://github.com/dschep/ntfy.git</param>
<param name="scm">git</param>
<param name="revision">v2.7.0</param>
<param name="revision">v2.7.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="versionrewrite-pattern">v(.*)</param>
</service>
<service name="tar" mode="disabled" />
<service name="recompress" mode="disabled">
<service name="tar" mode="manual" />
<service name="recompress" mode="manual">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled" />
<service name="set_version" mode="manual" />
</services>

View File

@@ -0,0 +1,42 @@
From: Matthias Bach <marix@marix.org>
Date: Wed, 29 Oct 2025 21:21:09 +0200
Subject: [PATCH] Avoid tainting the default config
Upstream: submitted
References: gh#dschep/ntfy#270
---
Index: ntfy/config.py
<+>UTF-8
===================================================================
diff --git a/ntfy/config.py b/ntfy/config.py
--- a/ntfy/config.py (revision c4ef3b54f26390b7b51ec612f41f11a1ba284227)
+++ b/ntfy/config.py (revision 030d3d81ea1941b240eb578fd4ec79023d03b196)
@@ -9,7 +9,7 @@
from ruamel import yaml
from . import __version__
-from .default_config import config as default_configuration
+from .default_config import get_default_config
if yaml.version_info < (0, 15):
safe_load = yaml.safe_load
@@ -34,7 +34,7 @@
except IOError as e:
if e.errno == errno.ENOENT and config_path == DEFAULT_CONFIG:
logger.info('{} not found'.format(config_path))
- config = default_configuration
+ config = get_default_config()
else:
logger.error(
'Failed to open {}'.format(config_path), exc_info=True)
Index: ntfy/default_config.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ntfy/default_config.py b/ntfy/default_config.py
--- a/ntfy/default_config.py (revision c4ef3b54f26390b7b51ec612f41f11a1ba284227)
+++ b/ntfy/default_config.py (revision 030d3d81ea1941b240eb578fd4ec79023d03b196)
@@ -1,1 +1,2 @@
-config = {}
+def get_default_config():
+ return {}

View File

@@ -1,43 +0,0 @@
From: Matthias Bach <marix@marix.org>
Date: Mon, 18 Jul 2022 20:53:11 +0200
Subject: [PATCH] Add compatibility with emoji 2.0
References: https://github.com/dschep/ntfy/pull/250
Upstream: submitted
Emoji deprecated the use_alias parameter in 1.6.2. This changes our use
to the new API which exists since that version. Without this change,
ntfy cannot be used with emoji 2.0 or higher.
---
ntfy/cli.py | 2 +-
setup.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ntfy/cli.py b/ntfy/cli.py
index 7dad0b2..41145fd 100644
--- a/ntfy/cli.py
+++ b/ntfy/cli.py
@@ -358,7 +358,7 @@ def main(cli_args=None):
if message is None:
return 0
if emojize is not None and not args.no_emoji:
- message = emojize(message, use_aliases=True)
+ message = emojize(message, language='alias')
return notify(
message,
args.title,
diff --git a/setup.py b/setup.py
index 1008f5f..f7321cd 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ extra_deps = {
'sleekxmpp', 'dnspython' if version_info[0] < 3 else 'dnspython3'],
'telegram': ['telegram-send'],
'instapush': ['instapush'],
- 'emoji': ['emoji'],
+ 'emoji': ['emoji >= 1.6.2'],
'pid':['psutil'],
'slack':['slacker'],
'rocketchat':['rocketchat-API'],
--
2.35.3

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:527a4f81557d1209e614a694cbf2871965a911db6a1d76434926d4796f443c5b
size 1749232

3
ntfy-2.7.1.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b673463d06a410544d27081fde3b088702e3fea36df2ab4998a54a26a73af2ce
size 1743620

View File

@@ -1,41 +0,0 @@
From: Matthias Bach <marix@marix.org>
Date: Sat, 7 Jan 2023 15:15:25 +0100
Subject: [PATCH] Fix compatibility with Python 3.11
References: https://github.com/dschep/ntfy/pull/271
Upstream: submitted
We had still been using the function inspect.getargspec() that had
already been deprecated in Python 3.0.
Switching to the equivalent inspect.getfullargspec() breaks
compabitility with Python 2. However, as Python 2 is long dead we don't
care about that.
---
ntfy/__init__.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ntfy/__init__.py b/ntfy/__init__.py
index 0fa7a22..6ed0abb 100644
--- a/ntfy/__init__.py
+++ b/ntfy/__init__.py
@@ -3,7 +3,7 @@ from getpass import getuser
from os import getcwd, path, name
from socket import gethostname
from importlib import import_module
-from inspect import getargspec
+from inspect import getfullargspec
from .backends.default import DefaultNotifierError
__version__ = '2.7.0'
@@ -65,7 +65,7 @@ def notify(message, title, config=None, **kwargs):
notifier = e.module
e = e.exception
- args, _, _, defaults = getargspec(notifier.notify)
+ args, _, _, defaults, *_ = getfullargspec(notifier.notify)
possible_args = set(args)
required_args = set(args) if defaults is None else set(args[:-len(defaults)])
required_args -= set(['title', 'message', 'retcode'])
--
2.35.3

View File

@@ -1,27 +0,0 @@
From: Matthias Bach <marix@marix.org>
Date: Wed, 3 Jan 2024 01:10:05 +0100
Subject: [PATCH] Fix compatibility with Python 3.12
References: https://github.com/dschep/ntfy/pull/271
Upstream: submitted
Unittest's assertEquals has finally been dropped in Python 3.12.
---
tests/test_cli.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/test_cli.py b/tests/test_cli.py
index c1341f3..4a87911 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -174,7 +174,7 @@ class TestMain(TestCase):
@patch('ntfy.backends.default.notify')
def test_args(self, mock_notify):
mock_notify.return_value = None
- self.assertEquals(0,
+ self.assertEqual(0,
ntfy_main([
'-o', 'foo', 'bar', '-b', 'default', '-t',
'TITLE', 'send', 'test'
--
2.35.3

View File

@@ -1,3 +1,36 @@
-------------------------------------------------------------------
Wed Oct 29 20:40:00 UTC 2025 - Matthias Bach <marix@marix.org>
- Add avoid_tainting_the_default_config.patch and remove spec-file
based workaround for test isolation issues.
-------------------------------------------------------------------
Tue Oct 28 20:25:23 UTC 2025 - Matthias Bach <marix@marix.org>
- Update to version 2.7.1
* Fix Matrix backend fails wheen trying to send messages with
unicode in them.
* Make theme icons available for linux backend.
* Swap Slacker for Slack SDK.
* Add compatibility with emoji 2.0.
* Compatility with Python 311, 3.12, and 3.13.
- Drop emoji-2.0-compatibility.patch merged upstream.
- Drop python-311-compat.patch merged upstream.
- Drop python-312-compat.patch merged upstream.
- Added a workaround for a test isolation issue affecting the
configuration tests.
- Switch service file from old disabled to modern manual run mode.
-------------------------------------------------------------------
Mon Jun 9 12:37:08 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to libalternatives
-------------------------------------------------------------------
Mon Jun 2 14:43:25 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Convert to pip-based build
-------------------------------------------------------------------
Mon May 20 09:46:03 UTC 2024 - Matthias Bach <marix@marix.org>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-ntfy
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2020 Matthias Bach <marix@marix.org>.
#
# All modifications and additions to the file contributed by third parties
@@ -17,9 +17,10 @@
#
%bcond_without libalternatives
%{?sle15_python_module_pythons}
Name: python-ntfy
Version: 2.7.0
Version: 2.7.1
Release: 0
Summary: A utility for sending push notifications
License: GPL-3.0-only
@@ -28,31 +29,31 @@ URL: https://github.com/dschep/ntfy
Source: ntfy-%{version}.tar.xz
# https://github.com/dschep/ntfy/issues/247
Patch0: python-ntfy-no-mock.patch
Patch1: emoji-2.0-compatibility.patch
Patch1: avoid_tainting_the_default_config.patch
Patch2: drop-misleading-shebangs.patch
Patch3: python-311-compat.patch
Patch4: python-312-compat.patch
BuildRequires: %{python_module appdirs}
# test requirements
BuildRequires: %{python_module emoji >= 1.6.2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module psutil}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module ruamel.yaml}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: alts
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: alts
Requires: python-appdirs
Requires: python-requests
Requires: python-ruamel.yaml
Requires(post): update-alternatives
Requires(postun): update-alternatives
Suggests: python-dnspython3
Suggests: python-emoji >= 1.6.2
Suggests: python-instapush
Suggests: python-psutil
Suggests: python-rocketchat-API
Suggests: python-slacker
Suggests: python-slack-sdk
Suggests: python-sleekxmpp
Suggests: python-telegram-send
BuildArch: noarch
@@ -75,24 +76,22 @@ Quickstart
%autosetup -p1 -n ntfy-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/ntfy
%python_expand %fdupes %{buildroot}%{$python_sitelib}/ntfy*
%check
export XDG_CONFIG_HOME=/foo/config
%pytest --ignore 'tests/test_xmpp.py' -k 'not test_xmpp'
%post
%python_install_alternative ntfy
%postun
%python_uninstall_alternative ntfy
%pre
%python_libalternatives_reset_alternative ntfy
%files %{python_files}
%doc README.rst
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/ntfy
%{python_sitelib}/ntfy