Internal utilities for projects following git-pull python package spec
Project description
gp-libs ·
Incubating / dogfooding some sphinx extensions and pytest plugins on git-pull projects, e.g. cihai, vcs-python, or tmux-python.
doctest helpers (for docutils)
Two parts:
- doctest module: Same specification as doctest, but can parse reStructuredText and markdown
- pytest plugin: Collects pytest for reStructuredText and markdown files
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/doctest/
Writing doctests
It supports two barebones directives:
-
docutils'
doctest_block
>>> 2 + 2 4
-
.. doctest::
directivereStructuredText:
.. doctest:: >>> 2 + 2 4
Markdown (requires myst-parser):
```{doctest} >>> 2 + 2 4 ```
Test your docs
reStructuredText
$ python -m doctest_docutils README.rst -v
That's what doctest
does by design.
Markdown
If you install myst-parser, doctest will run on .md files.
$ python -m doctest_docutils README.md -v
pytest plugin
This plugin integrates with the above module.
$ 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/doctest/pytest.html
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:
-
Add
'linkify_issues'
toextensions
extensions = [ # ... "linkify_issues", ]
-
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 {meth}
str.format
whereissue_id
is42
if the text is #42.
See more: https://gp-libs.git-pull.com/linkify_issues/
Table of contents for autodoc
sphinx.ext.autodoc
doesn't link objects in the table of contents. So we need a
plugin to help.
See more: https://gp-libs.git-pull.com/sphinx_toctree_signature/
Configuration
-
Add
'sphinx_toctree_signature'
toextensions
extensions = [ # ... "sphinx_toctree_signature", ]
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
More information
- Python support: >= 3.7, pypy
- Source: https://github.com/git-pull/gp-libs
- Docs: https://gp-libs.git-pull.com
- Changelog: https://gp-libs.git-pull.com/history.html
- Issues: https://github.com/git-pull/gp-libs/issues
- Test Coverage: https://codecov.io/gh/git-pull/gp-libs
- pypi: https://pypi-hypernode.com/pypi/gp-libs
- License: MIT.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gp-libs-0.0.1a4.tar.gz
.
File metadata
- Download URL: gp-libs-0.0.1a4.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e3886e13d38a54366241d61e6dc672a087a8239626830e11a3897eaddc9d9f |
|
MD5 | 4b019068282c99a42090432f91fffc19 |
|
BLAKE2b-256 | 51bab35b5b6a762fbf8ca483becc37d82541505caa9873acdc7d716f5850f613 |
File details
Details for the file gp_libs-0.0.1a4-py3-none-any.whl
.
File metadata
- Download URL: gp_libs-0.0.1a4-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 223c5a1da1548438d0467547c5a5ea9cf462b05b6dcd0ddf0715da055c1de860 |
|
MD5 | 2b189ba929693069dae4dc477fb91545 |
|
BLAKE2b-256 | e0ba517950873dde681db28a2329882d42d17b563de38d4d3953007f1ef516a3 |