1
0

Compare commits

...

10 Commits

Author SHA256 Message Date
685ff62ae8 Accepting request 1164251 from devel:languages:python:django
- No more greedy globs in %files.
- Switch back to PyPi tarball, and use setuptools_scm.

OBS-URL: https://build.opensuse.org/request/show/1164251
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-push-notifications?expand=0&rev=6
2024-04-03 15:20:33 +00:00
02fcef19ba - No more greedy globs in %files.
- Switch back to PyPi tarball, and use setuptools_scm.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-push-notifications?expand=0&rev=12
2024-04-03 03:45:57 +00:00
5c9d7f553f Accepting request 1129794 from devel:languages:python:django
- update to 3.0.2:
  * LegacyConfig.get_apns_use_alternative_port always return None
  * Add django 4.1, remove master branch
  * Update topic send_message docs in README
  * Fix: HexadecimalField accepts non-hex values
  * Expanded documentation for Web Push
  * Allow APNS tokens of variable length.
  * Add WebPush support for Safari

  * Support new apsn2 that no longer exports init_context.

OBS-URL: https://build.opensuse.org/request/show/1129794
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-push-notifications?expand=0&rev=5
2023-11-30 21:00:42 +00:00
099bfbebc6 - update to 3.0.2:
* LegacyConfig.get_apns_use_alternative_port always return None
  * Add django 4.1, remove master branch
  * Update topic send_message docs in README
  * Fix: HexadecimalField accepts non-hex values
  * Expanded documentation for Web Push
  * Allow APNS tokens of variable length.
  * Add WebPush support for Safari
  * Support new apsn2 that no longer exports init_context.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-push-notifications?expand=0&rev=10
2023-11-29 12:16:10 +00:00
d7fbea1f05 Accepting request 1056304 from devel:languages:python:django
- Add patch support-new-apns2.patch:
  * Support new apsn2 that no longer exports init_context.

