Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.16
rev: v0.15.17
hooks:
- id: ruff-check
types: [file]
Expand Down Expand Up @@ -73,7 +73,7 @@ repos:
additional_dependencies: ["pyyaml"]
files: ^(test-requirements\.txt)|(\.pre-commit-config\.yaml)$
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.19
rev: 0.11.21
hooks:
# Compile requirements
- id: pip-compile
Expand Down
8 changes: 4 additions & 4 deletions src/trio/_tests/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ async def agen() -> AsyncGenerator[None]:
yield
with trio.CancelScope() as cscope:
cscope.cancel()
yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770
yield

with pytest.raises(AssertionError):
async with agen() as recv_chan:
Expand Down Expand Up @@ -636,7 +636,7 @@ async def test_as_safe_channel_genexit_exception_group() -> None:
async def agen() -> AsyncGenerator[None]:
try:
async with trio.open_nursery():
yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770
yield
except BaseException as e:
assert pytest.RaisesGroup(GeneratorExit).matches(e) # noqa: PT017
raise
Expand Down Expand Up @@ -668,7 +668,7 @@ async def wait_then_raise() -> None:
async def agen() -> AsyncGenerator[None]:
async with trio.open_nursery() as nursery:
nursery.start_soon(wait_then_raise)
yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770
yield

with pytest.RaisesGroup(ValueError):
async with agen() as g:
Expand All @@ -688,7 +688,7 @@ async def agen(ex: type[BaseException]) -> AsyncGenerator[None]:
async with trio.open_nursery() as nursery:
nursery.start_soon(wait_then_raise, ex)
nursery.start_soon(wait_then_raise, GeneratorExit)
yield # noqa: ASYNC119 # https://github.com/astral-sh/ruff/issues/25770
yield

