pyBearings
Bearings, the Free Pascal HTTP/1.1 server, as a WSGI server for Python. Linux only: x86_64, and ARM64 as an experimental target (the ARM64 wheel has run under qemu, not on ARM64 hardware yet); free-threaded Python works.
from bearings import serve
serve(app, port=8000) # until SIGINT or SIGTERM
The event loops are Bearings' own threads and never run Python. Every request runs the WSGI app on a thread of the worker pool, so the app may block.
Server(app, **options) starts and stops a server from code (tests, a process that does other things): start(), port, stop(grace), wait(), metrics(), or with Server(app) as server:. Its docstring lists the options: the address, a Unix socket or an inherited socket, the number of event loops and workers, a queue limit answered with 503, a connection limit, the access log and the metrics.
With websocket=, a WebSocketHandler, the server also accepts WebSockets on ws_path: its opened, received and closed run on the worker pool, one event at a time per connection, and ws_send, ws_close, subscribe, unsubscribe and publish reach the connections by id, from any thread. A publish goes to every subscriber of a topic, encoded once.
With raw=True, the server calls app(head, input, listener) instead of a WSGI app. head is the request head as Bearings sends it (the method, path, query, version, client address and port, then a name and a value per header, each followed by "\0"), input is the body and listener says where the server listens. The app returns (status, headers, body). A framework that builds its own request object saves building an environ only to take it apart again. RawHandler describes the arguments.
The package loads libbearings.so (src/capi/ in this repository) with cffi in ABI mode, so it needs no C compiler: building the wheel needs Free Pascal 3.2.2 (fpc), which hatch_build.py runs.
Development
uv sync --python 3.14t # compiles libbearings.so into src/bearings/
uv run pytest
Wheels
uv build --wheel builds the wheel for this machine's CPU (manylinux_2_34_x86_64 here).
The manylinux tag is the newest glibc symbol version libbearings.so needs, read with objdump -T (binutils).
For ARM64, give it the cross compiler of tools/get-cross-aarch64.sh; the wheel is tagged for the CPU that compiler targets:
PYBEARINGS_FPC=../build/tools/bin/fpc-aarch64 uv build --wheel # manylinux_2_34_aarch64
uv build also builds the sdist, which holds the Pascal sources of ../src/ in pascal/, and builds the wheel from it.
Installing from the sdist needs Free Pascal 3.2.2 and binutils.
./test-aarch64.sh does that, installs the wheel in a free-threaded CPython
for ARM64 run under qemu-user, and runs the tests against it. qemu-user runs
on the host's memory model, which is stronger than ARM's: it shows that the
wheel builds, loads and works, not races that only ARM hardware has.
Metadata
Release files for pybearings 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pybearings-0.5.0.tar.gz | 282.0 kB | Without provenance | Details for pybearings-0.5.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pybearings-0.5.0-py3-none-manylinux_2_34_x86_64.whl | Python 3 | none | Linux glibc 2.34+ x86-64 | Details for pybearings-0.5.0-py3-none-manylinux_2_34_x86_64.whl |
| pybearings-0.5.0-py3-none-manylinux_2_34_aarch64.whl | Python 3 | none | Linux glibc 2.34+ ARM64 | Details for pybearings-0.5.0-py3-none-manylinux_2_34_aarch64.whl |
Total release size: 1.5 MB
Release files / pybearings-0.5.0.tar.gz
| Download URL | pybearings-0.5.0.tar.gz |
|---|---|
| Size | 282.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7a1ac8b8db7f3e49a1b326e50bd29fc57d8de22794de832c6e28432d3bd360b
|
|
BLAKE2b-256 checksum How to use checksums |
b350a026d950f5929c19d0147ab1985849c00398552b4e55a767b5846a750ef8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pybearings-0.5.0-py3-none-manylinux_2_34_x86_64.whl
| Download URL | pybearings-0.5.0-py3-none-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 612.5 kB |
| Tags | Linux glibc 2.34+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
be99d722d82df66352e5a7668da67a851af21afb88e13f47b5d1f57ae5932caf
|
|
BLAKE2b-256 checksum How to use checksums |
b229201c67b3fa97ef2e2f56c9be15b48e83a46377e4f50548b3bc0415fdbddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / pybearings-0.5.0-py3-none-manylinux_2_34_aarch64.whl
| Download URL | pybearings-0.5.0-py3-none-manylinux_2_34_aarch64.whl |
|---|---|
| Size | 607.7 kB |
| Tags | Linux glibc 2.34+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
2a49190b8136671290796fe19bb4a61643b3ba361f85b11532871c9b752334da
|
|
BLAKE2b-256 checksum How to use checksums |
4dc90dc96cce0402cd52f9d95231a30ceddf969e1473d9ddf55d0403c3a5d87a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for pybearings 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.