OBS-URL: https://build.opensuse.org/request/show/1056304
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-push-notifications?expand=0&rev=4
2023-01-06 16:05:51 +00:00
5338c74fac - Add patch support-new-apns2.patch:
* Support new apsn2 that no longer exports init_context.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-push-notifications?expand=0&rev=8
2023-01-06 01:51:48 +00:00
9c0b871a3a Accepting request 976289 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/976289
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-push-notifications?expand=0&rev=3
2022-05-12 20:59:44 +00:00
John Vandenberg
393a14b61d Accepting request 976288 from home:pgajdos:python
- version update to 3.0.0
  * #567 Fixes crash on bulk_send test message operation from admin by @DataGreed in #568
  * Updated README: added info about APNS_AUTH_KEY_PATH, APNS_AUTH_KEY_ID, APNS_TEAM_ID by @DataGreed in #566
  * Add some details to APNS settings description by @scherbakovx in #575
  * Django 4.0 warnings by @jheld in #585
  * Run tests on python3.9 by @bertonha in #589
  * add mutable_content to fcm by @paradizer in #582
  * Improve efficiency of ORM lookups by @code-review-doctor in #598
  * Drop python 2.x and django before 2.2 by @sevdog in #599
  * Migrate to GitHub Actions. by @jezdez in #607
  * Mention WebPushDevice in README by @Tyilo in #608
  * Make push optional dependecies by @sevdog in #600
  * fix: Remove python3.5 deps by @bertonha in #621
  * Spelling error & convert string to be translatable by @Andrew-Chen-Wang in #614
  * ++Enable sending image in GCM notifications by @ashishnitinpatil in #624
  * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #625
  * Change feature detection logic for database field by @sevdog in #612
  * Add Edge support to webpush by @simonkern in #631
  * chore: test on Django 4.0 by @bertonha in #638
  * chore: test only active Django versions by @bertonha in #639
  * chore: dry tests, use newer DRF on tests by @bertonha in #641
  * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #635
  * More robust handling of userAgentData, fix WebPushDeviceAdmin by @simonkern in #643
  * [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #644
  * Add missing migration for #614 by @simonkern in #645
  * Jazzband: Synced file(s) with jazzband/.github by @jazzband-bot in #626
  * Show coverage badge in README. by @shimakaze-git in #651
- python-mock is not required for build

OBS-URL: https://build.opensuse.org/request/show/976288
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-push-notifications?expand=0&rev=6
2022-05-11 10:51:54 +00:00
62256d9ef7 Accepting request 942636 from devel:languages:python:django
OBS-URL: https://build.opensuse.org/request/show/942636
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-django-push-notifications?expand=0&rev=2
2021-12-26 14:53:39 +00:00
John Vandenberg
969fcc384a Accepting request 942635 from home:jayvdb:branches:devel:languages:python:django
- - Use django-codemod to make Django 4 compatible

OBS-URL: https://build.opensuse.org/request/show/942635
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:django/python-django-push-notifications?expand=0&rev=5
2021-12-26 14:35:58 +00:00
5 changed files with 188 additions and 13 deletions

View File

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

View File

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

View File

@@ -1,3 +1,64 @@
-------------------------------------------------------------------
Wed Apr 3 03:41:59 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
- No more greedy globs in %files.
- Switch back to PyPi tarball, and use setuptools_scm.
-------------------------------------------------------------------
Wed Nov 29 12:14:57 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 3.0.2:
* LegacyConfig.get_apns_use_alternative_port always return None
* Add django 4.1, remove master branch
* Update topic send_message docs in README
* Fix: HexadecimalField accepts non-hex values
* Expanded documentation for Web Push
* Allow APNS tokens of variable length.
* Add WebPush support for Safari
-------------------------------------------------------------------
Fri Jan 6 01:50:42 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-new-apns2.patch:
* Support new apsn2 that no longer exports init_context.
-------------------------------------------------------------------
Wed May 11 10:11:10 UTC 2022 - pgajdos@suse.com
- version update to 3.0.0
* #567 Fixes crash on bulk_send test message operation from admin by @DataGreed in #568
* Updated README: added info about APNS_AUTH_KEY_PATH, APNS_AUTH_KEY_ID, APNS_TEAM_ID by @DataGreed in #566
* Add some details to APNS settings description by @scherbakovx in #575
* Django 4.0 warnings by @jheld in #585
* Run tests on python3.9 by @bertonha in #589
* add mutable_content to fcm by @paradizer in #582
* Improve efficiency of ORM lookups by @code-review-doctor in #598
* Drop python 2.x and django before 2.2 by @sevdog in #599
* Migrate to GitHub Actions. by @jezdez in #607
* Mention WebPushDevice in README by @Tyilo in #608
* Make push optional dependecies by @sevdog in #600
* fix: Remove python3.5 deps by @bertonha in #621
* Spelling error & convert string to be translatable by @Andrew-Chen-Wang in #614
* ++Enable sending image in GCM notifications by @ashishnitinpatil in #624
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #625
* Change feature detection logic for database field by @sevdog in #612
* Add Edge support to webpush by @simonkern in #631
* chore: test on Django 4.0 by @bertonha in #638
* chore: test only active Django versions by @bertonha in #639
* chore: dry tests, use newer DRF on tests by @bertonha in #641
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #635
* More robust handling of userAgentData, fix WebPushDeviceAdmin by @simonkern in #643
* [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in #644
* Add missing migration for #614 by @simonkern in #645
* Jazzband: Synced file(s) with jazzband/.github by @jazzband-bot in #626
* Show coverage badge in README. by @shimakaze-git in #651
- python-mock is not required for build
-------------------------------------------------------------------
Sun Dec 26 14:34:58 UTC 2021 - John Vandenberg <jayvdb@gmail.com>
- - Use django-codemod to make Django 4 compatible
-------------------------------------------------------------------
Thu Aug 6 05:50:27 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-django-push-notifications
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,15 +16,16 @@
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%{?sle15_python_module_pythons}
Name: python-django-push-notifications
Version: 2.0.0
Version: 3.0.2
Release: 0
Summary: Django package to send push notifications to mobile devices
License: MIT
URL: https://github.com/jazzband/django-push-notifications
Source: https://github.com/jazzband/django-push-notifications/archive/%{version}.tar.gz#/django-push-notifications-%{version}.tar.gz
BuildRequires: %{python_module setuptools}
Source: https://files.pythonhosted.org/packages/source/d/django-push-notifications/django-push-notifications-%{version}.tar.gz
Patch0: support-new-apns2.patch
BuildRequires: %{python_module setuptools_scm}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-Django >= 1.11
@@ -34,11 +35,14 @@ BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module Django >= 1.11}
BuildRequires: %{python_module apns2}
BuildRequires: %{python_module django-codemod}
BuildRequires: %{python_module djangorestframework >= 3.7}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest-django}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pywebpush >= 1.3.0}
BuildRequires: %{python_module wheel}
# /SECTION
%python_subpackages
@@ -47,13 +51,14 @@ Send push notifications to mobile devices through GCM, APNS or WNS and
to WebPush (Chrome, Firefox and Opera) in Django.
%prep
%setup -q -n django-push-notifications-%{version}
%autosetup -p1 -n django-push-notifications-%{version}
djcodemod run --removed-in 4.0 push_notifications/{admin,fields,models}.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -64,6 +69,7 @@ export PYTHONPATH="$(pwd)"
%files %{python_files}
%doc README.rst
%license LICENSE
%{python_sitelib}/*
%{python_sitelib}/push_notifications
%{python_sitelib}/django_push_notifications-%{version}.dist-info
%changelog

108
support-new-apns2.patch Normal file
View File

@@ -0,0 +1,108 @@
Index: django-push-notifications-3.0.0/tests/test_apns_models.py
===================================================================
--- django-push-notifications-3.0.0.orig/tests/test_apns_models.py
+++ django-push-notifications-3.0.0/tests/test_apns_models.py
@@ -1,3 +1,4 @@
+import ssl
from unittest import mock
from apns2.client import NotificationPriority
@@ -24,7 +25,7 @@ class APNSModelTestCase(TestCase):
"APNS_CERTIFICATE": "/path/to/apns/certificate.pem"
})
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification_batch") as s:
APNSDevice.objects.all().send_message("Hello world", expiration=1)
@@ -38,7 +39,7 @@ class APNSModelTestCase(TestCase):
def test_apns_send_message_extra(self):
self._create_devices(["abc"])
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
APNSDevice.objects.get().send_message(
@@ -53,7 +54,7 @@ class APNSModelTestCase(TestCase):
def test_apns_send_message(self):
self._create_devices(["abc"])
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
APNSDevice.objects.get().send_message("Hello world", expiration=1)
Index: django-push-notifications-3.0.0/tests/test_apns_push_payload.py
===================================================================
--- django-push-notifications-3.0.0.orig/tests/test_apns_push_payload.py
+++ django-push-notifications-3.0.0/tests/test_apns_push_payload.py
@@ -1,3 +1,4 @@
+import ssl
from unittest import mock
from apns2.client import NotificationPriority
@@ -10,7 +11,7 @@ from push_notifications.exceptions impor
class APNSPushPayloadTest(TestCase):
def test_push_payload(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send(
@@ -28,7 +29,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["expiration"], 3)
def test_push_payload_with_thread_id(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send(
@@ -44,7 +45,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["expiration"], 3)
def test_push_payload_with_alert_dict(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send(
@@ -60,7 +61,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["expiration"], 3)
def test_localised_push_with_empty_body(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send("123", None, loc_key="TEST_LOC_KEY", expiration=3)
@@ -70,7 +71,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["expiration"], 3)
def test_using_extra(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send(
@@ -85,7 +86,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["expiration"], 30)
def test_collapse_id(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
_apns_send(
@@ -97,7 +98,7 @@ class APNSPushPayloadTest(TestCase):
self.assertEqual(kargs["collapse_id"], "456789")
def test_bad_priority(self):
- with mock.patch("apns2.credentials.init_context"):
+ with mock.patch("ssl.create_default_context"):
with mock.patch("apns2.client.APNsClient.connect"):
with mock.patch("apns2.client.APNsClient.send_notification") as s:
self.assertRaises(APNSUnsupportedPriority, _apns_send, "123", "_" * 2049, priority=24)