Python 3.11

This commit is contained in:
f4lco
2022-11-01 22:26:41 +01:00
parent 3dabf375c9
commit c308118e8f
12 changed files with 413 additions and 486 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ orbs:
jobs:
build-and-test:
docker:
- image: cimg/python:3.8
- image: cimg/python:3.11
steps:
- checkout
- run:
+1 -81
View File
@@ -54,86 +54,13 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
invalid-unicode-literal,
raw-checker-failed,
disable=raw-checker-failed,
bad-inline-option,
locally-disabled,
locally-enabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
missing-docstring
# Enable the message, report, category or checker with the given id(s). You can
@@ -329,13 +256,6 @@ max-line-length=100
# Maximum number of lines in a module
max-module-lines=1000
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
+1 -1
View File
@@ -4,7 +4,7 @@ ARG LISTEN_PORT=3080
### Shared base container
FROM python:3.8-alpine as basesys
FROM python:3.11-alpine as basesys
ARG DEPLOY_DIR
ARG USERNAME
+1 -1
View File
@@ -18,4 +18,4 @@ sphinx-autobuild = "*"
sphinx-rtd-theme = "*"
[requires]
python_version = "3.8"
python_version = "3.11"
Generated
+394 -390
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -0,0 +1,4 @@
[pytest]
# Please give me umlauts!
# Escaping gives the impression we made an encoding mistake.
disable_test_id_escaping_and_forfeit_all_rights_to_community_support = True
+1 -1
View File
@@ -42,7 +42,7 @@ def download_menu(menu_params):
'data': False
}
request = requests.post(URL, params=params, json=body)
request = requests.post(URL, params=params, json=body, timeout=30)
# urllib3 does not log response bodies - requests no longer supports it:
# https://2.python-requests.org//en/master/api/#api-changes
+3 -4
View File
@@ -30,14 +30,13 @@ if 'BASE_URL' in os.environ: # pragma: no cover
if base_url.path:
app.config['APPLICATION_ROOT'] = base_url.path
cache = ct.ttl.TTLCache(maxsize=30, ttl=CACHE_TIMEOUT)
cache = ct.TTLCache(maxsize=30, ttl=CACHE_TIMEOUT)
def canteen_not_found(config, canteen_name):
log.warning('Canteen %s not found', canteen_name)
configured = ', '.join("'{}'".format(c) for c in config.keys())
message = "Canteen '{0}' not found, available: {1}".format(canteen_name,
configured)
configured = ', '.join(f"'{c}'" for c in config.keys())
message = f"Canteen '{canteen_name}' not found, available: {configured}"
return make_response(message, 404)
+1 -1
View File
@@ -26,7 +26,7 @@ def api_online_one_shot():
path = os.path.join(os.path.dirname(__file__),
'resources', 'input.json')
with open(path) as api_response:
with open(path, encoding='utf-8') as api_response:
return 200, response_headers, api_response.read()
responses = [
+2 -2
View File
@@ -17,7 +17,7 @@ def _canteen():
def _read_menu(resource_name):
with open(_resource_path(resource_name)) as menu_file:
with open(_resource_path(resource_name), encoding='utf-8') as menu_file:
return json.load(menu_file)
@@ -28,7 +28,7 @@ def _read_feed(resource_name):
def test_meta_consistency():
canteen = _canteen()
menu_feed_url = "canteens/{}/menu".format(canteen.key)
menu_feed_url = f"canteens/{canteen.key}/menu"
actual = feed.render_meta(canteen, menu_feed_url)
+3 -3
View File
@@ -32,14 +32,14 @@ def is_enabled():
requires_online_api = pytest.mark.skipif(
not is_enabled(),
reason='Querying the online API is disabled. '
'Turn on by setting env variable %s.' % ENV_ENABLED
reason="Querying the online API is disabled. "
f"Turn on by setting env variable {ENV_ENABLED}."
)
@requires_online_api
def test_retrieval(canteen):
feed.render_meta(canteen, "/canteens/{}/menu".format(canteen.key))
feed.render_meta(canteen, f"/canteens/{canteen.key}/menu")
params = MenuParams(canteen_id=canteen.id, chash=canteen.chash)
try:
+1 -1
View File
@@ -65,7 +65,7 @@ def _request_check_meals(client):
assert response.status_code == 200
meal = meal_names(response.data)[0]
assert meal == u"Gefüllter Germknödel \nmit Vanillesauce und Mohnzucker"
assert meal == "Gefüllter Germknödel \nmit Vanillesauce und Mohnzucker"
@pytest.fixture