Commit Graph

43 Commits

Author SHA1 Message Date
Jacob Alexander
6aa1849da6 Update docs and docs ci job to use uv 2026-07-02 23:48:12 -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
88fe25372d ci: deploy docs to gh-pages on tagged releases
Trigger the Docs workflow on version tags (v*) and add a deploy job
that publishes the built Sphinx HTML to the gh-pages branch using
peaceiris/actions-gh-pages. PRs and branch pushes still build (and
now upload an artifact) but do not deploy.
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
Jacob Alexander
d62ba169c9 Update GitHub Actions per deprecation notice
Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.

Node.js 12 actions are deprecated. Please update the following actions to use Node.js 16: docker/setup-qemu-action@v1. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
2023-01-27 14:18:27 -08:00
Matt Sachtler
01c4469e08 Add Python 3.11 to Github Actions builds (#306)
* Add Python3.11 to the Github Actions, in the manylinux2014 build as well as the
packaging test.

I added a second image, x86_64, to the manylinux2014 build matrix - the i686
build didn't immediately pass, so I left it out.

* Move the bundled capnproto library forward to 0.10.3.

* Remove the 2010 build entirely, and update the 2014 build to include i686.
2023-01-26 16:28:21 -08:00
Madhava Jay
f45a9d0331 Fixing issue with m1 build (#297)
* Fixing issue with m1 build

- prevent earlier build step from running on arm64
- forced clean up of bundled dir
- adding --force-bundled-libcapnp to trigger a rebuild
- echoing out env variables and showing final wheel size

* Disable tests on Apple Silicon cross compile
2022-09-09 22:14:23 -07:00
Madhava Jay
7862d2a0c4 Added macos arm64 Apple Silicon to CI (#296)
* Added macos arm64 Apple Silicon to CI

- Added missing python 3.10 metadata to setup.py

* Need all python versions in the matrix

* Fixing github action matrix syntax

* Changing MACOSX_DEPLOYMENT_TARGET for older python versions

- Technically no one would be running python 3.7 on M1 anyway

* Adding windows visualcpp build tools and updated cmake

* Increase max-parallel for all matrix builds

* yaml indent

* trying visualstudio2022-workload-vctools

* disabled everything but windows and added tunshell for debugging

* try older powershell

* trying again

* try python instead of powershell

* bash with wget

* Using old windows client on other side

* wrong way

* backwards

* :(

* urgh back to caveman debugging

- trying older windows runners

* try it again with extra build tools

* Reverting back to windows-2019 runner for windows builds

Fixing error:
CMake Error at CMakeLists.txt:2 (project):
  Generator
    Ninja
  does not support platform specification, but platform
    x64
  was specified.
2022-08-26 08:13:09 -07:00
Madhava Jay
9c4f80ad21 Fixed linting issues
- re-enabled lint checks
2022-05-24 11:42:53 +10:00
Madhava Jay
ea70dac5cb Fixed black issues
- Disabled flake8 checks from blocking CI
- Added python 3.10 to packaging and manylinux
2022-04-06 13:32:52 +10:00
Jacob Alexander
6e7fffd7de Applying black formatting
- Fixing flake8 configuration to agree with black
- Adding black validation check to github actions
2021-10-01 11:12:21 -07:00
odidev
c952d42e92 Add linux aarch64 wheel build support
Signed-off-by: odidev <odidev@puresoftware.com>
2021-08-25 10:49:01 +00:00
John Vandenberg
2850b3792d packagingtest.yml: Prevent bare except
Fixes https://github.com/capnproto/pycapnp/issues/254
2021-06-01 16:31:14 +08:00
John Vandenberg
8c15feb4eb Remove many lint warnings
Mostly whitespace changes, with max-line-length set to 120
and double-quotes used, adopting black settings.

Related to https://github.com/capnproto/pycapnp/issues/128
2021-05-03 17:02:30 +08:00
Jacob Alexander
a4ef16e831 Fixing flake8 linting errors
- Enabling builds to fail on simple lint failures now
2020-11-20 23:38:13 -08:00
Jacob Alexander
b16f35b977 Adding Python 3.9 build 2020-11-03 21:39:21 -08:00
Jacob Alexander
5e8ccba536 Updating docs for v1.0.0b2
- Full cleanup of all the docs
- General sphinx housekeeping
- Updated all the old/bad links
- More reliable tests
- Updated Changelog
- Removed dead/deprecated code
- Added documentation generation test
2020-06-14 17:05:45 -07:00
Jacob Alexander
255119b838 Updating to capnproto v0.8.0
- Includes some test stabilization
- Fixes manylinux2010 build issues (linker flag order due to old gcc)
- More rigorous python setup.py clean
- Requires capnproto v0.8.0 or greater
- Including system libcapnp include path for import (e.g. import
  stream_capnp)
- Bundle libcapnp .capnp files when not using system libcapnp
- Removing more distutils usage. Now using pkg-config to determine the
  system version of libcapnp (mainly for Linux, but should work on macOS
  with brew)
- Removed dead code

Resolves issues #215 #216 #217
Lots of fixes for Issue #218 (all sorts of retry methods needed for
GitHub Actions)
2020-06-08 11:49:17 -07:00
Jacob Alexander
e0d3618aa6 Updating to checkout@v2
- Fixes some rebuild issues with GitHub Actions
2020-03-01 16:25:03 -08:00
Jacob Alexander
ea0858352b Didn't package the modified wheels correctly 2019-12-27 01:48:13 -08:00
Jacob Alexander
90b25b43dc Adjusting linux_ tag to manylinux2010_ tag
- Done as a post-processing step using auditwheel
2019-12-27 01:03:55 -08:00
Jacob Alexander
01e4d3ed2f Removing pypandoc/pandoc requirement
- Was not working well on manylinux2010 build image
- Not necessary, can use markdown directly now
2019-12-26 23:52:10 -08:00
Jacob Alexander
cca14902e1 Move artifact step so that they are uploaded even after test failure
- Useful when debugging failures
2019-12-26 20:29:53 -08:00
Jacob Alexander
032b14ed45 Adding artifact upload support for builds
- Including both bdist_wheel and sdist
- Adding pandoc dependencies
2019-12-26 19:55:22 -08:00
Jacob Alexander
6cd971e74f Adding manylinux2010 github action
- Validates that the manylinux2010 environment can build pycapnp
- Handle lib and lib64 cases
- Has patch for aligned_alloc symbol (not available prior to glibc 2.16)
https://github.com/capnproto/capnproto/issues/743
- Fixes #197
- Should be ready to prepare a v1.0.0b1 release
2019-12-21 00:13:04 -08:00
Jacob Alexander
f9647aa9a7 Give github action a better name 2019-12-11 22:25:08 -08:00
Jacob Alexander
b101017377 Enabling Python 3.8 tests 2019-11-27 00:25:44 -08:00
Jacob Alexander
8062e6f401 Adding Windows 32-bit and 64-bit builds
- Basic tests are working
- May need some adjustments to get all tests working
- Cleaned up bundling to take Python arch into account when building
with multiple architectures
2019-10-17 00:36:46 -07:00
Jacob Alexander
063522d308 Adding Windows compilation support
- Automatically determining build arch from running Python shell
  * Should work across all platforms
2019-10-15 18:39:47 -07:00
Jacob Alexander
67d5276936 Defaulting to built-in capnproto
- Adding code to detect if bundled capnproto is already built
2019-10-15 09:35:55 -07:00
Jacob Alexander
8361fa8597 Currently asyncio examples require Python 3.7+
- It should be possible to port asyncio examples to at least Python 3.6
  * However, in my quick 10 minute attempt it wasn't as smooth as I'd
  hoped
2019-09-29 23:54:49 -07:00
Jacob Alexander
58a5c5fc1f Initial pythonpackage.yml for GitHub Actions 2019-09-27 01:52:41 -07:00