Commit Graph

14 Commits

Author SHA1 Message Date
Trey Moen
8d80f4d69e ci: pin ruff to the latest passing release (#408)
* ci: pin ruff to the passing baseline

* ci: use the latest passing ruff release

* ci: share the ruff pin through a lint dependency group

* ci: note follow-up to update lint and unpin ruff
2026-09-21 17:25:17 -07:00
Jacob Alexander
6f70b8d737 ci: build libcapnp for the target arch on macOS
The macos-15 runner is arm64. Previously, cp38 was the first Python in
the cibuildwheel matrix, and because the cp38 macOS installer is
x86_64-only, cibuildwheel ran the build under \`arch -x86_64\`, which
also caused CMake to build libcapnp as x86_64. Subsequent Python
versions then reused that cached x86_64 libcapnp.

After dropping cp38, cp39 is built first and CMake auto-detects the
host arch (arm64), producing an arm64 libkj/libcapnp. The x86_64 wheel
then silently links via \`-undefined dynamic_lookup\` (the linker just
ignores arm64 archive members) and fails at dlopen time with
"symbol not found in flat namespace ... AsyncIoStream::getsockopt".

Set CMAKE_OSX_ARCHITECTURES to the matrix arch on macOS so libcapnp is
always built for the wheel's target architecture.
2026-05-30 11:59:52 -07:00
Jacob Alexander
9b65eded52 ci: speed up wheel builds, defer exotic arches to release tags
- Build aarch64 wheels on native ubuntu-24.04-arm runners instead of
  QEMU emulation (massive speedup on every push/PR).
- Move ppc64le and s390x QEMU builds into a separate job that only
  runs on refs/tags/v* and skips tests (still extremely slow under
  emulation, but no longer gates regular CI).
- Drop EOL CPython 3.8 builds, which also removes the macOS
  x86_64-only-installer warning.
- Include arch in artifact names to make them easier to identify.
2026-05-30 11:59:52 -07:00
Jacob Alexander
641554808e ci: bump actions to Node 24 runtimes and clean up cibuildwheel config
- Bump actions/upload-artifact to v6, actions/setup-python to v6,
  actions/checkout to v5, and docker/setup-qemu-action to v4 so all
  actions run on Node 24 (Node 20 is deprecated on GitHub runners).
- Bump pypa/cibuildwheel to v3.4.1 so its bundled actions/setup-python
  also runs on Node 24.
- Drop CIBW_SKIP=pp*: PyPy is no longer enabled by default in
  cibuildwheel 3.x, so the selector matched nothing and triggered an
  "Invalid skip selector" warning.
- Add CIBW_TEST_SKIP for cp38 macOS arm64 to silence the cibuildwheel
  warning that the arm64 slice of cp38 universal2 wheels can't be tested
  (the cp38 installer is x86_64-only).
2026-05-30 11:59:52 -07:00
Jacob Alexander
162fddbcf6 Replace black and flake8 with ruff for linting and formatting
- Remove .flake8; add [tool.ruff] and [tool.ruff.format] config in pyproject.toml
  (line-length 120, excludes, ignore list, per-file-ignores, mccabe complexity)
- Update GitHub workflow lint job to run `ruff check .` and `ruff format --check .`
- Swap black and flake8 for ruff in requirements.txt and Pipfile
- Change capnp/__init__.py to ruff-style noqa comment
- Move max-complexity into [tool.ruff.lint.mccabe], lint options into [tool.ruff.lint]
- Add per-file-ignores for capnp/__init__.py (F401, F403, F405), remove inline noqa
- Run ruff format across codebase (24 files) for consistent style
2026-05-30 11:59:52 -07:00
Liam Murphy
aa90ab6844 Fix test failures on Python 3.14 (#394)
* Fix test failures on Python 3.14

As documented at
https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop,
`get_event_loop` now fails if there is no active event loop. Since there
will never already be one at the top level of a file anyway, explicitly
create a new one every time.

* Reformat with black 2026 style
2026-01-26 07:09:49 -08:00
Jacob Alexander
c9541f98b3 Update macOS builds from 13 to 15 (#393)
- See https://github.com/actions/runner-images/issues/13046
- macOS 15 will be the last release that supports intel macs and
  supported until August 2027
2026-01-16 07:30:50 -08:00
Lee J. O'Riordan
ab6b6bca90 modify wildcard to disable free threaded py314 also 2025-09-03 23:17:36 -07:00
Lee J. O'Riordan
19acf378d6 Disable Py3.14 in favour of released Py only 2025-09-03 23:17:36 -07:00
Lee J. O'Riordan
4a70b3ed73 Update wheelbuilding on GH actions 2025-09-03 23:17:36 -07:00
Lasse Blaauwbroek
a89eb0dee6 Upgrade cibuildwheel and surrounding CI infra 2025-05-12 15:54:19 -07:00
Jacob Alexander
313d0d4c6d Prepare for v2.0.0b1 release
- Update CHANGELOG.md
- Update to bundled capnproto-1.0.1
  * Compiles with capnproto-0.8.0 and higher
- *Breaking Change* Remove allow_cancellation (see
  https://capnproto.org/news/2023-07-28-capnproto-1.0.html)
  * This is tricky to handle for older versions of capnproto. Instead of
    dealing with lots of complication, removing it entirely.
- Fix some documentation after the build backend support was added
- Update tox.ini to support 3.8 to 3.12
- Update cibuildwheel to 2.16.1
  * Adds Python 3.12 supports and implicitly deprecates EOL 3.7 (though it's
    still built)
2023-10-03 12:29:48 -07:00
Lasse Blaauwbroek
bc01774ede Add pytest-asyncio to ci 2023-06-08 08:13:28 +02:00
Lasse Blaauwbroek
6d5ee1c6f2 Use cibuildwheel in ci (#309)
* Use cibuildwheel in ci

`cibuildwheel` is a system that automatically compiles and repairs wheels for
many python versions and architectures at once. This has some advantages vs the
old situation:
- Macosx wheels had inconsistent minimum versions ranging between 10.9 and
  11.0. I'm not sure why this happens, but for some users this means they have
  to build from source on macosx. With cibuildwheel, the build is
  consistent, with 10.9 as the minimum for x86 and 11.0 for arm64.
- Consolidation between the packaging tests and manylinux tests.
- Addition of musllinux targets and additional cross-compilation to ppc64le and
s390x.
- With cibuildwheel, new python versions should be automatically picked up.
- Separation of the sdist build and lint checks. There is not reason to run that
  many times.

All possible build targets succeed, except for ARM64 on Windows. The upstream
capnp build fails. I've disabled it.

The cross-compilation builds on linux are pretty slow. This could potentially be
sped up by separating the builds of manylinux and musllinux, but I'm not sure if
it's worth the extra complexity. (One can also contemplate disabling these
targets.)

Tests for macosx arm64 cannot be run (but also couldn't be run in the previous
system. This should be remedied once apple silicon becomes available on the CI.

I've also added some commented-out code that can automatically take care of
uploading a build to PyPi when a release is created. One might contemplate using this.

* Set CMAKE_OSX_ARCHITECTURES for arm64 and disable universal2
2023-04-03 18:55:17 -07:00