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
for reStructured and markdown
Two components:
-
doctest_docutils
module: Same specification asdoctest
, but can parse reStructuredText and markdown -
pytest_doctest_docutils
: Pytest plugin, collects test items for pytest for reStructuredText and markdown filesThis 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/doctest/
Supported styles
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 ```
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
If you install myst-parser, doctest will run on .md files.
$ python -m doctest_docutils README.md -v
pytest plugin
This plugin disables pytest's standard doctest
plugin.
This plugin integrates with the doctest_docutils
module with pytest to enable seamless testing of docs, conftest.py
fixtures and all.
$ 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/
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.8, 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.4.tar.gz
.
File metadata
- Download URL: gp_libs-0.0.4.tar.gz
- Upload date:
- Size: 17.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f643f1c7d450310689b63c2f07f774e499514e6340fea13167da3f1139c6cb2 |
|
MD5 | a3a7dcbfc3677d237e6c3e8e0e6874fe |
|
BLAKE2b-256 | 7801cf77444051dd238a1547b1fa91f93eb55ff0d5b6547afce065fb75fdcbdb |
File details
Details for the file gp_libs-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: gp_libs-0.0.4-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1b23f2eaa3f24d6d07a7302317040bc5b64a402aec47af5cbd3b816efeb6164 |
|
MD5 | 028dc5a8f95e9b7af24945c25a3eadca |
|
BLAKE2b-256 | f1c418793c86c76bdb25372af8c5be63ae4806467ac01e0212519d7f62a63cd1 |