Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): use Linux arm64 hosted runners #2429

Merged
merged 2 commits into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/cibuildwheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test-wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions falcon/bench/dj/dj/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': (
'django.contrib.auth.password_validation'
'.UserAttributeSimilarityValidator'
'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'
),
},
{
Expand Down
3 changes: 1 addition & 2 deletions falcon/routing/compiled.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions falcon/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions falcon/util/mediatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/asgi/test_boundedstream_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions tests/test_buffered_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
5 changes: 1 addition & 4 deletions tests/test_headers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
24 changes: 12 additions & 12 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']

Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/test_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
),
}

Expand Down
3 changes: 1 addition & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions tools/add_contributors.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -253,25 +253,25 @@ 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 \
--select=D205,D212,D400,D401,D403,D404 \
[]

[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 . []
Expand Down
Loading