Skip to content

Commit 4f58a5e

Browse files
authored
Return back mac x86_64 wheels (#1029)
* Chore: fix asserts formatting * Return back mac x86_64 wheels
1 parent 199537b commit 4f58a5e

File tree

3 files changed

+71
-17
lines changed

3 files changed

+71
-17
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
# If you wish to specify custom queries, you can do so here or in a config file.
3838
# By default, queries listed here will override any specified in a config file.
3939
# Prefix the list here with "+" to use these queries and those in the config file.
40-
40+
4141
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
4242
queries: +security-and-quality
4343

44-
44+
4545
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
4646
# If this step fails, then you should remove it and run the build manually (see below)
4747
- name: Autobuild
@@ -50,7 +50,7 @@ jobs:
5050
# ℹ️ Command-line programs to run using the OS shell.
5151
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
5252

53-
# If the Autobuild fails above, remove it and uncomment the following three lines.
53+
# If the Autobuild fails above, remove it and uncomment the following three lines.
5454
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
5555

5656
# - run: |

.github/workflows/publish.yml

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ jobs:
3535
strategy:
3636
fail-fast: false
3737
matrix:
38-
# Available runner images:
39-
# https://github.com/actions/runner-images#available-images
40-
os: [ubuntu-latest, macos-latest, windows-latest]
41-
arch: [auto]
4238
include:
39+
# Available runner images:
40+
# https://github.com/actions/runner-images#available-images
41+
- os: ubuntu-latest
42+
arch: x86_64
4343
- os: ubuntu-latest
4444
arch: aarch64
45+
- os: macos-13
46+
arch: x86_64
47+
- os: macos-latest
48+
arch: arm64
49+
- os: windows-latest
50+
arch: amd64
4551
steps:
4652
- uses: actions/checkout@v2
4753
- uses: actions/setup-python@v2
@@ -116,6 +122,49 @@ jobs:
116122
shell: bash
117123

118124
test-wheels-mac:
125+
needs: [package-source, package-wheel]
126+
runs-on: macos-13
127+
128+
strategy:
129+
matrix:
130+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
131+
include:
132+
- python: "3.8"
133+
aiokafka_whl: dist/aiokafka-*-cp38-cp38-macosx_*_x86_64.whl
134+
- python: "3.9"
135+
aiokafka_whl: dist/aiokafka-*-cp39-cp39-macosx_*_x86_64.whl
136+
- python: "3.10"
137+
aiokafka_whl: dist/aiokafka-*-cp310-cp310-macosx_*_x86_64.whl
138+
- python: "3.11"
139+
aiokafka_whl: dist/aiokafka-*-cp311-cp311-macosx_*_x86_64.whl
140+
- python: "3.12"
141+
aiokafka_whl: dist/aiokafka-*-cp312-cp312-macosx_*_x86_64.whl
142+
143+
steps:
144+
- uses: actions/checkout@v2
145+
- name: Download distributions
146+
uses: actions/download-artifact@v2
147+
with:
148+
name: dist
149+
path: dist/
150+
- name: Set up Python
151+
uses: actions/setup-python@v2
152+
with:
153+
python-version: ${{ matrix.python }}
154+
155+
- name: Install python dependencies
156+
run: |
157+
pip install --upgrade pip setuptools wheel
158+
pip install -r requirements-ci.txt
159+
pip install ${{ matrix.aiokafka_whl }}
160+
161+
- name: Run Unit Tests
162+
run: |
163+
# Remove source code to be sure we use wheel code
164+
rm -rf aiokafka
165+
make ci-test-unit
166+
167+
test-wheels-arm64-mac:
119168
needs: [package-source, package-wheel]
120169
runs-on: macos-latest
121170

@@ -255,7 +304,12 @@ jobs:
255304
deploy:
256305

257306
runs-on: ubuntu-latest
258-
needs: [test-wheels-linux, test-wheels-aarch64-linux, test-wheels-mac, test-wheels-windows]
307+
needs:
308+
- test-wheels-linux
309+
- test-wheels-aarch64-linux
310+
- test-wheels-mac
311+
- test-wheels-arm64-mac
312+
- test-wheels-windows
259313

260314
steps:
261315
- uses: actions/checkout@v2

aiokafka/producer/producer.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -352,13 +352,13 @@ async def start(self):
352352
await self.client.bootstrap()
353353

354354
if self._compression_type == "lz4":
355-
assert (
356-
self.client.api_version >= (0, 8, 2) # fmt: skip
357-
), "LZ4 Requires >= Kafka 0.8.2 Brokers"
355+
assert self.client.api_version >= (0, 8, 2), (
356+
"LZ4 Requires >= Kafka 0.8.2 Brokers"
357+
) # fmt: skip
358358
elif self._compression_type == "zstd":
359-
assert (
360-
self.client.api_version >= (2, 1, 0) # fmt: skip
361-
), "Zstd Requires >= Kafka 2.1.0 Brokers"
359+
assert self.client.api_version >= (2, 1, 0), (
360+
"Zstd Requires >= Kafka 2.1.0 Brokers"
361+
) # fmt: skip
362362

363363
if self._txn_manager is not None and self.client.api_version < (0, 11):
364364
raise UnsupportedVersionError(
@@ -490,9 +490,9 @@ async def send(
490490
from being sent, but cancelling the :meth:`send` coroutine itself
491491
**will**.
492492
"""
493-
assert (
494-
value is not None or self.client.api_version >= (0, 8, 1) # fmt: skip
495-
), "Null messages require kafka >= 0.8.1"
493+
assert value is not None or self.client.api_version >= (0, 8, 1), (
494+
"Null messages require kafka >= 0.8.1"
495+
) # fmt: skip
496496
assert not (value is None and key is None), "Need at least one: key or value"
497497

498498
# first make sure the metadata for the topic is available

0 commit comments

Comments
 (0)