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 E2
E3 E3
E4 E4
E704
max-line-length = 88 max-line-length = 88
per-file-ignores = per-file-ignores =
__init__.py: F401 __init__.py: F401

View File

@ -13,7 +13,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: 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] os: [macOS-latest, ubuntu-latest, windows-latest]
steps: steps:
@ -26,8 +26,7 @@ jobs:
- name: Install - name: Install
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
make setup make EXTRAS=dev install
pip install -U .
- name: Test - name: Test
run: make test run: make test
- name: Lint - name: Lint

View File

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

View File

@ -327,7 +327,7 @@ async def min(itr: AnyIterable[Orderable], **kwargs: Any) -> Any:
return value 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. 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): if builtins.any(isinstance(v, AnyStop) for v in values):
break break
yield values yield tuple(values)

View File

@ -14,11 +14,9 @@ else: # pragma: no cover
class Orderable(Protocol): # 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: 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] long = [0, 1, 2, 3, 5]
result = await ait.list(ait.zip(short, long)) 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) self.assertListEqual(expected, result)

View File

@ -1,35 +1,30 @@
build: PKG:=aioitertools
flit build EXTRAS:=dev,docs
dev:
flit install --symlink
setup:
python -m pip install -Ur requirements-dev.txt
.venv: .venv:
python -m venv .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' echo 'run `source .venv/bin/activate` to use virtualenv'
venv: .venv venv: .venv
install:
python -m pip install -Ue .[$(EXTRAS)]
release: lint test clean release: lint test clean
flit publish flit publish
format: format:
python -m usort format aioitertools python -m ufmt format $(PKG)
python -m black aioitertools
lint: lint:
python -m flake8 aioitertools python -m flake8 $(PKG)
python -m usort check aioitertools python -m ufmt check $(PKG)
python -m black --check aioitertools
test: test:
python -m coverage run -m aioitertools.tests python -m coverage run -m $(PKG).tests
python -m coverage report python -m coverage report
python -m mypy aioitertools python -m mypy -p $(PKG)
html: .venv README.md docs/* html: .venv README.md docs/*
source .venv/bin/activate && sphinx-build -b html docs html 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] [build-system]
requires = ["flit_core >=2,<4"] requires = ["flit_core >=3.8,<4"]
build-backend = "flit_core.buildapi" build-backend = "flit_core.buildapi"
[tool.flit.metadata] [project]
module = "aioitertools" name = "aioitertools"
author = "Amethyst Reese" readme = "README.md"
author-email = "amy@noswap.com" authors = [{ name = "Amethyst Reese", email = "amethyst@n7.gg" }]
description-file = "README.md" license = { file = "LICENSE" }
home-page = "https://aioitertools.omnilib.dev" dynamic = ["version", "description"]
requires = ["typing_extensions>=4.0; python_version < '3.10'"]
requires-python = ">=3.6"
classifiers = [ classifiers = [
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Framework :: AsyncIO", "Framework :: AsyncIO",
@ -17,15 +15,31 @@ classifiers = [
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries",
] ]
requires-python = ">=3.8"
dependencies = ["typing_extensions>=4.0; python_version < '3.10'"]
[tool.flit.metadata.urls] [project.optional-dependencies]
Documentation = "https://aioitertools.omnilib.dev/en/latest/" 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" Github = "https://github.com/omnilib/aioitertools"
[tool.flit.sdist] [tool.flit.sdist]
exclude = [ exclude = [".github/"]
".github/",
]
[tool.attribution] [tool.attribution]
name = "aioitertools" name = "aioitertools"
@ -44,9 +58,6 @@ precision = 1
show_missing = true show_missing = true
skip_covered = true skip_covered = true
[tool.isort] [tool.mypy]
line_length = 88 # strict = true
multi_line_output = 3 ignore_missing_imports = true
force_grid_wrap = false
include_trailing_comma = true
use_parentheses = 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"