diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adba5608..457a4db7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - pyver: ['3.6', '3.7', '3.8', '3.9', '3.10'] + pyver: ['3.7', '3.8', '3.9', '3.10'] fail-fast: true steps: - name: Checkhout diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8d5e5827..8944c1fa 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -69,7 +69,7 @@ repos: rev: 'v2.31.0' hooks: - id: pyupgrade - args: ['--py36-plus'] + args: ['--py37-plus'] - repo: https://github.com/PyCQA/flake8 rev: '4.0.1' hooks: diff --git a/aiojobs/_job.py b/aiojobs/_job.py index 44f09f44..63f45837 100644 --- a/aiojobs/_job.py +++ b/aiojobs/_job.py @@ -12,10 +12,7 @@ class Job: _task = None def __init__(self, coro, scheduler): - if sys.version_info >= (3, 7): - self._loop = loop = asyncio.get_running_loop() - else: - self._loop = loop = asyncio.get_event_loop() + self._loop = loop = asyncio.get_running_loop() self._coro = coro self._scheduler = scheduler self._started = loop.create_future() diff --git a/aiojobs/_scheduler.py b/aiojobs/_scheduler.py index f5f8df93..a19b7a94 100644 --- a/aiojobs/_scheduler.py +++ b/aiojobs/_scheduler.py @@ -1,5 +1,4 @@ import asyncio -import sys from collections.abc import Collection from ._job import Job @@ -7,10 +6,7 @@ class Scheduler(Collection): def __init__(self, *, close_timeout, limit, pending_limit, exception_handler): - if sys.version_info >= (3, 7): - self._loop = loop = asyncio.get_running_loop() - else: - self._loop = loop = asyncio.get_event_loop() + self._loop = loop = asyncio.get_running_loop() self._jobs = set() self._close_timeout = close_timeout self._limit = limit diff --git a/pyproject.toml b/pyproject.toml index d0ec963a..39ac9495 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ home-page = "https://github.com/aio-libs/aiojobs" requires=[ "async-timeout >= 4.0.0" ] -requires-python=">=3.6" +requires-python=">=3.7" description-file="README.rst" classifiers = [ "License :: OSI Approved :: Apache Software License", @@ -19,7 +19,6 @@ classifiers = [ "Framework :: AsyncIO", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py index 46110f53..6d81dc6b 100644 --- a/tests/test_scheduler.py +++ b/tests/test_scheduler.py @@ -1,5 +1,4 @@ import asyncio -import sys from unittest import mock import pytest @@ -379,10 +378,6 @@ async def f(): del coro -@pytest.mark.skipif( - sys.version_info < (3, 7), - reason="Python 3.6 doesn't support asyncio.get_running_loop()", -) def test_scheduler_must_be_created_within_running_loop(): with pytest.raises(RuntimeError) as exc_info: Scheduler(close_timeout=0, limit=0, pending_limit=0, exception_handler=None)