with pytest.RaisesGroup(AssertionError):
async with agen(GeneratorExit) as g:
Expand Down
66 changes: 66 additions & 0 deletions src/trio/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,57 @@
ALG_SET_OP as ALG_SET_OP,
ALG_SET_PUBKEY as ALG_SET_PUBKEY,
BDADDR_ANY as BDADDR_ANY,
BDADDR_BREDR as BDADDR_BREDR,
BDADDR_LE_PUBLIC as BDADDR_LE_PUBLIC,
BDADDR_LE_RANDOM as BDADDR_LE_RANDOM,
BDADDR_LOCAL as BDADDR_LOCAL,
BT_CHANNEL_POLICY as BT_CHANNEL_POLICY,
BT_CHANNEL_POLICY_BREDR_ONLY as BT_CHANNEL_POLICY_BREDR_ONLY,
BT_CHANNEL_POLICY_BREDR_PREFERRED as BT_CHANNEL_POLICY_BREDR_PREFERRED,
BT_CODEC as BT_CODEC,
BT_DEFER_SETUP as BT_DEFER_SETUP,
BT_FLUSHABLE as BT_FLUSHABLE,
BT_FLUSHABLE_OFF as BT_FLUSHABLE_OFF,
BT_FLUSHABLE_ON as BT_FLUSHABLE_ON,
BT_ISO_QOS as BT_ISO_QOS,
BT_MODE as BT_MODE,
BT_MODE_BASIC as BT_MODE_BASIC,
BT_MODE_ERTM as BT_MODE_ERTM,
BT_MODE_EXT_FLOWCTL as BT_MODE_EXT_FLOWCTL,
BT_MODE_LE_FLOWCTL as BT_MODE_LE_FLOWCTL,
BT_MODE_STREAMING as BT_MODE_STREAMING,
BT_PHY as BT_PHY,
BT_PHY_BR_1M_1SLOT as BT_PHY_BR_1M_1SLOT,
BT_PHY_BR_1M_3SLOT as BT_PHY_BR_1M_3SLOT,
BT_PHY_BR_1M_5SLOT as BT_PHY_BR_1M_5SLOT,
BT_PHY_EDR_2M_1SLOT as BT_PHY_EDR_2M_1SLOT,
BT_PHY_EDR_2M_3SLOT as BT_PHY_EDR_2M_3SLOT,
BT_PHY_EDR_2M_5SLOT as BT_PHY_EDR_2M_5SLOT,
BT_PHY_EDR_3M_1SLOT as BT_PHY_EDR_3M_1SLOT,
BT_PHY_EDR_3M_3SLOT as BT_PHY_EDR_3M_3SLOT,
BT_PHY_EDR_3M_5SLOT as BT_PHY_EDR_3M_5SLOT,
BT_PHY_LE_1M_RX as BT_PHY_LE_1M_RX,
BT_PHY_LE_1M_TX as BT_PHY_LE_1M_TX,
BT_PHY_LE_2M_RX as BT_PHY_LE_2M_RX,
BT_PHY_LE_2M_TX as BT_PHY_LE_2M_TX,
BT_PHY_LE_CODED_RX as BT_PHY_LE_CODED_RX,
BT_PHY_LE_CODED_TX as BT_PHY_LE_CODED_TX,
BT_PKT_STATUS as BT_PKT_STATUS,
BT_POWER as BT_POWER,
BT_POWER_FORCE_ACTIVE_OFF as BT_POWER_FORCE_ACTIVE_OFF,
BT_POWER_FORCE_ACTIVE_ON as BT_POWER_FORCE_ACTIVE_ON,
BT_RCVMTU as BT_RCVMTU,
BT_SECURITY as BT_SECURITY,
BT_SECURITY_FIPS as BT_SECURITY_FIPS,
BT_SECURITY_HIGH as BT_SECURITY_HIGH,
BT_SECURITY_LOW as BT_SECURITY_LOW,
BT_SECURITY_MEDIUM as BT_SECURITY_MEDIUM,
BT_SECURITY_SDP as BT_SECURITY_SDP,
BT_SNDMTU as BT_SNDMTU,
BT_VOICE as BT_VOICE,
BT_VOICE_CVSD_16BIT as BT_VOICE_CVSD_16BIT,
BT_VOICE_TRANSPARENT as BT_VOICE_TRANSPARENT,
BT_VOICE_TRANSPARENT_16BIT as BT_VOICE_TRANSPARENT_16BIT,
BTPROTO_HCI as BTPROTO_HCI,
BTPROTO_L2CAP as BTPROTO_L2CAP,
BTPROTO_RFCOMM as BTPROTO_RFCOMM,
Expand Down Expand Up @@ -247,7 +297,13 @@
FD_READ as FD_READ,
FD_SETSIZE as FD_SETSIZE,
FD_WRITE as FD_WRITE,
HCI_CHANNEL_CONTROL as HCI_CHANNEL_CONTROL,
HCI_CHANNEL_LOGGING as HCI_CHANNEL_LOGGING,
HCI_CHANNEL_MONITOR as HCI_CHANNEL_MONITOR,
HCI_CHANNEL_RAW as HCI_CHANNEL_RAW,
HCI_CHANNEL_USER as HCI_CHANNEL_USER,
HCI_DATA_DIR as HCI_DATA_DIR,
HCI_DEV_NONE as HCI_DEV_NONE,
HCI_FILTER as HCI_FILTER,
HCI_TIME_STAMP as HCI_TIME_STAMP,
HV_GUID_BROADCAST as HV_GUID_BROADCAST,
Expand Down Expand Up @@ -384,6 +440,13 @@
J1939_PGN_MAX as J1939_PGN_MAX,
J1939_PGN_PDU1_MAX as J1939_PGN_PDU1_MAX,
J1939_PGN_REQUEST as J1939_PGN_REQUEST,
L2CAP_LM as L2CAP_LM,
L2CAP_LM_AUTH as L2CAP_LM_AUTH,
L2CAP_LM_ENCRYPT as L2CAP_LM_ENCRYPT,
L2CAP_LM_MASTER as L2CAP_LM_MASTER,
L2CAP_LM_RELIABLE as L2CAP_LM_RELIABLE,
L2CAP_LM_SECURE as L2CAP_LM_SECURE,
L2CAP_LM_TRUSTED as L2CAP_LM_TRUSTED,
LOCAL_PEERCRED as LOCAL_PEERCRED,
MSG_BCAST as MSG_BCAST,
MSG_CMSG_CLOEXEC as MSG_CMSG_CLOEXEC,
Expand Down Expand Up @@ -510,12 +573,15 @@
SOCK_SEQPACKET as SOCK_SEQPACKET,
SOCK_STREAM as SOCK_STREAM,
SOL_ALG as SOL_ALG,
SOL_BLUETOOTH as SOL_BLUETOOTH,
SOL_CAN_BASE as SOL_CAN_BASE,
SOL_CAN_RAW as SOL_CAN_RAW,
SOL_HCI as SOL_HCI,
SOL_IP as SOL_IP,
SOL_L2CAP as SOL_L2CAP,
SOL_RDS as SOL_RDS,
SOL_RFCOMM as SOL_RFCOMM,
SOL_SCO as SOL_SCO,
SOL_SOCKET as SOL_SOCKET,
SOL_TCP as SOL_TCP,
SOL_TIPC as SOL_TIPC,
Expand Down
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ requests==2.34.2
# via sphinx
roman-numerals==4.1.0 ; python_full_version >= '3.11'
# via sphinx
ruff==0.15.16
ruff==0.15.17
# via -r test-requirements.in
sniffio==1.3.1
# via -r test-requirements.in
Expand Down Expand Up @@ -205,7 +205,7 @@ typing-extensions==4.15.0
# virtualenv
urllib3==2.7.0
# via requests
uv==0.11.19
uv==0.11.21
# via -r test-requirements.in
virtualenv==21.4.2
# via pre-commit
Loading