Skip to main content

Greenlet compatibility layer built on tealet

Project description

tealet-greenlet

tealet-greenlet: greenlet compatibility on top of tealet.

tealet-greenlet packages the greenlet-compatible layer separately from the core tealet runtime. The core package provides stack-slicing primitives; this package carries the larger greenlet compatibility surface, including parent/child switching, tracing hooks, context handling, and upstream-style compatibility tests.

Rationale

tealet-greenlet is an experimental replacement library for greenlet based on the tealet engine. It is currently intended as a proof of concept: how much of greenlet's behaviour can we express by keeping the low-level stack engine small, portable, and focused, while putting the greenlet business logic in a separate layer?

That split is the point. tealet benefits from a simple core API and the portability work already done in libtealet and Stackman. tealet-greenlet then adds the compatibility policy on top: parent selection, error translation, context handling, tracing hooks, cleanup behaviour, and test-facing implementation probes.

Future development may keep improving the Python implementation, or move hot paths and tricky compatibility edges into a C-accelerated core if that turns out to be worthwhile. For now, the package gives us a concrete compatibility target without making the core tealet wheel carry all of greenlet's semantic cargo.

Installation

python -m pip install tealet-greenlet

The canonical import is tealet_greenlet:

from tealet_greenlet import greenlet, getcurrent

Need drop-in import greenlet compatibility? Install the shim into sys.modules before importing code that expects upstream greenlet:

import tealet_greenlet

tealet_greenlet.install()

import greenlet

For transition from the old in-core location, tealet.greenlet remains as a thin wrapper when this package is installed.

Status

tealet-greenlet is pre-1.0 software. It is useful for experimentation, tracking compatibility, and testing the architecture, but it does not claim full upstream greenlet parity yet.

Documentation

The historical 2014-era greenlet_legacy.py shim is kept under tests/ as a comparison fixture. It is not part of the installable package API.

Tests

Run the package-local tests from the repository root:

uv run --active python -m pytest packages/tealet-greenlet/tests -q

The upstream compatibility tests are opt-in:

PYTEALET_RUN_UPSTREAM_GREENLET_TESTS=1 \
  uv run --active python -m pytest packages/tealet-greenlet/tests/compat_greenlet -q

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tealet_greenlet-0.1.0rc1.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tealet_greenlet-0.1.0rc1-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file tealet_greenlet-0.1.0rc1.tar.gz.

File metadata

  • Download URL: tealet_greenlet-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tealet_greenlet-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 e39b2ad79a78993cde91e535a9b5e4a9d8f5c0873f94c6c517e0ee71668f705d
MD5 1eb7ae6000417fa1d62a74733ae17d12
BLAKE2b-256 7591584d996570391a32bc06f69e23e24cd6085468793b253253f93990cfdc16

See more details on using hashes here.

Provenance

The following attestation bundles were made for tealet_greenlet-0.1.0rc1.tar.gz:

Publisher: tealet-greenlet-release-publish.yml on kristjanvalur/pytealet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tealet_greenlet-0.1.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for tealet_greenlet-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 bb4a335cb61b608158221fcfbaafc3720a3fc2776dc20374a94ebf9a293b995a
MD5 1ca80d89efdfe481225f76c73b0545ef
BLAKE2b-256 0cc65d43dc6bae2e4c9d59dc18c00fd4aa9a0d9fdb829b7439cfbfead05b4acc

See more details on using hashes here.

Provenance

The following attestation bundles were made for tealet_greenlet-0.1.0rc1-py3-none-any.whl:

Publisher: tealet-greenlet-release-publish.yml on kristjanvalur/pytealet

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page