Merge branch 'ci-and-python-3.7' into 'master'

Fix CI issues and python 3.7 compatibility

See merge request poezio/slixmpp!244
This commit is contained in:
mathieui 2023-04-18 17:43:21 +00:00
commit 209554e63f
2 changed files with 25 additions and 14 deletions

View File

@ -12,14 +12,14 @@ mypy:
- pip3 install mypy - pip3 install mypy
- mypy slixmpp - mypy slixmpp
test: test-3.7:
stage: test stage: test
tags: tags:
- docker - docker
image: ubuntu:latest image: python:3.7
script: script:
- apt update - apt-get update
- apt install -y python3 python3-pip cython3 gpg - apt-get install -y python3 python3-pip cython3 gpg
- pip3 install emoji aiohttp cryptography - pip3 install emoji aiohttp cryptography
- ./run_tests.py - ./run_tests.py
@ -30,7 +30,7 @@ test-3.10:
image: python:3.10 image: python:3.10
script: script:
- apt update - apt update
- apt install -y python3 python3-pip cython3 gpg - apt-get install -y python3 python3-pip cython3 gpg
- pip3 install emoji aiohttp cryptography - pip3 install emoji aiohttp cryptography
- ./run_tests.py - ./run_tests.py
@ -38,11 +38,22 @@ test-3.11:
stage: test stage: test
tags: tags:
- docker - 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 allow_failure: true
script: script:
- apt update - apt-get update
- apt install -y python3 python3-pip cython3 gpg - apt-get install -y python3 python3-pip cython3 gpg
- pip3 install emoji aiohttp cryptography - pip3 install emoji aiohttp cryptography
- ./run_tests.py - ./run_tests.py
@ -50,14 +61,14 @@ test_integration:
stage: test stage: test
tags: tags:
- docker - docker
image: ubuntu:latest image: python:3
only: only:
variables: variables:
- $CI_ACCOUNT1 - $CI_ACCOUNT1
- $CI_ACCOUNT2 - $CI_ACCOUNT2
script: script:
- apt update - apt-get update
- apt install -y python3 python3-pip cython3 gpg - apt-get install -y python3 python3-pip cython3 gpg
- pip3 install emoji aiohttp aiodns - pip3 install emoji aiohttp aiodns
- ./run_integration_tests.py - ./run_integration_tests.py

View File

@ -5,7 +5,7 @@
# :copyright: (c) 2011 Nathanael C. Fritz # :copyright: (c) 2011 Nathanael C. Fritz
# :license: MIT, see LICENSE for more details # :license: MIT, see LICENSE for more details
from typing import Optional from typing import Dict, Optional
from .types import ErrorConditions, ErrorTypes, JidStr from .types import ErrorConditions, ErrorTypes, JidStr
@ -122,7 +122,7 @@ class PresenceError(XMPPError):
self.presence = pres self.presence = pres
_DEFAULT_ERROR_TYPES: dict[ErrorConditions, ErrorTypes] = { _DEFAULT_ERROR_TYPES: Dict[ErrorConditions, ErrorTypes] = {
"bad-request": "modify", "bad-request": "modify",
"conflict": "cancel", "conflict": "cancel",
"feature-not-implemented": "cancel", "feature-not-implemented": "cancel",
@ -145,4 +145,4 @@ _DEFAULT_ERROR_TYPES: dict[ErrorConditions, ErrorTypes] = {
"subscription-required": "auth", "subscription-required": "auth",
"undefined-condition": "cancel", "undefined-condition": "cancel",
"unexpected-request": "modify", "unexpected-request": "modify",
} }