lektorlib


Namelektorlib JSON
Version 1.2.1 PyPI version JSON
download
home_page
SummaryA few bits which are potentially useful to developers of Lektor plugins
upload_time2023-06-15 17:39:04
maintainer
docs_urlNone
author
requires_python>=3.7
licenseCopyright © 2020 Geoffrey T. Dairiki Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords lektor utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Lektorlib

[![PyPI version](https://img.shields.io/pypi/v/lektorlib.svg)](https://pypi.org/project/lektorlib/)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/lektorlib.svg)](https://pypi.python.org/pypi/lektorlib/)
[![GitHub license](https://img.shields.io/github/license/dairiki/lektorlib)](https://github.com/dairiki/lektorlib/blob/master/LICENSE)
[![GitHub Actions (Tests)](https://github.com/dairiki/lektorlib/workflows/Tests/badge.svg)](https://github.com/dairiki/lektorlib)
[![Trackgit Views](https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/lhaqecdxux7krt01vbsl)](https://trackgit.com)

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>

[Lektor]: <https://www.getlektor.com/> "Lektor Static Content Management System"

## 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.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lektorlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "Lektor utilities",
    "author": "",
    "author_email": "Jeff Dairiki <dairiki@dairiki.org>",
    "download_url": "https://files.pythonhosted.org/packages/76/61/2926e7615173fe8b93f5404781e903c1ef20f84b327c36cbc439097be80d/lektorlib-1.2.1.tar.gz",
    "platform": null,
    "description": "# Lektorlib\n\n[![PyPI version](https://img.shields.io/pypi/v/lektorlib.svg)](https://pypi.org/project/lektorlib/)\n[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/lektorlib.svg)](https://pypi.python.org/pypi/lektorlib/)\n[![GitHub license](https://img.shields.io/github/license/dairiki/lektorlib)](https://github.com/dairiki/lektorlib/blob/master/LICENSE)\n[![GitHub Actions (Tests)](https://github.com/dairiki/lektorlib/workflows/Tests/badge.svg)](https://github.com/dairiki/lektorlib)\n[![Trackgit Views](https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/lhaqecdxux7krt01vbsl)](https://trackgit.com)\n\nA few bits which may possibly be useful to developers of [Lektor][] plugins.\n\n## Bits Included\n\n### `lektorlib.query.PrecomputedQuery`\n\nA subclass of `lektor.db.Query` which yields a pre-computed\nsequence of children.\n\nThis is useful in (at least) two circumstances:\n\nFirst, when the children to be queried are virtual source objects,\nthe standard `lektor.db.Query` will not work.  This version will.\n\nSecond, when we would like to generate a query of a pre-computed\nsubset of a resource's children, this prevents intruducing\nunnecessary build dependencies.  If we used a standard query with\na filter applied, it still iterates over all of the parent node\u2019s\nchildren, registering dependencies on all of them.\n\n### `lektorlib.context.disable_dependency_recording`\n\nA python context manager which (temporarily) disables lektor\u2019s\ndependency recording system.\n\n### `lektorlib.recordcache.get_or_create_virtual`\n\nThis function is a helper to streamline the caching of virtual\nsource objects in the lektor record cache.\n\n`Lektor.db.Pad.get()` handles caching for regular records.\nAt present, however, it does not appear that it ever caches\nvirtual source objects, even though its record cache is perfectly\ncapable of doing so.\n\n### `lektorlib.testing.assert_no_dependencies(match=None)`\n\nThis context manager is a testing helper which can be used to\ncheck that no dependencies are recorded with lektor\u2019s dependency\ntracking system.\n\n## Author\n\nJeff Dairiki <dairiki@dairiki.org>\n\n[Lektor]: <https://www.getlektor.com/> \"Lektor Static Content Management System\"\n\n## Changelog\n\n### Release 1.2.1 (2023-06-15)\n\n#### Type Annotations\n\n- Narrow the return type of `lektorlib.recordcache.get_or_create_virtual`.\n- Convert `lektorlib.query.PrecomputedQuery` to a generic type.\n\n### Release 1.2.0 (2023-06-02)\n\n- Added type annotations\n- Use PDM instead of setuptools to build distribution\n- Configured pre-commit\n- Run black and reorder-python-imports on the code\n\n### Release 1.1.0 (2023-04-20)\n\nFixes for Lektor 3.4 (in pre-release).\n\nWe now test under Lektor 3.3 and Lektor 3.4 (pre-release).\n\n### Release 1.0 (2022-01-28)\n\nDrop support for python < 3.7. Test under python 3.10.\n\n### Release 0.1 (2021-02-05)\n\nNo code changes.\n\nRelease is now classified as \"production/stable\".\n\n### Release 0.1a1 (2020-05-05)\n\nInitial release.\n",
    "bugtrack_url": null,
    "license": "Copyright \u00a9 2020 Geoffrey T. Dairiki\n        \n        Permission is hereby granted, free of charge, to any person obtaining\n        a copy of this software and associated documentation files (the\n        \"Software\"), to deal in the Software without restriction, including\n        without limitation the rights to use, copy, modify, merge, publish,\n        distribute, sublicense, and/or sell copies of the Software, and to\n        permit persons to whom the Software is furnished to do so, subject to\n        the following conditions:\n        \n        The above copyright notice and this permission notice shall be\n        included in all copies or substantial portions of the Software.\n        \n        THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n        LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n        OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n        WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A few bits which are potentially useful to developers of Lektor plugins",
    "version": "1.2.1",
    "project_urls": {
        "Home": "https://github.com/dairiki/lektorlib"
    },
    "split_keywords": [
        "lektor",
        "utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "721a3803ff7ac5580833ae176f24129adaa02fea2d0c4ea48943e8c7e36e3386",
                "md5": "a63c6a427e8fe1f787aa804340d51752",
                "sha256": "450a60a8778698c8515ab5d35f4d7fd097649420cf669357abf8a89c6a2be19e"
            },
            "downloads": -1,
            "filename": "lektorlib-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a63c6a427e8fe1f787aa804340d51752",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 8472,
            "upload_time": "2023-06-15T17:39:03",
            "upload_time_iso_8601": "2023-06-15T17:39:03.482374Z",
            "url": "https://files.pythonhosted.org/packages/72/1a/3803ff7ac5580833ae176f24129adaa02fea2d0c4ea48943e8c7e36e3386/lektorlib-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "76612926e7615173fe8b93f5404781e903c1ef20f84b327c36cbc439097be80d",
                "md5": "ed00ca2272e4b411287fcd8e0b384f13",
                "sha256": "1286a9d4818f8ca9bfa9a3e70a7cbd271c9f919dbee48eb3b4a3d123401d749f"
            },
            "downloads": -1,
            "filename": "lektorlib-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ed00ca2272e4b411287fcd8e0b384f13",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 14282,
            "upload_time": "2023-06-15T17:39:04",
            "upload_time_iso_8601": "2023-06-15T17:39:04.750377Z",
            "url": "https://files.pythonhosted.org/packages/76/61/2926e7615173fe8b93f5404781e903c1ef20f84b327c36cbc439097be80d/lektorlib-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-15 17:39:04",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dairiki",
    "github_project": "lektorlib",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "lektorlib"
}
        
Elapsed time: 0.07868s