feat: add support and workarounds for cpython3.11 (#31)
This commit is contained in:
parent
1b5c9e1cb9
commit
b53a4675d7
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -40,6 +40,7 @@ jobs:
|
|||||||
- "3.8"
|
- "3.8"
|
||||||
- "3.9"
|
- "3.9"
|
||||||
- "3.10"
|
- "3.10"
|
||||||
|
- "3.11"
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
extension:
|
extension:
|
||||||
|
|||||||
@ -31,7 +31,13 @@ class MessageFlag(IntFlag):
|
|||||||
ALLOW_INTERACTIVE_AUTHORIZATION = 4
|
ALLOW_INTERACTIVE_AUTHORIZATION = 4
|
||||||
|
|
||||||
|
|
||||||
MESSAGE_FLAG_MAP = {field.value: field for field in MessageFlag}
|
# This is written out because of https://github.com/python/cpython/issues/98976
|
||||||
|
MESSAGE_FLAG_MAP = {
|
||||||
|
0: MessageFlag.NONE,
|
||||||
|
1: MessageFlag.NO_REPLY_EXPECTED,
|
||||||
|
2: MessageFlag.NO_AUTOSTART,
|
||||||
|
4: MessageFlag.ALLOW_INTERACTIVE_AUTHORIZATION,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class NameFlag(IntFlag):
|
class NameFlag(IntFlag):
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
from logging.handlers import QueueHandler
|
from logging.handlers import QueueHandler
|
||||||
from queue import SimpleQueue
|
from queue import SimpleQueue
|
||||||
|
|
||||||
@ -122,6 +123,7 @@ async def test_aio_proxy_object():
|
|||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info[:3][1] in (11,), reason="segfaults on py3.11")
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
def test_glib_proxy_object():
|
def test_glib_proxy_object():
|
||||||
bus_name = "glib.client.test.methods"
|
bus_name = "glib.client.test.methods"
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from dbus_fast import DBusError, Message, aio, glib
|
from dbus_fast import DBusError, Message, aio, glib
|
||||||
@ -94,6 +96,7 @@ async def test_aio_properties():
|
|||||||
bus.disconnect()
|
bus.disconnect()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(sys.version_info[:3][1] in (11,), reason="segfaults on py3.11")
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
def test_glib_properties():
|
def test_glib_properties():
|
||||||
service_bus = glib.MessageBus().connect_sync()
|
service_bus = glib.MessageBus().connect_sync()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from dbus_fast import Message, MessageType, aio, glib
|
from dbus_fast import Message, MessageType, aio, glib
|
||||||
@ -44,6 +46,9 @@ async def test_aio_big_message():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
sys.version_info[:3][1] in (10, 11), reason="segfaults on py3.10,py3.11"
|
||||||
|
)
|
||||||
def test_glib_big_message():
|
def test_glib_big_message():
|
||||||
"this tests that nonblocking reads and writes actually work for glib"
|
"this tests that nonblocking reads and writes actually work for glib"
|
||||||
bus1 = glib.MessageBus().connect_sync()
|
bus1 = glib.MessageBus().connect_sync()
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from dbus_fast import Message, MessageFlag, MessageType
|
from dbus_fast import Message, MessageFlag, MessageType
|
||||||
@ -11,6 +13,7 @@ if has_gi:
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
|
@pytest.mark.skipif(sys.version_info[:3][1] in (11,), reason="segfaults on py3.11")
|
||||||
def test_standard_interfaces():
|
def test_standard_interfaces():
|
||||||
bus = MessageBus().connect_sync()
|
bus = MessageBus().connect_sync()
|
||||||
msg = Message(
|
msg = Message(
|
||||||
@ -51,6 +54,7 @@ def test_standard_interfaces():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
|
@pytest.mark.skipif(sys.version_info[:3][1] in (11,), reason="segfaults on py3.11")
|
||||||
def test_sending_messages_between_buses():
|
def test_sending_messages_between_buses():
|
||||||
bus1 = MessageBus().connect_sync()
|
bus1 = MessageBus().connect_sync()
|
||||||
bus2 = MessageBus().connect_sync()
|
bus2 = MessageBus().connect_sync()
|
||||||
@ -118,6 +122,7 @@ def test_sending_messages_between_buses():
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
|
@pytest.mark.skipif(sys.version_info[:3][1] in (11,), reason="segfaults on py3.11")
|
||||||
def test_sending_signals_between_buses():
|
def test_sending_signals_between_buses():
|
||||||
bus1 = MessageBus().connect_sync()
|
bus1 = MessageBus().connect_sync()
|
||||||
bus2 = MessageBus().connect_sync()
|
bus2 = MessageBus().connect_sync()
|
||||||
|
|||||||
@ -70,7 +70,9 @@ async def test_name_requests():
|
|||||||
bus2.disconnect()
|
bus2.disconnect()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(sys.version_info[:3][1] == 10, reason="segfaults on py3.10")
|
@pytest.mark.skipif(
|
||||||
|
sys.version_info[:3][1] in (10, 11), reason="segfaults on py3.10,py3.11"
|
||||||
|
)
|
||||||
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
@pytest.mark.skipif(not has_gi, reason=skip_reason_no_gi)
|
||||||
def test_request_name_glib():
|
def test_request_name_glib():
|
||||||
test_name = "glib.test.request.name"
|
test_name = "glib.test.request.name"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user