From 18c3db4d6efe5474db29d688b788a6e3a78c79f0 Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 18 Apr 2023 19:34:20 +0200 Subject: [PATCH 1/2] ci: update python images --- .gitlab-ci.yml | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ebcc24eb..6b039321 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,14 +12,14 @@ mypy: - pip3 install mypy - mypy slixmpp -test: +test-3.7: stage: test tags: - docker - image: ubuntu:latest + image: python:3.7 script: - - apt update - - apt install -y python3 python3-pip cython3 gpg + - apt-get update + - apt-get install -y python3 python3-pip cython3 gpg - pip3 install emoji aiohttp cryptography - ./run_tests.py @@ -30,7 +30,7 @@ test-3.10: image: python:3.10 script: - apt update - - apt install -y python3 python3-pip cython3 gpg + - apt-get install -y python3 python3-pip cython3 gpg - pip3 install emoji aiohttp cryptography - ./run_tests.py @@ -38,11 +38,22 @@ test-3.11: stage: test tags: - docker - image: python:3.11-rc + image: python:3.11 + script: + - apt-get update + - apt-get install -y python3 python3-pip cython3 gpg + - pip3 install emoji aiohttp cryptography + - ./run_tests.py + +test-3.12: + stage: test + tags: + - docker + image: python:3.12-rc allow_failure: true script: - - apt update - - apt install -y python3 python3-pip cython3 gpg + - apt-get update + - apt-get install -y python3 python3-pip cython3 gpg - pip3 install emoji aiohttp cryptography - ./run_tests.py @@ -50,14 +61,14 @@ test_integration: stage: test tags: - docker - image: ubuntu:latest + image: python:3 only: variables: - $CI_ACCOUNT1 - $CI_ACCOUNT2 script: - - apt update - - apt install -y python3 python3-pip cython3 gpg + - apt-get update + - apt-get install -y python3 python3-pip cython3 gpg - pip3 install emoji aiohttp aiodns - ./run_integration_tests.py From 2d02ef9bcb84cb077d1151c3d92f18f94609f36e Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 18 Apr 2023 19:34:51 +0200 Subject: [PATCH 2/2] exceptions: Fix python 3.7 compatibility --- slixmpp/exceptions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/slixmpp/exceptions.py b/slixmpp/exceptions.py index a1a56a14..526f4502 100644 --- a/slixmpp/exceptions.py +++ b/slixmpp/exceptions.py @@ -5,7 +5,7 @@ # :copyright: (c) 2011 Nathanael C. Fritz # :license: MIT, see LICENSE for more details -from typing import Optional +from typing import Dict, Optional from .types import ErrorConditions, ErrorTypes, JidStr @@ -122,7 +122,7 @@ class PresenceError(XMPPError): self.presence = pres -_DEFAULT_ERROR_TYPES: dict[ErrorConditions, ErrorTypes] = { +_DEFAULT_ERROR_TYPES: Dict[ErrorConditions, ErrorTypes] = { "bad-request": "modify", "conflict": "cancel", "feature-not-implemented": "cancel", @@ -145,4 +145,4 @@ _DEFAULT_ERROR_TYPES: dict[ErrorConditions, ErrorTypes] = { "subscription-required": "auth", "undefined-condition": "cancel", "unexpected-request": "modify", -} \ No newline at end of file +}