Compare commits

..

No commits in common. "rawhide" and "f29" have entirely different histories.

9 changed files with 146 additions and 294 deletions

5
.gitignore vendored
View file

@ -1,7 +1,2 @@
/APScheduler-3.0.5.tar.gz /APScheduler-3.0.5.tar.gz
/APScheduler-3.5.3.tar.gz /APScheduler-3.5.3.tar.gz
/APScheduler-3.6.3.tar.gz
/APScheduler-3.7.0.tar.gz
/APScheduler-3.8.0.tar.gz
/APScheduler-3.10.4.tar.gz
/apscheduler-3.11.0.tar.gz

View file

@ -1,38 +0,0 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/
specfile_path: python-APScheduler.spec
upstream_package_name: APScheduler
downstream_package_name: python-APScheduler
upstream_project_url: https://github.com/agronholm/apscheduler
version_update_mask: '\d+\.'
upstream_tag_exclude: "^4.[0-9].[0-9]a" # exclude version 4 alpha releases
packit_instances: ["stg"]
jobs:
- job: copr_build
owner: mmassari
project: apscheduler
trigger: pull_request
targets:
- fedora-all
- job: pull_from_upstream
trigger: release
dist_git_branches:
- fedora-all
- job: koji_build
trigger: commit
allowed_pr_authors: ["packit-stg", "packit", "mmassari"]
allowed_committers: ["mmassari"]
dist_git_branches:
- fedora-all
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-branched # rawhide updates are created automatically

View file

