Python 3.11
This commit is contained in:
@@ -6,7 +6,7 @@ orbs:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/python:3.8
|
- image: cimg/python:3.11
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
|
|||||||
@@ -54,86 +54,13 @@ confidence=
|
|||||||
# --enable=similarities". If you want to run only the classes checker, but have
|
# --enable=similarities". If you want to run only the classes checker, but have
|
||||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||||
# --disable=W"
|
# --disable=W"
|
||||||
disable=print-statement,
|
disable=raw-checker-failed,
|
||||||
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,
|
|
||||||
bad-inline-option,
|
bad-inline-option,
|
||||||
locally-disabled,
|
locally-disabled,
|
||||||
locally-enabled,
|
|
||||||
file-ignored,
|
file-ignored,
|
||||||
suppressed-message,
|
suppressed-message,
|
||||||
useless-suppression,
|
useless-suppression,
|
||||||
deprecated-pragma,
|
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
|
missing-docstring
|
||||||
|
|
||||||
# Enable the message, report, category or checker with the given id(s). You can
|
# 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
|
# Maximum number of lines in a module
|
||||||
max-module-lines=1000
|
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
|
# Allow the body of a class to be on the same line as the declaration if body
|
||||||
# contains single statement.
|
# contains single statement.
|
||||||
single-line-class-stmt=no
|
single-line-class-stmt=no
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ ARG LISTEN_PORT=3080
|
|||||||
|
|
||||||
|
|
||||||
### Shared base container
|
### Shared base container
|
||||||
FROM python:3.8-alpine as basesys
|
FROM python:3.11-alpine as basesys
|
||||||
ARG DEPLOY_DIR
|
ARG DEPLOY_DIR
|
||||||
ARG USERNAME
|
ARG USERNAME
|
||||||
|
|
||||||
|
|||||||
@@ -18,4 +18,4 @@ sphinx-autobuild = "*"
|
|||||||
sphinx-rtd-theme = "*"
|
sphinx-rtd-theme = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.8"
|
python_version = "3.11"
|
||||||
|
|||||||
Generated
+394
-390
File diff suppressed because it is too large
Load Diff
@@ -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
|
||||||
@@ -42,7 +42,7 @@ def download_menu(menu_params):
|
|||||||
'data': False
|
'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:
|
# urllib3 does not log response bodies - requests no longer supports it:
|
||||||
# https://2.python-requests.org//en/master/api/#api-changes
|
# https://2.python-requests.org//en/master/api/#api-changes
|
||||||
|
|||||||
@@ -30,14 +30,13 @@ if 'BASE_URL' in os.environ: # pragma: no cover
|
|||||||
if base_url.path:
|
if base_url.path:
|
||||||
app.config['APPLICATION_ROOT'] = 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):
|
def canteen_not_found(config, canteen_name):
|
||||||
log.warning('Canteen %s not found', canteen_name)
|
log.warning('Canteen %s not found', canteen_name)
|
||||||
configured = ', '.join("'{}'".format(c) for c in config.keys())
|
configured = ', '.join(f"'{c}'" for c in config.keys())
|
||||||
message = "Canteen '{0}' not found, available: {1}".format(canteen_name,
|
message = f"Canteen '{canteen_name}' not found, available: {configured}"
|
||||||
configured)
|
|
||||||
return make_response(message, 404)
|
return make_response(message, 404)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ def api_online_one_shot():
|
|||||||
path = os.path.join(os.path.dirname(__file__),
|
path = os.path.join(os.path.dirname(__file__),
|
||||||
'resources', 'input.json')
|
'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()
|
return 200, response_headers, api_response.read()
|
||||||
|
|
||||||
responses = [
|
responses = [
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def _canteen():
|
|||||||
|
|
||||||
|
|
||||||
def _read_menu(resource_name):
|
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)
|
return json.load(menu_file)
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ def _read_feed(resource_name):
|
|||||||
|
|
||||||
def test_meta_consistency():
|
def test_meta_consistency():
|
||||||
canteen = _canteen()
|
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)
|
actual = feed.render_meta(canteen, menu_feed_url)
|
||||||
|
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ def is_enabled():
|
|||||||
|
|
||||||
requires_online_api = pytest.mark.skipif(
|
requires_online_api = pytest.mark.skipif(
|
||||||
not is_enabled(),
|
not is_enabled(),
|
||||||
reason='Querying the online API is disabled. '
|
reason="Querying the online API is disabled. "
|
||||||
'Turn on by setting env variable %s.' % ENV_ENABLED
|
f"Turn on by setting env variable {ENV_ENABLED}."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@requires_online_api
|
@requires_online_api
|
||||||
def test_retrieval(canteen):
|
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)
|
params = MenuParams(canteen_id=canteen.id, chash=canteen.chash)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
+1
-1
@@ -65,7 +65,7 @@ def _request_check_meals(client):
|
|||||||
|
|
||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
meal = meal_names(response.data)[0]
|
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
|
@pytest.fixture
|
||||||
|
|||||||
Reference in New Issue
Block a user