forked from pool/python-APScheduler
Accepting request 670904 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/670904 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-APScheduler?expand=0&rev=5
This commit is contained in:
22
0001-Correct-update_job-to-raise-with-job-id.patch
Normal file
22
0001-Correct-update_job-to-raise-with-job-id.patch
Normal file
@@ -0,0 +1,22 @@
|
||||
From faef2bd7017f4414510b075fe71d6b43f8f2fdfc Mon Sep 17 00:00:00 2001
|
||||
From: Ugrend <Ugrend@users.noreply.github.com>
|
||||
Date: Fri, 14 Dec 2018 09:23:25 +1100
|
||||
Subject: [PATCH] Correct update_job to raise with job id
|
||||
|
||||
---
|
||||
apscheduler/jobstores/sqlalchemy.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/apscheduler/jobstores/sqlalchemy.py b/apscheduler/jobstores/sqlalchemy.py
|
||||
index beb27fb..fecbd83 100644
|
||||
--- a/apscheduler/jobstores/sqlalchemy.py
|
||||
+++ b/apscheduler/jobstores/sqlalchemy.py
|
||||
@@ -106,7 +106,7 @@ def update_job(self, job):
|
||||
}).where(self.jobs_t.c.id == job.id)
|
||||
result = self.engine.execute(update)
|
||||
if result.rowcount == 0:
|
||||
- raise JobLookupError(id)
|
||||
+ raise JobLookupError(job.id)
|
||||
|
||||
def remove_job(self, job_id):
|
||||
delete = self.jobs_t.delete().where(self.jobs_t.c.id == job_id)
|
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:952c8f46a11f32b9d5bfbe3e347dac2cdf0680d8b4799590dc9c3a9865b73b65
|
||||
size 93129
|
3
APScheduler-3.5.3.tar.gz
Normal file
3
APScheduler-3.5.3.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6599bc78901ee7e9be85cbd073d9cc155c42d2bc867c5cde4d4d1cc339ebfbeb
|
||||
size 95527
|
40
fix-tests.patch
Normal file
40
fix-tests.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From: Antonio Larrosa <alarrosa@suse.com
|
||||
Subject: Fix false positive tests
|
||||
|
||||
Fix two tests that fail with python 3.7
|
||||
Index: APScheduler-3.5.3/tests/test_triggers.py
|
||||
===================================================================
|
||||
--- APScheduler-3.5.3.orig/tests/test_triggers.py
|
||||
+++ APScheduler-3.5.3/tests/test_triggers.py
|
||||
@@ -538,9 +538,13 @@ class TestIntervalTrigger(object):
|
||||
assert repr(trigger) == "<CronTrigger (day='1-2,4-7', timezone='Europe/Berlin')>"
|
||||
|
||||
def test_repr(self, trigger):
|
||||
- assert repr(trigger) == ("<IntervalTrigger (interval=datetime.timedelta(0, 1), "
|
||||
- "start_date='2009-08-04 00:00:02 CEST', "
|
||||
- "timezone='Europe/Berlin')>")
|
||||
+ assert (repr(trigger) == ("<IntervalTrigger (interval=datetime.timedelta(0, 1), "
|
||||
+ "start_date='2009-08-04 00:00:02 CEST', "
|
||||
+ "timezone='Europe/Berlin')>") or
|
||||
+ repr(trigger) == ("<IntervalTrigger (interval=datetime.timedelta(seconds=1), "
|
||||
+ "start_date='2009-08-04 00:00:02 CEST', "
|
||||
+ "timezone='Europe/Berlin')>"))
|
||||
+
|
||||
|
||||
def test_str(self, trigger):
|
||||
assert str(trigger) == "interval[0:00:01]"
|
||||
Index: APScheduler-3.5.3/tests/test_schedulers.py
|
||||
===================================================================
|
||||
--- APScheduler-3.5.3.orig/tests/test_schedulers.py
|
||||
+++ APScheduler-3.5.3/tests/test_schedulers.py
|
||||
@@ -729,7 +729,9 @@ Jobstore other:
|
||||
|
||||
def test_create_trigger_bad_plugin_type(self, scheduler):
|
||||
scheduler._trigger_classes = {}
|
||||
- scheduler._trigger_plugins = {'dummy': MagicMock(return_value=object)}
|
||||
+ mock = MagicMock()
|
||||
+ mock.load = MagicMock(return_value=object)
|
||||
+ scheduler._trigger_plugins = {'dummy': mock}
|
||||
exc = pytest.raises(TypeError, scheduler._create_trigger, 'dummy', {})
|
||||
assert str(exc.value) == 'The trigger entry point does not point to a trigger class'
|
||||
|
@@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 3 16:13:03 UTC 2019 - Antonio Larrosa <alarrosa@suse.com>
|
||||
|
||||
- update to 3.5.3
|
||||
* Fixed regression introduced in 3.5.2: Class methods were mistaken
|
||||
for instance methods and thus were broken during serialization
|
||||
* Fixed callable name detection for methods in old style classes
|
||||
- update to 3.5.2
|
||||
* Fixed scheduling of bound methods on persistent job stores (the
|
||||
workaround of scheduling YourClass.methodname along with an
|
||||
explicit self argument is no longer necessary as this is now done
|
||||
automatically for you)
|
||||
* Added the FAQ section to the docs
|
||||
* Made BaseScheduler.start() raise a RuntimeError if running under
|
||||
uWSGI with threads disabled
|
||||
- Add fix-tests.patch to fix tests that fail with python 3.7
|
||||
- Add 0001-Correct-update_job-to-raise-with-job-id.patch from upstream
|
||||
to fix a wrong variable being used.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 18 08:02:10 UTC 2018 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-APScheduler
|
||||
#
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -18,13 +18,17 @@
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
Name: python-APScheduler
|
||||
Version: 3.5.1
|
||||
Version: 3.5.3
|
||||
Release: 0
|
||||
Summary: In-process task scheduler with Cron-like capabilities
|
||||
License: MIT
|
||||
Group: Development/Languages/Python
|
||||
URL: http://pypi.python.org/pypi/APScheduler/
|
||||
Source: https://files.pythonhosted.org/packages/source/A/APScheduler/APScheduler-%{version}.tar.gz
|
||||
# PATCH-FIX-UPSTREAM fix-tests.patch -- Fix python 3.7 incompatibilities
|
||||
Patch0: fix-tests.patch
|
||||
# PATCH-FIX-UPSTREAM 0001-Correct-update_job-to-raise-with-job-id.patch
|
||||
Patch1: 0001-Correct-update_job-to-raise-with-job-id.patch
|
||||
BuildRequires: %{python_module SQLAlchemy >= 0.8}
|
||||
BuildRequires: %{python_module Twisted}
|
||||
BuildRequires: %{python_module gevent}
|
||||
@@ -84,6 +88,8 @@ APscheduler provides multiple job stores.
|
||||
|
||||
%prep
|
||||
%setup -q -n APScheduler-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
# we don't want the tweaked pytest config options
|
||||
rm setup.cfg
|
||||
|
||||
|
Reference in New Issue
Block a user