Bump apscheduler from 3.10.1 to 3.10.4 (#2133)

* Bump apscheduler from 3.10.1 to 3.10.4

Bumps [apscheduler](https://github.com/agronholm/apscheduler) from 3.10.1 to 3.10.4.
- [Changelog](https://github.com/agronholm/apscheduler/blob/3.10.4/docs/versionhistory.rst)
- [Commits](https://github.com/agronholm/apscheduler/compare/3.10.1...3.10.4)

---
updated-dependencies:
- dependency-name: apscheduler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update apscheduler==3.10.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com>

[skip ci]
This commit is contained in:
dependabot[bot] 2023-08-24 12:10:08 -07:00 committed by GitHub
commit 2c42150799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 855 additions and 825 deletions

View file

@ -1,10 +1,15 @@
from pkg_resources import get_distribution, DistributionNotFound
import sys
if sys.version_info >= (3, 8):
import importlib.metadata as importlib_metadata
else:
import importlib_metadata
try:
release = get_distribution('APScheduler').version.split('-')[0]
except DistributionNotFound:
release = importlib_metadata.version('APScheduler').split('-')[0]
except importlib_metadata.PackageNotFoundError:
release = '3.5.0'
version_info = tuple(int(x) if x.isdigit() else x for x in release.split('.'))
version = __version__ = '.'.join(str(x) for x in version_info[:3])
del get_distribution, DistributionNotFound
del sys, importlib_metadata

View file

@ -7,7 +7,6 @@ from logging import getLogger
import warnings
import sys
from pkg_resources import iter_entry_points
from tzlocal import get_localzone
import six
@ -31,6 +30,11 @@ try:
except ImportError:
from collections import MutableMapping
try:
from importlib.metadata import entry_points
except ModuleNotFoundError:
from importlib_metadata import entry_points
#: constant indicating a scheduler's stopped state
STATE_STOPPED = 0
#: constant indicating a scheduler's running state (started and processing jobs)
@ -62,12 +66,18 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
.. seealso:: :ref:`scheduler-config`
"""
# The `group=...` API is only available in the backport, used in <=3.7, and in std>=3.10.
if (3, 8) <= sys.version_info < (3, 10):
_trigger_plugins = {ep.name: ep for ep in entry_points()['apscheduler.triggers']}
_executor_plugins = {ep.name: ep for ep in entry_points()['apscheduler.executors']}
_jobstore_plugins = {ep.name: ep for ep in entry_points()['apscheduler.jobstores']}
else:
_trigger_plugins = {ep.name: ep for ep in entry_points(group='apscheduler.triggers')}
_executor_plugins = {ep.name: ep for ep in entry_points(group='apscheduler.executors')}
_jobstore_plugins = {ep.name: ep for ep in entry_points(group='apscheduler.jobstores')}
_trigger_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.triggers'))
_trigger_classes = {}
_executor_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.executors'))
_executor_classes = {}
_jobstore_plugins = dict((ep.name, ep) for ep in iter_entry_points('apscheduler.jobstores'))
_jobstore_classes = {}
#
@ -1019,6 +1029,7 @@ class BaseScheduler(six.with_metaclass(ABCMeta)):
wait_seconds = None
self._logger.debug('No jobs; waiting until a job is added')
else:
now = datetime.now(self.timezone)
wait_seconds = min(max(timedelta_seconds(next_wakeup_time - now), 0), TIMEOUT_MAX)
self._logger.debug('Next wakeup is due at %s (in %f seconds)', next_wakeup_time,
wait_seconds)

View file

@ -1,24 +1,22 @@
from __future__ import absolute_import
from importlib import import_module
from itertools import product
from apscheduler.schedulers.base import BaseScheduler
try:
from PyQt5.QtCore import QObject, QTimer
except (ImportError, RuntimeError): # pragma: nocover
for version, pkgname in product(range(6, 1, -1), ("PySide", "PyQt")):
try:
from PyQt4.QtCore import QObject, QTimer
qtcore = import_module(pkgname + str(version) + ".QtCore")
except ImportError:
try:
from PySide6.QtCore import QObject, QTimer # noqa
except ImportError:
try:
from PySide2.QtCore import QObject, QTimer # noqa
except ImportError:
try:
from PySide.QtCore import QObject, QTimer # noqa
except ImportError:
raise ImportError('QtScheduler requires either PyQt5, PyQt4, PySide6, PySide2 '
'or PySide installed')
pass
else:
QTimer = qtcore.QTimer
break
else:
raise ImportError(
"QtScheduler requires either PySide/PyQt (v6 to v2) installed"
)
class QtScheduler(BaseScheduler):

View file

@ -6,7 +6,7 @@ from asyncio import iscoroutinefunction
from datetime import date, datetime, time, timedelta, tzinfo
from calendar import timegm
from functools import partial
from inspect import isclass, ismethod
from inspect import isbuiltin, isclass, isfunction, ismethod
import re
import sys
@ -214,28 +214,15 @@ def get_callable_name(func):
:rtype: str
"""
# the easy case (on Python 3.3+)
if hasattr(func, '__qualname__'):
if ismethod(func):
self = func.__self__
cls = self if isclass(self) else type(self)
return f"{cls.__qualname__}.{func.__name__}"
elif isclass(func) or isfunction(func) or isbuiltin(func):
return func.__qualname__
# class methods, bound and unbound methods
f_self = getattr(func, '__self__', None) or getattr(func, 'im_self', None)
if f_self and hasattr(func, '__name__'):
f_class = f_self if isclass(f_self) else f_self.__class__
else:
f_class = getattr(func, 'im_class', None)
if f_class and hasattr(func, '__name__'):
return '%s.%s' % (f_class.__name__, func.__name__)
# class or class instance
if hasattr(func, '__call__'):
# class
if hasattr(func, '__name__'):
return func.__name__
elif hasattr(func, '__call__') and callable(func.__call__):
# instance of a class with a __call__ method
return func.__class__.__name__
return type(func).__qualname__
raise TypeError('Unable to determine a name for %r -- maybe it is not a callable?' % func)
@ -260,16 +247,10 @@ def obj_to_ref(obj):
raise ValueError('Cannot create a reference to a nested function')
if ismethod(obj):
if hasattr(obj, 'im_self') and obj.im_self:
# bound method
module = obj.im_self.__module__
elif hasattr(obj, 'im_class') and obj.im_class:
# unbound method
module = obj.im_class.__module__
else:
module = obj.__module__
module = obj.__self__.__module__
else:
module = obj.__module__
return '%s:%s' % (module, name)