diff --git a/.gitignore b/.gitignore index 54c9fb9..95ca13b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ /APScheduler-3.0.5.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 diff --git a/.packit.yaml b/.packit.yaml new file mode 100644 index 0000000..a9a2f42 --- /dev/null +++ b/.packit.yaml @@ -0,0 +1,38 @@ +# 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 + diff --git a/0001-use-pytest.param-in-parametrize-decorator.patch b/0001-use-pytest.param-in-parametrize-decorator.patch deleted file mode 100644 index 133f606..0000000 --- a/0001-use-pytest.param-in-parametrize-decorator.patch +++ /dev/null @@ -1,55 +0,0 @@ -From ea99dae0b4b0cfcd232498e8af832874fdaeb983 Mon Sep 17 00:00:00 2001 -From: Fabien Boucher -Date: Tue, 16 Jun 2020 13:47:17 +0200 -Subject: [PATCH] use pytest.param in parametrize decorator - ---- - tests/test_util.py | 31 ++++++++++++++++++------------- - 1 file changed, 18 insertions(+), 13 deletions(-) - -diff --git a/tests/test_util.py b/tests/test_util.py -index 973b81a..81d37c2 100644 ---- a/tests/test_util.py -+++ b/tests/test_util.py -@@ -215,20 +215,25 @@ class TestObjToRef(object): - assert str(exc.value) == 'Cannot create a reference to a nested function' - - @pytest.mark.parametrize('input,expected', [ -- pytest.mark.skipif(sys.version_info[:2] == (3, 2), -- reason="Unbound methods can't be resolved on Python 3.2")( -- (DummyClass.meth, 'tests.test_util:DummyClass.meth') -- ), -+ pytest.param( -+ DummyClass.meth, -+ 'tests.test_util:DummyClass.meth', -+ marks=pytest.mark.skipif( -+ sys.version_info[:2] == (3, 2), -+ reason="Unbound methods can't be resolved on Python 3.2")), - (DummyClass.classmeth, 'tests.test_util:DummyClass.classmeth'), -- pytest.mark.skipif(sys.version_info < (3, 3), -- reason="Requires __qualname__ (Python 3.3+)")( -- (DummyClass.InnerDummyClass.innerclassmeth, -- 'tests.test_util:DummyClass.InnerDummyClass.innerclassmeth') -- ), -- pytest.mark.skipif(sys.version_info < (3, 3), -- reason="Requires __qualname__ (Python 3.3+)")( -- (DummyClass.staticmeth, 'tests.test_util:DummyClass.staticmeth') -- ), -+ pytest.param( -+ DummyClass.InnerDummyClass.innerclassmeth, -+ 'tests.test_util:DummyClass.InnerDummyClass.innerclassmeth', -+ marks=pytest.mark.skipif( -+ sys.version_info < (3, 3), -+ reason="Requires __qualname__ (Python 3.3+)")), -+ pytest.param( -+ DummyClass.staticmeth, -+ 'tests.test_util:DummyClass.staticmeth', -+ marks=pytest.mark.skipif( -+ sys.version_info < (3, 3), -+ reason="Requires __qualname__ (Python 3.3+)")), - (timedelta, 'datetime:timedelta'), - ], ids=['unbound method', 'class method', 'inner class method', 'static method', 'timedelta']) - def test_valid_refs(self, input, expected): --- -2.25.4 - diff --git a/01-test-executors.patch b/01-test-executors.patch new file mode 100644 index 0000000..b3856b7 --- /dev/null +++ b/01-test-executors.patch @@ -0,0 +1,102 @@ +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)) diff --git a/README.packit b/README.packit new file mode 100644 index 0000000..cfc44ec --- /dev/null +++ b/README.packit @@ -0,0 +1,3 @@ +This repository is maintained by packit. +https://packit.dev/ +The file was generated using packit 0.104.1.post1.dev0+g23aec6b3.d20241128. diff --git a/changelog b/changelog new file mode 100644 index 0000000..ee65710 --- /dev/null +++ b/changelog @@ -0,0 +1,79 @@ +* Fri Jul 22 2022 Fedora Release Engineering - 3.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Tue Jun 14 2022 Python Maint - 3.8.0-3 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 3.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Sep 23 2021 Fedora Release Monitoring - 3.8.0-1 +- Update to 3.8.0 (#1917870) + +* Fri Jul 23 2021 Fedora Release Engineering - 3.7.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Fri Jun 04 2021 Python Maint - 3.7.0-3 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 3.7.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Wed Jan 20 2021 Fabien Boucher - 3.7.0-1 +- Upstream 3.7.0 (RHBZ#1917870) + +* Tue Jul 28 2020 Fedora Release Engineering - 3.6.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 20 2020 Fabien Boucher - 3.6.3-3 +- Update project url + +* Tue May 26 2020 Miro Hrončok - 3.6.3-2 +- Rebuilt for Python 3.9 + +* Wed Mar 11 2020 Fabien Boucher - 3.6.3-1 +- Inport from SF packaging and bump to 3.6.3 (#1813957) + +* Mon Aug 19 2019 Miro Hrončok - 3.5.3-4 +- Rebuilt for Python 3.8 + +* Sat Feb 02 2019 Fedora Release Engineering - 3.5.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Sun Dec 16 2018 Miro Hrončok - 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 - 3.5.3-1 +- Upstream 3.5.3 (RHBZ#1605579) + +* Fri Jul 13 2018 Fedora Release Engineering - 3.0.5-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 3.0.5-9 +- Rebuilt for Python 3.7 + +* Wed Feb 21 2018 Iryna Shcherbina - 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 - 3.0.5-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 3.0.5-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 3.0.5-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Mon Dec 19 2016 Miro Hrončok - 3.0.5-4 +- Rebuild for Python 3.6 + +* Tue Jul 19 2016 Fedora Release Engineering - 3.0.5-3 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Thu Feb 04 2016 Fedora Release Engineering - 3.0.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Sat Dec 19 2015 Paul Belanger - 3.0.5-1 +- Initial packaging (#1218410) diff --git a/python-APScheduler.spec b/python-APScheduler.spec index f00efab..dc4fca4 100644 --- a/python-APScheduler.spec +++ b/python-APScheduler.spec @@ -1,125 +1,57 @@ -%global pypi_name APScheduler - -Name: python-%{pypi_name} -Version: 3.5.3 -Release: 4%{?dist} -Summary: In-process task scheduler with Cron-like capabilities - -License: MIT -URL: https://pypi.python.org/pypi/%{pypi_name} -Source0: https://pypi.python.org/packages/source/A/%{pypi_name}/%{pypi_name}-%{version}.tar.gz -Patch0: 0001-use-pytest.param-in-parametrize-decorator.patch -BuildArch: noarch - -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 - -%description +%global _description %{expand: Advanced Python Scheduler (APScheduler) is a Python library that lets you schedule your Python code to be executed later, either just once or -periodically. +periodically. You can add new jobs or remove old ones on the fly as you +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.} -%package -n python3-%{pypi_name} -Summary: %{summary} -%{?python_provide:%python_provide python3-%{pypi_name}} +Name: python-APScheduler +Version: 3.11.0 +Release: %autorelease +Summary: In-process task scheduler with Cron-like capabilities -Requires: python3-six >= 1.4.0 -Requires: python3-tzlocal +License: MIT +URL: https://pypi.org/project/APScheduler/ +Source0: %{pypi_source apscheduler} +BuildArch: noarch -%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. +%description %_description -%package doc -Summary: Documentation of the Advanced Python Scheduler library -BuildRequires: python3-sphinx +%package -n python3-APScheduler +Summary: %{summary} +BuildRequires: python3-devel -%description doc -Documentation of the Advanced Python Scheduler library. +%description -n python3-APScheduler %_description %prep -%autosetup -p1 -n %{pypi_name}-%{version} -rm -rf %{pypi_name}.egg-info +%autosetup -n apscheduler-%{version} -p1 +# Remove that test as it require services (redis, zookeeper, ...) +# 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 -%py3_build - -## generate html docs -%{__python3} setup.py build_sphinx -rm -rf docs/_build/html/.{doctrees,buildinfo} docs/_build/html/objects.inv +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files apscheduler %check # Default timezone to UTC otherwise unit tests fail. export TZ=UTC -# TestBaseScheduler.test_create_trigger_bad_plugin_type does incorrect mocking -# TestIntervalTrigger.test_repr - changed timedelta repr in Python 3.7 -# both fixed upstream -%{__python3} -m pytest -k "not (TestIntervalTrigger and test_repr) and not test_create_trigger_bad_plugin_type" +%pytest -%files -n python3-%{pypi_name} -%license LICENSE.txt +%files -n python3-APScheduler -f %{pyproject_files} %doc README.rst -%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info/ -%{python3_sitelib}/apscheduler/ - -%files doc -%doc docs/_build/html %changelog -* Tue Jun 16 2020 Fabien Boucher - 3.5.3-4 -- Patch to fix #1714212 due to marks in pytest.mark.parametrize deprecated - -* Sat Feb 02 2019 Fedora Release Engineering - 3.5.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sun Dec 16 2018 Miro Hrončok - 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 - 3.5.3-1 -- Upstream 3.5.3 (RHBZ#1605579) - -* Fri Jul 13 2018 Fedora Release Engineering - 3.0.5-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild - -* Tue Jun 19 2018 Miro Hrončok - 3.0.5-9 -- Rebuilt for Python 3.7 - -* Wed Feb 21 2018 Iryna Shcherbina - 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 - 3.0.5-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 3.0.5-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 3.0.5-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Mon Dec 19 2016 Miro Hrončok - 3.0.5-4 -- Rebuild for Python 3.6 - -* Tue Jul 19 2016 Fedora Release Engineering - 3.0.5-3 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 3.0.5-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Sat Dec 19 2015 Paul Belanger - 3.0.5-1 -- Initial packaging (#1218410) +%autochangelog diff --git a/sources b/sources index d83af5c..884733a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (APScheduler-3.5.3.tar.gz) = dd3e98d0f474511851bdc109a1c65f7f97d221f95d086603d12b3f280285460234724369f05816e1754d58d94adadbec0deb8a0fa63fcd6531914d4a1f4fb3fc +SHA512 (apscheduler-3.11.0.tar.gz) = c66d87773d3fe353e5f0bbc4bc9ba05337b555db0810e42e2e384fd9717438fda501d0c724cd7180010b11e5d8db901922b79a163aec3a420a6a65eafb6f39f6 diff --git a/tests/simple-test/runtest.sh b/tests/simple-test/runtest.sh new file mode 100644 index 0000000..715fcfe --- /dev/null +++ b/tests/simple-test/runtest.sh @@ -0,0 +1,19 @@ +#!/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 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..63a8539 --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,11 @@ +--- +- hosts: localhost + roles: + - role: standard-test-beakerlib + tags: + - classic + - atomic + tests: + - simple-test + required_packages: + - python3-APScheduler