Skip to content

Commit b161d02

Browse files
committed
Update requirement to python>=3.11
1 parent 5fbb8fb commit b161d02

File tree

8 files changed

+13
-32
lines changed

8 files changed

+13
-32
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
python-version: ["3.11", "3.12", "3.13", "3.14.0-beta.1"]
1818

1919
steps:
2020
- name: Checkout

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ input and MIDI.
1616
There is experimental, undocumented, incomplete and unstable access to USB.
1717

1818
Requirements:
19-
* python >= 3.9
19+
* python >= 3.11
2020
* Fairly recent linux kernel
2121
* Installed kernel modules you want to access
2222

docs/develop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Requirements
44

5-
A linux OS and python >= 3.9.
5+
A linux OS and python >= 3.11.
66

77
From within your favorite python environment:
88

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Linuxpy has your back.
2828

2929
Requirements:
3030

31-
* python >= 3.9
31+
* python >= 3.11
3232
* Fairly recent linux kernel
3333
* Installed kernel modules you want to access (ex: *uinput* if you need user space
3434
created input devices)

linuxpy/gpio/device.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from linuxpy.ioctl import ioctl
3838
from linuxpy.types import AsyncIterator, Collection, FDLike, Iterable, Optional, PathLike, Sequence, Union
3939
from linuxpy.util import (
40-
aclosing,
4140
async_event_stream as async_events,
4241
bit_indexes,
4342
chunks,
@@ -580,7 +579,7 @@ async def async_info_stream(self, lines: Collection[int]) -> AsyncIterator[LineI
580579
AsyncIterator[LineInfoEvent]: the asynchronous stream of line info events
581580
"""
582581
with self.watching(lines):
583-
async with aclosing(self.__aiter__()) as stream:
582+
async with contextlib.aclosing(self.__aiter__()) as stream:
584583
async for event in stream:
585584
yield event
586585

linuxpy/util.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,6 @@ def feed():
130130
yield event
131131

132132

133-
class aclosing(contextlib.AbstractAsyncContextManager):
134-
"""Async context manager for safely finalizing an asynchronously cleaned-up
135-
resource such as an async generator, calling its ``aclose()`` method.
136-
137-
This is a copy of contextlib.aclosing needed for python 3.9 compatibility
138-
"""
139-
140-
def __init__(self, thing):
141-
self.thing = thing
142-
143-
async def __aenter__(self):
144-
return self.thing
145-
146-
async def __aexit__(self, *exc_info):
147-
await self.thing.aclose()
148-
149-
150133
def Selector(fds: Collection[FDLike], events=selectors.EVENT_READ) -> selectors.DefaultSelector:
151134
"""A selectors.DefaultSelector with given fds registered"""
152135
selector = selectors.DefaultSelector()
@@ -183,7 +166,7 @@ def event_stream(fds: Collection[FDLike], read: Callable[[FDLike], T], timeout:
183166

184167
async def async_selector_stream(selector: selectors.BaseSelector) -> AsyncIterator[SelectorEvent]:
185168
"""An asyncronous infinite stream of selector read events"""
186-
async with aclosing(astream(selector, selector.select)) as stream:
169+
async with contextlib.aclosing(astream(selector, selector.select)) as stream:
187170
async for events in stream:
188171
for event in events:
189172
yield event
@@ -192,22 +175,22 @@ async def async_selector_stream(selector: selectors.BaseSelector) -> AsyncIterat
192175
async def async_selector_file_stream(fds: Collection[FDLike]) -> AsyncIterator[SelectorEvent]:
193176
"""An asyncronous infinite stream of selector read events"""
194177
selector = Selector(fds)
195-
async with aclosing(async_selector_stream(selector)) as stream:
178+
async with contextlib.aclosing(async_selector_stream(selector)) as stream:
196179
async for event in stream:
197180
yield event
198181

199182

200183
async def async_file_stream(fds: Collection[FDLike]) -> AsyncIterator[FDLike]:
201184
"""An asyncronous infinite stream of read ready files"""
202-
async with aclosing(async_selector_file_stream(fds)) as stream:
185+
async with contextlib.aclosing(async_selector_file_stream(fds)) as stream:
203186
async for key, _ in stream:
204187
yield key.fileobj
205188

206189

207190
async def async_event_stream(fds: Collection[FDLike], read: Callable[[FDLike], T]):
208191
"""An asyncronous stream of events. The given read callable is called for each file
209192
that is reported as ready"""
210-
async with aclosing(async_file_stream(fds)) as stream:
193+
async with contextlib.aclosing(async_file_stream(fds)) as stream:
211194
async for fd in stream:
212195
yield read(fd)
213196

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@ license = {text = "GPL-3.0-or-later"}
1111
authors = [
1212
{ name = "Jose Tiago Macara Coutinho", email = "coutinhotiago@gmail.com" }
1313
]
14-
requires-python = ">=3.9"
14+
requires-python = ">=3.11"
1515
classifiers = [
1616
"Development Status :: 4 - Beta",
1717
"Intended Audience :: Developers",
1818
"Intended Audience :: System Administrators",
1919
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
2020
"Operating System :: POSIX :: Linux",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.9",
23-
"Programming Language :: Python :: 3.10",
2422
"Programming Language :: Python :: 3.11",
2523
"Programming Language :: Python :: 3.12",
2624
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: 3.14",
2726
"Topic :: Multimedia :: Video",
2827
"Topic :: Multimedia :: Video :: Capture",
2928
]

tests/test_gpio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import socket
1010
import threading
1111
import time
12-
from contextlib import ExitStack, contextmanager
12+
from contextlib import ExitStack, aclosing, contextmanager
1313
from inspect import isgenerator
1414
from itertools import count
1515
from math import ceil, isclose
@@ -39,7 +39,7 @@
3939
iter_gpio_files,
4040
)
4141
from linuxpy.gpio.sim import find_gpio_sim_file
42-
from linuxpy.util import aclosing, bit_indexes
42+
from linuxpy.util import bit_indexes
4343

4444

4545
def FD():

0 commit comments

Comments
 (0)