diff --git a/.github/workflows/cibuildwheel.yaml b/.github/workflows/cibuildwheel.yaml index 5e0ba8554..dfbdf1a81 100644 --- a/.github/workflows/cibuildwheel.yaml +++ b/.github/workflows/cibuildwheel.yaml @@ -113,11 +113,9 @@ jobs: - name: musllinux_x86_64 os: ubuntu-latest - name: manylinux_aarch64 - os: ubuntu-latest - emulation: true + os: ubuntu-24.04-arm - name: musllinux_aarch64 - os: ubuntu-latest - emulation: true + os: ubuntu-24.04-arm - name: manylinux_s390x os: ubuntu-latest emulation: true diff --git a/.github/workflows/test-wheels.yaml b/.github/workflows/test-wheels.yaml index 30c866f58..877ac680b 100644 --- a/.github/workflows/test-wheels.yaml +++ b/.github/workflows/test-wheels.yaml @@ -17,8 +17,7 @@ jobs: matrix: platform: - build: "cp313-manylinux_aarch64" - os: ubuntu-latest - emulation: true + os: ubuntu-24.04-arm - build: "cp313-manylinux_s390x" os: ubuntu-latest emulation: true diff --git a/falcon/bench/dj/dj/settings.py b/falcon/bench/dj/dj/settings.py index 15f575007..42b3121a1 100644 --- a/falcon/bench/dj/dj/settings.py +++ b/falcon/bench/dj/dj/settings.py @@ -89,8 +89,7 @@ AUTH_PASSWORD_VALIDATORS = [ { 'NAME': ( - 'django.contrib.auth.password_validation' - '.UserAttributeSimilarityValidator' + 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator' ), }, { diff --git a/falcon/routing/compiled.py b/falcon/routing/compiled.py index 836288780..0efda166a 100644 --- a/falcon/routing/compiled.py +++ b/falcon/routing/compiled.py @@ -405,8 +405,7 @@ def _validate_template_segment(self, segment: str, used_names: Set[str]) -> None if name in used_names: msg_template = ( - 'Field names may not be duplicated ' - '("{0}" was used more than once)' + 'Field names may not be duplicated ("{0}" was used more than once)' ) msg = msg_template.format(name) raise UnacceptableRouteError(msg) diff --git a/falcon/stream.py b/falcon/stream.py index 127c44ffc..5552df450 100644 --- a/falcon/stream.py +++ b/falcon/stream.py @@ -170,8 +170,7 @@ def eof(self) -> bool: @property # NOTE(caselit): Deprecated long ago. Warns since 4.0. @deprecated( - 'Use `eof` instead. ' - '(This compatibility alias will be removed in Falcon 5.0.)', + 'Use `eof` instead. (This compatibility alias will be removed in Falcon 5.0.)', is_property=True, ) def is_exhausted(self) -> bool: diff --git a/falcon/util/mediatypes.py b/falcon/util/mediatypes.py index 8453bfb5b..74b63d44e 100644 --- a/falcon/util/mediatypes.py +++ b/falcon/util/mediatypes.py @@ -146,8 +146,7 @@ class _MediaRange: _NOT_MATCHING = (-1, -1, -1, -1, 0.0) _Q_VALUE_ERROR_MESSAGE = ( - 'If provided, the q parameter must be a real number ' - 'in the range 0 through 1.' + 'If provided, the q parameter must be a real number in the range 0 through 1.' ) @classmethod diff --git a/tests/asgi/test_boundedstream_asgi.py b/tests/asgi/test_boundedstream_asgi.py index 54e16c65f..d35157b2a 100644 --- a/tests/asgi/test_boundedstream_asgi.py +++ b/tests/asgi/test_boundedstream_asgi.py @@ -179,9 +179,9 @@ async def test_iterate_streaming_request(): async def receive(): event = next(events) - assert ( - event['type'] != 'http.disconnect' - ), 'would hang until the client times out' + assert event['type'] != 'http.disconnect', ( + 'would hang until the client times out' + ) return event s = asgi.BoundedStream(receive) diff --git a/tests/test_buffered_reader.py b/tests/test_buffered_reader.py index 247676cb8..8da183173 100644 --- a/tests/test_buffered_reader.py +++ b/tests/test_buffered_reader.py @@ -289,10 +289,7 @@ def test_exhaust(shorter_stream): def test_readline(): source = ( - b'Hello, world!\n' - b'A line.\n' - b'\n' - b'A longer line... \n' + b'SPAM ' * 7 + b'\n' + b'\n' + b'Hello, world!\nA line.\n\nA longer line... \n' + b'SPAM ' * 7 + b'\n' + b'\n' ) stream = BufferedReader(io.BytesIO(source).read, len(source)) diff --git a/tests/test_headers.py b/tests/test_headers.py index 871e08960..2202a099f 100644 --- a/tests/test_headers.py +++ b/tests/test_headers.py @@ -218,10 +218,7 @@ def on_post(self, req, resp): ' Max-Age=600; path=/' ) resp.append_header('Set-Cookie', c1) - c2 = ( - 'partner_source=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT;' - ' Max-Age=0' - ) + c2 = 'partner_source=deleted; expires=Thu, 01-Jan-1970 00:00:01 GMT; Max-Age=0' resp.append_header('seT-cookie', c2) diff --git a/tests/test_middleware.py b/tests/test_middleware.py index 28da56189..590cee21a 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -237,12 +237,12 @@ def test_log_get_request(self, independent_middleware, asgi, util): assert 'start_time' in context assert 'mid_time' in context assert 'end_time' in context - assert ( - context['mid_time'] >= context['start_time'] - ), 'process_resource not executed after request' - assert ( - context['end_time'] >= context['start_time'] - ), 'process_response not executed after request' + assert context['mid_time'] >= context['start_time'], ( + 'process_resource not executed after request' + ) + assert context['end_time'] >= context['start_time'], ( + 'process_response not executed after request' + ) assert context['req_succeeded'] @@ -307,12 +307,12 @@ def test_generate_trans_id_and_time_with_request( assert 'start_time' in context assert 'mid_time' in context assert 'end_time' in context - assert ( - context['mid_time'] >= context['start_time'] - ), 'process_resource not executed after request' - assert ( - context['end_time'] >= context['start_time'] - ), 'process_response not executed after request' + assert context['mid_time'] >= context['start_time'], ( + 'process_resource not executed after request' + ) + assert context['end_time'] >= context['start_time'], ( + 'process_response not executed after request' + ) def test_legacy_middleware_called_with_correct_args(self, asgi, util): global context diff --git a/tests/test_recipes.py b/tests/test_recipes.py index d4c4120ec..e5a039c4b 100644 --- a/tests/test_recipes.py +++ b/tests/test_recipes.py @@ -86,8 +86,7 @@ def on_get(self, req, resp): resp.media = { 'author': 'Grace Hopper', 'quote': ( - "I've always been more interested in " - 'the future than in the past.' + "I've always been more interested in the future than in the past." ), } diff --git a/tests/test_utils.py b/tests/test_utils.py index 14da664f7..2e545f352 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -184,8 +184,7 @@ def test_pack_query_params_one(self): assert falcon.to_query_str({'things': ['a', 'b']}) == '?things=a,b' expected = ( - '?things=a&things=b&things=&things=None' - '&things=true&things=false&things=0' + '?things=a&things=b&things=&things=None&things=true&things=false&things=0' ) actual = falcon.to_query_str( diff --git a/tools/add_contributors.py b/tools/add_contributors.py index a25881a47..842b9c1be 100755 --- a/tools/add_contributors.py +++ b/tools/add_contributors.py @@ -110,9 +110,9 @@ def _update_towncrier_template(template, contributors): contributors = set(contributors) contributors.update(matches[::2]) for separator in matches[1::2]: - assert ( - separator == '' - ), f'unexpected separator between contributor lines: {separator!r}' + assert separator == '', ( + f'unexpected separator between contributor lines: {separator!r}' + ) with open(template, 'w') as template_file: template_file.write(content) diff --git a/tox.ini b/tox.ini index 8cf52b9c1..cbf530f4e 100644 --- a/tox.ini +++ b/tox.ini @@ -253,12 +253,12 @@ commands = {[smoke-test]commands} # -------------------------------------------------------------------- [testenv:pep8] -deps = ruff +deps = ruff>=0.9.2 skip_install = True commands = ruff check [] [testenv:pep8-docstrings] -deps = ruff +deps = ruff>=0.9.2 skip_install = True commands = ruff check \ --exclude=.ecosystem,.eggs,.git,.tox,.venv,build,dist,docs,examples,tests,falcon/bench/nuts \ @@ -266,12 +266,12 @@ commands = ruff check \ [] [testenv:ruff] -deps = ruff>=0.3.7 +deps = ruff>=0.9.2 skip_install = True commands = ruff format --check . [] [testenv:reformat] -deps = ruff>=0.3.7 +deps = ruff>=0.9.2 skip_install = True commands = ruff format . []