Skip to content

Commit

Permalink
Python >=3.8 required.
Browse files Browse the repository at this point in the history
Mkdocs and mypy compatibility.
  • Loading branch information
coady committed Jan 18, 2023
1 parent cc540cf commit 7715bcf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11.0-rc - 3.11']
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__pycache__/
site/
.coverage
.venv/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ check:

lint:
black --check .
flake8 --exclude .venv --ignore E203,E501,F811
flake8 --ignore E203,E501,F811 waiter tests
mypy -p waiter

html:
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ Waiter objects have a `stats` attribute for aggregating statistics about the cal
```

## Changes
dev

* Python >=3.8 required

1.3

* Python >=3.7 required
Expand Down
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins:
- mkdocstrings:
handlers:
python:
rendering:
options:
show_root_heading: true
- mkdocs-jupyter:
execute: True
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "waiter"
dynamic = ["version"]
description = "Delayed iteration for polling and retries."
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = {file = "LICENSE.txt"}
authors = [{name = "Aric Coady", email = "aric.coady@gmail.com"}]
keywords = ["wait", "retry", "poll", "delay", "sleep", "timeout", "incremental", "exponential", "backoff", "async"]
Expand All @@ -17,7 +17,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down
12 changes: 6 additions & 6 deletions waiter/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# type: ignore[no-redef]
# mypy: disable-error-code="no-redef,valid-type"
import asyncio
import collections
import contextlib
Expand All @@ -8,7 +8,7 @@
import time
import types
from functools import partial
from typing import AsyncIterable, Callable, Iterable, Iterator, Sequence
from typing import AsyncIterable, Callable, Iterable, Iterator, Optional, Sequence
from multimethod import multimethod, overload

__version__ = '1.3'
Expand All @@ -25,10 +25,10 @@ def fibonacci(x, y):
@contextlib.contextmanager
def suppress(*exceptions: Exception):
"""Variant of `contextlib.suppress`, which also records exception."""
excs = []
excs: list = []
try:
yield excs
except exceptions as exc:
except exceptions as exc: # type: ignore
excs.append(exc)


Expand Down Expand Up @@ -59,7 +59,7 @@ def add(self, attempt: int, elapsed: float) -> float:
return elapsed

@property
def total(self) -> float:
def total(self) -> float: # type: ignore
"""total number of attempts"""
return sum(self.values())

Expand Down Expand Up @@ -185,7 +185,7 @@ async def throttle(self, iterable: AsyncIterable):
async for _ in self:
yield await anext()

def stream(self, queue: Iterable, size: int = None) -> Iterator:
def stream(self, queue: Iterable, size: Optional[int] = None) -> Iterator:
"""Generate chained values in groups from an iterable.
The queue can be extended while in use.
Expand Down

0 comments on commit 7715bcf

Please sign in to comment.