@ -1,102 +0,0 @@
diff --git a/setup.cfg b/setup.cfg
index 002111f..012cff4 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -7,7 +7,7 @@ upload-dir = docs/_build/html
[tool:pytest]
asyncio_mode = strict
-addopts = -rsx --cov --tb=short
+addopts = -rsx --tb=short
testpaths = tests
[coverage:run]
diff --git a/setup.py b/setup.py
index cd93e10..59f5a80 100644
--- a/setup.py
+++ b/setup.py
@@ -56,7 +56,6 @@ setup(
'testing': [
'pytest',
'pytest_asyncio',
- 'pytest-cov',
'pytest-tornado5'
],
'doc': [
diff --git a/tests/test_executors.py b/tests/test_executors.py
index d67e187..0140dbe 100644
--- a/tests/test_executors.py
+++ b/tests/test_executors.py
@@ -5,6 +5,7 @@ import gc
import os
import signal
import time
+from time import sleep
import pytest
from pytz import UTC
@@ -36,11 +37,11 @@ def executor(request, mock_scheduler):
executor_ = ThreadPoolExecutor()
else:
from apscheduler.executors.pool import ProcessPoolExecutor
- executor_ = ProcessPoolExecutor()
+ executor_ = ProcessPoolExecutor(4, {"max_tasks_per_child": 1})
executor_.start(mock_scheduler, 'dummy')
yield executor_
- executor_.shutdown()
+ executor_.shutdown(True)
def wait_event():
@@ -60,12 +61,12 @@ def test_max_instances(mock_scheduler, executor, create_job, freeze_time):
"""Tests that the maximum instance limit on a job is respected."""
events = []
mock_scheduler._dispatch_event = lambda event: events.append(event)
- job = create_job(func=wait_event, max_instances=2, next_run_time=None)
+ job = create_job(func=wait_event, max_instances=2, next_run_time=None, misfire_grace_time = None)
executor.submit_job(job, [freeze_time.current])
executor.submit_job(job, [freeze_time.current])
pytest.raises(MaxInstancesReachedError, executor.submit_job, job, [freeze_time.current])
- executor.shutdown()
+ executor.shutdown(True)
assert len(events) == 2
assert events[0].retval == 'test'
assert events[1].retval == 'test'
@@ -83,12 +84,13 @@ def test_submit_job(mock_scheduler, executor, create_job, freeze_time, timezone,
"""
mock_scheduler._dispatch_event = MagicMock()
- job = create_job(func=func, id='foo')
+ misfire_grace_time = 1 if event_code == EVENT_JOB_MISSED else None
+ job = create_job(func=func, id='foo', misfire_grace_time=misfire_grace_time)
job._jobstore_alias = 'test_jobstore'
run_time = (timezone.localize(datetime(1970, 1, 1)) if event_code == EVENT_JOB_MISSED else
freeze_time.current)
executor.submit_job(job, [run_time])
- executor.shutdown()
+ executor.shutdown(True)
assert mock_scheduler._dispatch_event.call_count == 1
event = mock_scheduler._dispatch_event.call_args[0][0]
@@ -157,18 +159,13 @@ def test_broken_pool():
pid = [None]
event = Event()
- scheduler = BackgroundScheduler(executors={'default': ProcessPoolExecutor(1)})
+ scheduler = BackgroundScheduler(executors={'default': ProcessPoolExecutor(1, {"max_tasks_per_child": 1})})
scheduler.add_listener(listener, EVENT_JOB_EXECUTED)
scheduler.add_job(os.getpid, 'date', run_date=datetime.now(UTC))
scheduler.start()
event.wait(3)
killed_pid = pid[0]
- os.kill(pid[0], signal.SIGTERM)
- try:
- os.waitpid(pid[0], 0)
- except OSError:
- pass
event.clear()
scheduler.add_job(os.getpid, 'date', run_date=datetime.now(UTC))

View file

@ -1,3 +0,0 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.104.1.post1.dev0+g23aec6b3.d20241128.

View file

@ -1,79 +0,0 @@
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 3.8.0-3
- Rebuilt for Python 3.11
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 3.8.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Thu Sep 23 2021 Fedora Release Monitoring <release-monitoring@fedoraproject.org> - 3.8.0-1
- Update to 3.8.0 (#1917870)
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 3.7.0-3
- Rebuilt for Python 3.10
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jan 20 2021 Fabien Boucher <fboucher@redhat.com> - 3.7.0-1
- Upstream 3.7.0 (RHBZ#1917870)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.6.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Jul 20 2020 Fabien Boucher <fboucher@redhat.com> - 3.6.3-3
- Update project url
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 3.6.3-2
- Rebuilt for Python 3.9
* Wed Mar 11 2020 Fabien Boucher <fboucher@redhat.com> - 3.6.3-1
- Inport from SF packaging and bump to 3.6.3 (#1813957)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 3.5.3-4
- Rebuilt for Python 3.8
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.5.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sun Dec 16 2018 Miro Hrončok <mhroncok@redhat.com> - 3.5.3-2
- Subpackage python2-APScheduler has been removed
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
* Mon Aug 20 2018 Haïkel Guémar <hguemar@fedoraproject.org> - 3.5.3-1
- Upstream 3.5.3 (RHBZ#1605579)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.5-9
- Rebuilt for Python 3.7
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.0.5-8
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.0.5-4
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sat Dec 19 2015 Paul Belanger <pabelanger@redhat.com> - 3.0.5-1
- Initial packaging (#1218410)

View file

@ -1,57 +1,166 @@
%global _description %{expand: %global pypi_name APScheduler
Advanced Python Scheduler (APScheduler) is a Python library that lets you %if 0%{?fedora}
schedule your Python code to be executed later, either just once or %global with_python3 1
periodically. You can add new jobs or remove old ones on the fly as you %endif
please. If you store your jobs in a database, they will also survive
scheduler restarts and maintain their state. When the scheduler is
restarted, it will then run all the jobs it should have run while it was
offline.}
Name: python-APScheduler Name: python-%{pypi_name}
Version: 3.11.0 Version: 3.5.3
Release: %autorelease Release: 1%{?dist}
Summary: In-process task scheduler with Cron-like capabilities Summary: In-process task scheduler with Cron-like capabilities
License: MIT License: MIT
URL: https://pypi.org/project/APScheduler/ URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: %{pypi_source apscheduler} Source0: https://pypi.python.org/packages/source/A/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch BuildArch: noarch
%description %_description BuildRequires: python2-devel
BuildRequires: python2-funcsigs
BuildRequires: python2-futures
BuildRequires: python2-setuptools
BuildRequires: python2-setuptools_scm
BuildRequires: python2-six >= 1.4.0
BuildRequires: python2-tzlocal
# Unit testing
BuildRequires: python2-mock
BuildRequires: python2-pytest
BuildRequires: python2-pytest-cov
BuildRequires: python2-tornado
%package -n python3-APScheduler %if 0%{?with_python3}
Summary: %{summary}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-setuptools_scm
BuildRequires: python3-six >= 1.4.0
BuildRequires: python3-tzlocal
# Unit testing
BuildRequires: python3-mock
BuildRequires: python3-pytest
BuildRequires: python3-pytest-cov
BuildRequires: python3-pytest-asyncio
BuildRequires: python3-pytest-tornado
BuildRequires: python3-tornado
%endif
%description -n python3-APScheduler %_description %description
Advanced Python Scheduler (APScheduler) is a Python library that lets you
schedule your Python code to be executed later, either just once or
periodically.
%package -n python2-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python2-%{pypi_name}}
Requires: python2-funcsigs
Requires: python2-futures
Requires: python2-six >= 1.4.0
Requires: python2-tzlocal
%description -n python2-%{pypi_name}
Advanced Python Scheduler (APScheduler) is a Python library that lets you
schedule your Python code to be executed later, either just once or
periodically.
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}
Requires: python3-six >= 1.4.0
Requires: python3-tzlocal
%description -n python3-%{pypi_name}
Advanced Python Scheduler (APScheduler) is a Python library that lets you
schedule your Python code to be executed later, either just once or
periodically.
%endif
%package doc
Summary: Documentation of the Advanced Python Scheduler library
BuildRequires: python2-sphinx
%description doc
Documentation of the Advanced Python Scheduler library.
%prep %prep
%autosetup -n apscheduler-%{version} -p1 %autosetup -n %{pypi_name}-%{version}
# Remove that test as it require services (redis, zookeeper, ...) rm -rf %{pypi_name}.egg-info
# up and running. Upstream provides a docker compose to spawn
# services before running these tests.
rm tests/test_jobstores.py
# Skip missing dependencies in Fedora 42
sed -i 's/ "anyio >= 4.5.2",//' pyproject.toml
sed -i 's/,rethinkdb//' pyproject.toml
%generate_buildrequires
%pyproject_buildrequires -x test -x tornado
%build %build
%pyproject_wheel %py2_build
%if 0%{?with_python3}
%py3_build
%endif
## generate html docs
%{__python2} setup.py build_sphinx
rm -rf docs/_build/html/.{doctrees,buildinfo} docs/_build/html/objects.inv
%install %install
%pyproject_install %py2_install
%pyproject_save_files apscheduler # Remove python3 only files as they mess up with byte-compilation
rm %{buildroot}%{python2_sitelib}/apscheduler/executors/base_py3.py
%if 0%{?with_python3}
%py3_install
%endif
%check %check
# Default timezone to UTC otherwise unit tests fail. # Default timezone to UTC otherwise unit tests fail.
export TZ=UTC export TZ=UTC
%pytest %{__python2} -m pytest
%if 0%{?with_python3}
# FIXME(hguemar): two test cases fail, one of them being a false positive
# Needs more investigation for the other
%{__python3} -m pytest ||:
%endif
%files -n python3-APScheduler -f %{pyproject_files} %files -n python2-%{pypi_name}
%license LICENSE.txt
%doc README.rst %doc README.rst
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info/
%{python2_sitelib}/apscheduler/
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/
%{python3_sitelib}/apscheduler/
%endif
%files doc
%doc docs/_build/html
%changelog %changelog
%autochangelog * Mon Aug 20 2018 Haïkel Guémar <hguemar@fedoraproject.org> - 3.5.3-1
- Upstream 3.5.3 (RHBZ#1605579)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 3.0.5-9
- Rebuilt for Python 3.7
* Wed Feb 21 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.0.5-8
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 3.0.5-4
- Rebuild for Python 3.6
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.5-3
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Sat Dec 19 2015 Paul Belanger <pabelanger@redhat.com> - 3.0.5-1
- Initial packaging (#1218410)

View file

@ -1 +1 @@
SHA512 (apscheduler-3.11.0.tar.gz) = c66d87773d3fe353e5f0bbc4bc9ba05337b555db0810e42e2e384fd9717438fda501d0c724cd7180010b11e5d8db901922b79a163aec3a420a6a65eafb6f39f6 SHA512 (APScheduler-3.5.3.tar.gz) = dd3e98d0f474511851bdc109a1c65f7f97d221f95d086603d12b3f280285460234724369f05816e1754d58d94adadbec0deb8a0fa63fcd6531914d4a1f4fb3fc

View file

@ -1,19 +0,0 @@
#!/bin/bash
# Include Beaker environment
. /usr/bin/rhts-environment.sh
. /usr/lib/beakerlib/beakerlib.sh
PACKAGE="python3-APScheduler"
rlJournalStart
rlPhaseStartSetup
rlAssertRpm $PACKAGE
rlPhaseEnd
rlPhaseStartTest
rlRun "python3 -c 'import apscheduler'"
rlPhaseEnd
rlJournalPrintText
rlJournalEnd

View file

@ -1,11 +0,0 @@
---
- hosts: localhost
roles:
- role: standard-test-beakerlib
tags:
- classic
- atomic
tests:
- simple-test
required_packages:
- python3-APScheduler