Modernize metadata and deps, support 3.8-3.12 (#154)

* Modernize metadata and deps, support 3.8-3.12

* rtd config

* rtd extras
This commit is contained in:
Amethyst Reese 2024-02-05 18:53:19 -08:00 committed by GitHub
parent 1af4bf4aa7
commit 39c5fe810c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 57 additions and 61 deletions

View File

@ -8,6 +8,8 @@ ignore =
E2
E3
E4
E704
max-line-length = 88
per-file-ignores =
__init__.py: F401

View File

@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11.0-rc.1 - 3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [macOS-latest, ubuntu-latest, windows-latest]
steps:
@ -26,8 +26,7 @@ jobs:
- name: Install
run: |
python -m pip install --upgrade pip
make setup
pip install -U .
make EXTRAS=dev install
- name: Test
run: make test
- name: Lint

View File

@ -1,9 +1,13 @@
version: 2
sphinx:
configuration: docs/conf.py
build:
os: ubuntu-22.04
tools:
python: "3.10"
python:
version: 3.7
install:
- requirements: requirements-dev.txt
- method: pip
path: .
extra_requirements:
- docs

View File

@ -327,7 +327,7 @@ async def min(itr: AnyIterable[Orderable], **kwargs: Any) -> Any:
return value
async def sum(itr: AnyIterable[T], start: T = None) -> T:
async def sum(itr: AnyIterable[T], start: Optional[T] = None) -> T:
"""
Compute the sum of a mixed iterable, adding each value with the start value.
@ -420,4 +420,4 @@ async def zip(*itrs: AnyIterable[Any]) -> AsyncIterator[Tuple[Any, ...]]:
)
if builtins.any(isinstance(v, AnyStop) for v in values):
break
yield values
yield tuple(values)

View File

@ -14,11 +14,9 @@ else: # pragma: no cover
class Orderable(Protocol): # pragma: no cover
def __lt__(self, other):
...
def __lt__(self, other): ...
def __gt__(self, other):
...
def __gt__(self, other): ...
async def maybe_await(object: Union[Awaitable[T], T]) -> T:

View File

@ -364,5 +364,5 @@ class BuiltinsTest(TestCase):
long = [0, 1, 2, 3, 5]
result = await ait.list(ait.zip(short, long))
expected = [["a", 0], ["b", 1], ["c", 2]]
expected = [("a", 0), ("b", 1), ("c", 2)]
self.assertListEqual(expected, result)

View File

@ -1,35 +1,30 @@
build:
flit build
dev:
flit install --symlink
setup:
python -m pip install -Ur requirements-dev.txt
PKG:=aioitertools
EXTRAS:=dev,docs
.venv:
python -m venv .venv
source .venv/bin/activate && make setup dev
source .venv/bin/activate && make install
echo 'run `source .venv/bin/activate` to use virtualenv'
venv: .venv
install:
python -m pip install -Ue .[$(EXTRAS)]
release: lint test clean
flit publish
format:
python -m usort format aioitertools
python -m black aioitertools
python -m ufmt format $(PKG)
lint:
python -m flake8 aioitertools
python -m usort check aioitertools
python -m black --check aioitertools
python -m flake8 $(PKG)
python -m ufmt check $(PKG)
test:
python -m coverage run -m aioitertools.tests
python -m coverage run -m $(PKG).tests
python -m coverage report
python -m mypy aioitertools
python -m mypy -p $(PKG)
html: .venv README.md docs/*
source .venv/bin/activate && sphinx-build -b html docs html

View File

@ -1,2 +0,0 @@
[mypy]
ignore_missing_imports = True

View File

@ -1,15 +1,13 @@
[build-system]
requires = ["flit_core >=2,<4"]
requires = ["flit_core >=3.8,<4"]
build-backend = "flit_core.buildapi"
[tool.flit.metadata]
module = "aioitertools"
author = "Amethyst Reese"
author-email = "amy@noswap.com"
description-file = "README.md"
home-page = "https://aioitertools.omnilib.dev"
requires = ["typing_extensions>=4.0; python_version < '3.10'"]
requires-python = ">=3.6"
[project]
name = "aioitertools"
readme = "README.md"
authors = [{ name = "Amethyst Reese", email = "amethyst@n7.gg" }]
license = { file = "LICENSE" }
dynamic = ["version", "description"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: AsyncIO",
@ -17,15 +15,31 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.8"
dependencies = ["typing_extensions>=4.0; python_version < '3.10'"]
[tool.flit.metadata.urls]
Documentation = "https://aioitertools.omnilib.dev/en/latest/"
[project.optional-dependencies]
dev = [
"attribution==1.6.2",
"black==24.1.0",
"coverage==7.4.0",
"flake8==7.0.0",
"flit==3.9.0",
"mypy==1.8.0",
"usort==1.0.7",
"ufmt==2.3.0",
]
docs = [
"sphinx==7.2.6",
"sphinx-mdinclude==0.5.3",
]
[project.urls]
Documentation = "https://aioitertools.omnilib.dev"
Github = "https://github.com/omnilib/aioitertools"
[tool.flit.sdist]
exclude = [
".github/",
]
exclude = [".github/"]
[tool.attribution]
name = "aioitertools"
@ -44,9 +58,6 @@ precision = 1
show_missing = true
skip_covered = true
[tool.isort]
line_length = 88
multi_line_output = 3
force_grid_wrap = false
include_trailing_comma = true
use_parentheses = true
[tool.mypy]
# strict = true
ignore_missing_imports = true

View File

@ -1,10 +0,0 @@
attribution==1.5.2
black==22.8.0
coverage[toml]==6.2; python_version < "3.10"
coverage==6.4.4; python_version >= "3.10"
flake8==5.0.4
flit==3.7.1
mypy==0.971
sphinx==4.3.2
usort==1.0.5
sphinx-mdinclude==0.5.2

View File

@ -1 +0,0 @@
typing_extensions>=4.0;python_version<"3.10"