Skip to main content

Lektorlib

PyPI version PyPI Supported Python Versions GitHub license GitHub Actions (Tests) Trackgit Views

A few bits which may possibly be useful to developers of Lektor plugins.

Bits Included

lektorlib.query.PrecomputedQuery

A subclass of lektor.db.Query which yields a pre-computed sequence of children.

This is useful in (at least) two circumstances:

First, when the children to be queried are virtual source objects, the standard lektor.db.Query will not work. This version will.

Second, when we would like to generate a query of a pre-computed subset of a resource's children, this prevents intruducing unnecessary build dependencies. If we used a standard query with a filter applied, it still iterates over all of the parent node’s children, registering dependencies on all of them.

lektorlib.context.disable_dependency_recording

A python context manager which (temporarily) disables lektor’s dependency recording system.

lektorlib.recordcache.get_or_create_virtual

This function is a helper to streamline the caching of virtual source objects in the lektor record cache.

Lektor.db.Pad.get() handles caching for regular records. At present, however, it does not appear that it ever caches virtual source objects, even though its record cache is perfectly capable of doing so.

lektorlib.testing.assert_no_dependencies(match=None)

This context manager is a testing helper which can be used to check that no dependencies are recorded with lektor’s dependency tracking system.

Author

Jeff Dairiki dairiki@dairiki.org

Changelog

Release 1.2.1 (2023-06-15)

Type Annotations

  • Narrow the return type of lektorlib.recordcache.get_or_create_virtual.
  • Convert lektorlib.query.PrecomputedQuery to a generic type.

Release 1.2.0 (2023-06-02)

  • Added type annotations
  • Use PDM instead of setuptools to build distribution
  • Configured pre-commit
  • Run black and reorder-python-imports on the code

Release 1.1.0 (2023-04-20)

Fixes for Lektor 3.4 (in pre-release).

We now test under Lektor 3.3 and Lektor 3.4 (pre-release).

Release 1.0 (2022-01-28)

Drop support for python < 3.7. Test under python 3.10.

Release 0.1 (2021-02-05)

No code changes.

Release is now classified as "production/stable".

Release 0.1a1 (2020-05-05)

Initial release.

Metadata

Release files for lektorlib 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lektorlib 1.2.1
File Size Uploaded
lektorlib-1.2.1.tar.gz 14.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lektorlib 1.2.1
File Interpreter ABI Platform
lektorlib-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / lektorlib-1.2.1.tar.gz

Download URL lektorlib-1.2.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1286a9d4818f8ca9bfa9a3e70a7cbd271c9f919dbee48eb3b4a3d123401d749f
BLAKE2b-256 checksum
How to use checksums
76612926e7615173fe8b93f5404781e903c1ef20f84b327c36cbc439097be80d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.7.4 CPython/3.10.6

Release files / lektorlib-1.2.1-py3-none-any.whl

Download URL lektorlib-1.2.1-py3-none-any.whl
Size 8.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
450a60a8778698c8515ab5d35f4d7fd097649420cf669357abf8a89c6a2be19e
BLAKE2b-256 checksum
How to use checksums
721a3803ff7ac5580833ae176f24129adaa02fea2d0c4ea48943e8c7e36e3386
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via pdm/2.7.4 CPython/3.10.6

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page