Skip to content

Commit

Permalink
Drop Python 3.6 (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Sep 17, 2022
1 parent a68c105 commit ac54898
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ repos:
rev: 'v2.37.3'
hooks:
- id: pyupgrade
args: ['--py36-plus']
args: ['--py37-plus']
- repo: https://github.com/PyCQA/flake8
rev: '5.0.4'
hooks:
Expand Down
5 changes: 1 addition & 4 deletions aiojobs/_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 1 addition & 5 deletions aiojobs/_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import asyncio
import sys
from collections.abc import Collection

from ._job import Job


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
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
5 changes: 0 additions & 5 deletions tests/test_scheduler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import sys
from unittest import mock

import pytest
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit ac54898

Please sign in to comment.