Skip to main content

gp-libs · Python Package License Code Coverage

Incubating / dogfooding some sphinx extensions and pytest plugins on git-pull projects, e.g. cihai, vcs-python, or tmux-python.

doctest for reStructured and markdown

Two components:

  1. doctest_docutils module: Same specification as doctest, but can parse reStructuredText and markdown

  2. pytest_doctest_docutils: Pytest plugin, collects test items for pytest for reStructuredText and markdown files

    This means you can do:

    $ pytest docs
    

doctest module

This extends standard library doctest to support anything docutils can parse. It can parse reStructuredText (.rst) and markdown (.md).

See more: https://gp-libs.git-pull.com/modules/doctest_docutils/

Supported styles

It supports two barebones directives:

  • docutils' doctest_block

    >>> 2 + 2
    4
    
  • .. doctest:: directive

    reStructuredText:

    .. doctest::
    
       >>> 2 + 2
       4
    

    Markdown:

    ```{doctest}
    >>> 2 + 2
    4
    ```
    

Usage

The doctest_docutils module preserves standard library's usage conventions:

reStructuredText
$ python -m doctest_docutils README.rst -v

That's what doctest does by design.

Markdown

Markdown files run through myst-parser, which is installed with gp-libs.

$ python -m doctest_docutils README.md -v

pytest plugin

This plugin disables pytest's standard doctest plugin.

This plugin integrates doctest_docutils with pytest so documentation examples run with the surrounding conftest.py setup.

$ pytest docs/

Like the above module, it supports docutils' own doctest_block and a basic .. doctest:: directive.

See more: https://gp-libs.git-pull.com/modules/pytest_doctest_docutils/

sphinx plugins

Plain-text issue linker (linkify-issues)

We need to parse plain text, e.g. #99999, to point to the project tracker at https://github.com/git-pull/gp-libs/issues/99999. This way the markdown looks good anywhere you render it, including GitHub and GitLab.

Configuration

In your conf.py:

  1. Add 'linkify_issues' to extensions

    extensions = [
        # ...
        "linkify_issues",
    ]
    
  2. Configure your issue URL, issue_url_tpl:

    # linkify_issues
    issue_url_tpl = 'https://github.com/git-pull/gp-libs/issues/{issue_id}'
    

    The config variable is formatted via str.format() where issue_id is 42 if the text is #42.

See more: https://gp-libs.git-pull.com/modules/linkify_issues/

Install

$ pip install --user gp-libs

Developmental releases

You can test the unpublished version of g before its released.

  • pip:

    $ pip install --user --upgrade --pre gp-libs
    

Minimum requirements

To lift the development burden of supporting legacy APIs, as this package is lightly used, minimum constraints have been pinned:

  • docutils: 0.20.1+
  • myst-parser: 2.0.0+

If you have even passing interested in supporting legacy versions, file an issue on the tracker.

More information

Docs Build Status

Release files for gp-libs 0.0.19

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

Source distribution (sdist)

Source distribution for gp-libs 0.0.19
File Size Uploaded
gp_libs-0.0.19.tar.gz 16.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gp-libs 0.0.19
File Interpreter ABI Platform
gp_libs-0.0.19-py3-none-any.whl Python 3 none any Details

Total release size: 32.7 kB

Release files / gp_libs-0.0.19.tar.gz

Download URL gp_libs-0.0.19.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
26fa76740dcfcc37b071903572b3fb3bfc71d2b545e07e7e63977838a3b2393e
BLAKE2b-256 checksum
How to use checksums
54e3947c93526c57541d7876b3c0177372220a904b4d8fa4024c54a47506a1c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / gp_libs-0.0.19-py3-none-any.whl

Download URL gp_libs-0.0.19-py3-none-any.whl
Size 16.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f79c3cf4a7f646b26784c599fa39919257df7add43fc004e602777adc0e59f1e
BLAKE2b-256 checksum
How to use checksums
6e62f5ad23c155267d145c96ba3485f638956b818f32ba03c7ad3fc31236c01c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.19 This release

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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