markdown-exec 1.10.0__tar.gz → 1.10.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/CHANGELOG.md +12 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/PKG-INFO +3 -3
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/README.md +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/gallery.md +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/insiders/index.md +4 -2
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/insiders/installation.md +4 -4
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/usage/index.md +9 -9
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/usage/pyodide.md +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/usage/shell.md +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/usage/tree.md +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/duties.py +4 -7
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/pyproject.toml +20 -24
- markdown_exec-1.10.1/scripts/get_version.py +27 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/scripts/insiders.py +1 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/scripts/make.py +3 -5
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/pyodide.css +6 -1
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_base_formatter.py +3 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/CODE_OF_CONDUCT.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/CONTRIBUTING.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/LICENSE +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/coverage.ini +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/git-changelog.toml +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/mypy.ini +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/pytest.ini +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/ruff.toml +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/vscode/launch.json +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/vscode/settings.json +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/config/vscode/tasks.json +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/.overrides/main.html +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/.overrides/partials/comments.html +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/changelog.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/code_of_conduct.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/contributing.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/credits.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/css/insiders.css +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/css/material.css +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/css/mkdocstrings.css +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/index.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/insiders/changelog.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/insiders/goals.yml +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/js/feedback.js +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/js/insiders.js +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/license.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/schema.json +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/ansi.sh +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/argparse.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/argparse_format.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/chalk.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/d2.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/diagrams.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/drawsvg.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/expandable_filetree.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/hyperbolic.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/matplotlib.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/plotly.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/pydeps.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/pytermgui.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/qrcode.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/rich.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/rich_terminal.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/runpy.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/gallery/textual.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/boolean_matrix.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/hide.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/multiple.pycon +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/platform_html.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/platform_md.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/source.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/snippets/usage/source.pycon +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/docs/usage/python.md +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/mkdocs.yml +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/scripts/gen_credits.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/scripts/gen_ref_nav.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/scripts/make +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/__init__.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/ansi.css +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/debug.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/__init__.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/_exec_python.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/base.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/bash.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/console.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/markdown.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/pycon.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/pyodide.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/python.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/sh.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/formatters/tree.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/logger.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/mkdocs_plugin.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/processors.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/py.typed +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/pyodide.js +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/src/markdown_exec/rendering.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/__init__.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/conftest.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_converter.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_headings.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_python.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_shell.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_toc.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_tree.py +0 -0
- {markdown_exec-1.10.0 → markdown_exec-1.10.1}/tests/test_validator.py +0 -0
@@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
<!-- insertion marker -->
|
8
|
+
## [1.10.1](https://github.com/pawamoy/markdown-exec/releases/tag/1.10.1) - 2025-03-11
|
9
|
+
|
10
|
+
<small>[Compare with 1.10.0](https://github.com/pawamoy/markdown-exec/compare/1.10.0...1.10.1)</small>
|
11
|
+
|
12
|
+
### Build
|
13
|
+
|
14
|
+
- Add lower bound to pygments-ansi-color extra ([a8e17c9](https://github.com/pawamoy/markdown-exec/commit/a8e17c9cd1bf9ba8ab5008a83c77a0b1208a1b25) by Timothée Mazzucotelli).
|
15
|
+
|
16
|
+
### Bug Fixes
|
17
|
+
|
18
|
+
- Fix emoji display in pyodide fence for themes other than Material ([e09e9b2](https://github.com/pawamoy/markdown-exec/commit/e09e9b2005f9fe0599db7bc9f053e7227b824a6a) by Timothée Mazzucotelli). [Issue-83](https://github.com/pawamoy/markdown-exec/issues/83), [PR-84](https://github.com/pawamoy/markdown-exec/pull/84)
|
19
|
+
|
8
20
|
## [1.10.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.10.0) - 2024-12-06
|
9
21
|
|
10
22
|
<small>[Compare with 1.9.3](https://github.com/pawamoy/markdown-exec/compare/1.9.3...1.10.0)</small>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: markdown-exec
|
3
|
-
Version: 1.10.
|
3
|
+
Version: 1.10.1
|
4
4
|
Summary: Utilities to execute code blocks in Markdown files.
|
5
5
|
Keywords: markdown,python,exec,shell,bash,mkdocs
|
6
6
|
Author-Email: =?utf-8?q?Timoth=C3=A9e_Mazzucotelli?= <dev@pawamoy.fr>
|
@@ -31,7 +31,7 @@ Project-URL: Funding, https://github.com/sponsors/pawamoy
|
|
31
31
|
Requires-Python: >=3.9
|
32
32
|
Requires-Dist: pymdown-extensions>=9
|
33
33
|
Provides-Extra: ansi
|
34
|
-
Requires-Dist: pygments-ansi-color; extra == "ansi"
|
34
|
+
Requires-Dist: pygments-ansi-color>=0.3; extra == "ansi"
|
35
35
|
Description-Content-Type: text/markdown
|
36
36
|
|
37
37
|
# Markdown Exec
|
@@ -49,7 +49,7 @@ and this HTML is injected in place of the code block.
|
|
49
49
|
## Installation
|
50
50
|
|
51
51
|
```bash
|
52
|
-
pip install markdown-exec[ansi]
|
52
|
+
pip install "markdown-exec[ansi]"
|
53
53
|
```
|
54
54
|
|
55
55
|
The `ansi` extra provides the necessary bits (`pygments-ansi-color` and a CSS file)
|
@@ -21,7 +21,7 @@ Welcome to our gallery of examples!
|
|
21
21
|
|
22
22
|
### with [D2](https://d2lang.com/)
|
23
23
|
|
24
|
-
> A modern diagram scripting language that turns text to diagrams.
|
24
|
+
> A modern diagram scripting language that turns text to diagrams.
|
25
25
|
|
26
26
|
````md exec="1" source="tabbed-right"
|
27
27
|
```python exec="true" html="true"
|
@@ -88,6 +88,8 @@ else:
|
|
88
88
|
```
|
89
89
|
<!-- blacken-docs:on -->
|
90
90
|
|
91
|
+
Additionally, your sponsorship will give more weight to your upvotes on issues, helping us prioritize work items in our backlog. For more information on how we prioritize work, see this page: [Backlog management](https://pawamoy.github.io/backlog/).
|
92
|
+
|
91
93
|
## How to become a sponsor
|
92
94
|
|
93
95
|
Thanks for your interest in sponsoring! In order to become an eligible sponsor
|
@@ -156,7 +158,7 @@ You can cancel your sponsorship anytime.[^5]
|
|
156
158
|
|
157
159
|
The following section lists all funding goals. Each goal contains a list of
|
158
160
|
features prefixed with a checkmark symbol, denoting whether a feature is
|
159
|
-
:octicons-check-circle-fill-24:{ style="color: #00e676" } already available or
|
161
|
+
:octicons-check-circle-fill-24:{ style="color: #00e676" } already available or
|
160
162
|
:octicons-check-circle-fill-24:{ style="color: var(--md-default-fg-color--lightest)" } planned,
|
161
163
|
but not yet implemented. When the funding goal is hit,
|
162
164
|
the features are released for general availability.
|
@@ -216,7 +218,7 @@ by the [ISC License][license]. However, we kindly ask you to respect our
|
|
216
218
|
|
217
219
|
- Please **don't distribute the source code** of Insiders. You may freely use
|
218
220
|
it for public, private or commercial projects, privately fork or mirror it,
|
219
|
-
but please don't make the source code public, as it would counteract the
|
221
|
+
but please don't make the source code public, as it would counteract the
|
220
222
|
sponsorware strategy.
|
221
223
|
|
222
224
|
- If you cancel your subscription, you're automatically removed as a
|
@@ -42,21 +42,21 @@ Or using HTTPS:
|
|
42
42
|
pip install git+https://${GH_TOKEN}@github.com/pawamoy-insiders/markdown-exec.git
|
43
43
|
```
|
44
44
|
|
45
|
-
>? NOTE: **How to get a GitHub personal access token**
|
45
|
+
>? NOTE: **How to get a GitHub personal access token**
|
46
46
|
> The `GH_TOKEN` environment variable is a GitHub token.
|
47
47
|
> It can be obtained by creating a [personal access token] for
|
48
48
|
> your GitHub account. It will give you access to the Insiders repository,
|
49
49
|
> programmatically, from the command line or GitHub Actions workflows:
|
50
|
-
>
|
50
|
+
>
|
51
51
|
> 1. Go to https://github.com/settings/tokens
|
52
52
|
> 2. Click on [Generate a new token]
|
53
53
|
> 3. Enter a name and select the [`repo`][scopes] scope
|
54
54
|
> 4. Generate the token and store it in a safe place
|
55
|
-
>
|
55
|
+
>
|
56
56
|
> [personal access token]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
|
57
57
|
> [Generate a new token]: https://github.com/settings/tokens/new
|
58
58
|
> [scopes]: https://docs.github.com/en/developers/apps/scopes-for-oauth-apps#available-scopes
|
59
|
-
>
|
59
|
+
>
|
60
60
|
> Note that the personal access
|
61
61
|
> token must be kept secret at all times, as it allows the owner to access your
|
62
62
|
> private repositories.
|
@@ -171,7 +171,7 @@ with one of the following values:
|
|
171
171
|
```
|
172
172
|
````
|
173
173
|
|
174
|
-
NOTE: **Important
|
174
|
+
NOTE: **Important:**
|
175
175
|
The `material-block` source option requires that you enable the [`md_in_html`][md_in_html] Markdown extension.
|
176
176
|
|
177
177
|
---
|
@@ -184,7 +184,7 @@ The `material-block` source option requires that you enable the [`md_in_html`][m
|
|
184
184
|
```
|
185
185
|
````
|
186
186
|
|
187
|
-
NOTE: **Important
|
187
|
+
NOTE: **Important:**
|
188
188
|
The `tabbed-left` source option requires that you enable the [`pymdownx.tabbed`][pymdownx.tabbed] Markdown extension.
|
189
189
|
|
190
190
|
---
|
@@ -197,7 +197,7 @@ The `tabbed-left` source option requires that you enable the [`pymdownx.tabbed`]
|
|
197
197
|
```
|
198
198
|
````
|
199
199
|
|
200
|
-
NOTE: **Important
|
200
|
+
NOTE: **Important:**
|
201
201
|
The `tabbed-left` source option requires that you enable the [`pymdownx.tabbed`][pymdownx.tabbed] Markdown extension.
|
202
202
|
|
203
203
|
---
|
@@ -258,7 +258,7 @@ and the "Result" tab title second. It allows to switch from tabbed-left
|
|
258
258
|
to tabbed-right and inversely without having to switch the titles as well.
|
259
259
|
|
260
260
|
|
261
|
-
WARNING: **Limitation
|
261
|
+
WARNING: **Limitation:**
|
262
262
|
Changing the title for only one tab is not supported.
|
263
263
|
|
264
264
|
## Wrap result in a code block
|
@@ -271,7 +271,7 @@ $ cat .git/config
|
|
271
271
|
```
|
272
272
|
````
|
273
273
|
|
274
|
-
WARNING: **Limitation
|
274
|
+
WARNING: **Limitation:**
|
275
275
|
Wrapping the result is not possible when HTML output is enabled.
|
276
276
|
|
277
277
|
## Change the console width
|
@@ -380,7 +380,7 @@ assert 1 + 1 == 11
|
|
380
380
|
WARNING - markdown_exec: Execution of python code block 'print hello' exited with errors
|
381
381
|
```
|
382
382
|
|
383
|
-
> TIP: **Titles act as IDs as well!**
|
383
|
+
> TIP: **Titles act as IDs as well!**
|
384
384
|
> You *don't need* to provide an ID
|
385
385
|
> if you already set a (Material for MkDocs) title:
|
386
386
|
>
|
@@ -413,7 +413,7 @@ greet("Ping")
|
|
413
413
|
```
|
414
414
|
````
|
415
415
|
|
416
|
-
WARNING: **Limitation
|
416
|
+
WARNING: **Limitation:**
|
417
417
|
Sessions only work with Python and Pycon syntax for now.
|
418
418
|
|
419
419
|
## Literate Markdown
|
@@ -435,9 +435,9 @@ That makes for a very meta-markdown markup:
|
|
435
435
|
```
|
436
436
|
````
|
437
437
|
|
438
|
-
> TIP: **So power, such meta
|
438
|
+
> TIP: **So power, such meta.**
|
439
439
|
> The above example (both tabs) was entirely generated using *a literate code block in a literate code block* 🤯:
|
440
|
-
>
|
440
|
+
>
|
441
441
|
> `````md
|
442
442
|
> ````md exec="1" source="tabbed-left"
|
443
443
|
> ```md exec="1" source="material-block" title="Markdown link"
|
@@ -360,7 +360,7 @@ so we cannot provide generic guidance here.
|
|
360
360
|
> when using our MkDocs plugin and enabling ANSI support,
|
361
361
|
> to help tools like MkDocs and its `get-deps` command
|
362
362
|
> know that the `ansi` extra dependency is required.
|
363
|
-
>
|
363
|
+
>
|
364
364
|
> ```yaml
|
365
365
|
> plugins:
|
366
366
|
> - markdown-exec:
|
@@ -45,10 +45,6 @@ def material_insiders() -> Iterator[bool]: # noqa: D103
|
|
45
45
|
yield False
|
46
46
|
|
47
47
|
|
48
|
-
below_314 = sys.version_info < (3, 14)
|
49
|
-
skip_docs_reason = pyprefix("Building docs is not supported on Python 3.14, skipping")
|
50
|
-
|
51
|
-
|
52
48
|
@duty
|
53
49
|
def changelog(ctx: Context, bump: str = "") -> None:
|
54
50
|
"""Update the changelog in-place with latest commits.
|
@@ -73,7 +69,7 @@ def check_quality(ctx: Context) -> None:
|
|
73
69
|
)
|
74
70
|
|
75
71
|
|
76
|
-
@duty(skip_if=
|
72
|
+
@duty(skip_if=sys.version_info[:2] != (3, 12), skip_reason="Docs build only on Python 3.12")
|
77
73
|
def check_docs(ctx: Context) -> None:
|
78
74
|
"""Check if the documentation builds correctly."""
|
79
75
|
Path("htmlcov").mkdir(parents=True, exist_ok=True)
|
@@ -88,6 +84,7 @@ def check_docs(ctx: Context) -> None:
|
|
88
84
|
@duty
|
89
85
|
def check_types(ctx: Context) -> None:
|
90
86
|
"""Check that the code is correctly typed."""
|
87
|
+
os.environ["FORCE_COLOR"] = "1"
|
91
88
|
ctx.run(
|
92
89
|
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
|
93
90
|
title=pyprefix("Type-checking"),
|
@@ -104,7 +101,7 @@ def check_api(ctx: Context, *cli_args: str) -> None:
|
|
104
101
|
)
|
105
102
|
|
106
103
|
|
107
|
-
@duty
|
104
|
+
@duty
|
108
105
|
def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000) -> None:
|
109
106
|
"""Serve the documentation (localhost:8000).
|
110
107
|
|
@@ -120,7 +117,7 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
|
|
120
117
|
)
|
121
118
|
|
122
119
|
|
123
|
-
@duty
|
120
|
+
@duty
|
124
121
|
def docs_deploy(ctx: Context, *, force: bool = False) -> None:
|
125
122
|
"""Deploy the documentation to GitHub pages.
|
126
123
|
|
@@ -41,14 +41,14 @@ classifiers = [
|
|
41
41
|
dependencies = [
|
42
42
|
"pymdown-extensions>=9",
|
43
43
|
]
|
44
|
-
version = "1.10.
|
44
|
+
version = "1.10.1"
|
45
45
|
|
46
46
|
[project.license]
|
47
47
|
text = "ISC"
|
48
48
|
|
49
49
|
[project.optional-dependencies]
|
50
50
|
ansi = [
|
51
|
-
"pygments-ansi-color",
|
51
|
+
"pygments-ansi-color>=0.3",
|
52
52
|
]
|
53
53
|
|
54
54
|
[project.urls]
|
@@ -65,11 +65,10 @@ Funding = "https://github.com/sponsors/pawamoy"
|
|
65
65
|
markdown-exec = "markdown_exec.mkdocs_plugin:MarkdownExecPlugin"
|
66
66
|
|
67
67
|
[tool.pdm.version]
|
68
|
-
source = "
|
68
|
+
source = "call"
|
69
|
+
getter = "scripts.get_version:get_version"
|
69
70
|
|
70
71
|
[tool.pdm.build]
|
71
|
-
package-dir = "src"
|
72
|
-
editable-backend = "editables"
|
73
72
|
excludes = [
|
74
73
|
"**/.pytest_cache",
|
75
74
|
]
|
@@ -92,7 +91,6 @@ data = [
|
|
92
91
|
|
93
92
|
[dependency-groups]
|
94
93
|
dev = [
|
95
|
-
"editables>=0.5",
|
96
94
|
"build>=1.2",
|
97
95
|
"git-changelog>=2.5",
|
98
96
|
"twine>=5.1",
|
@@ -107,7 +105,6 @@ dev = [
|
|
107
105
|
"types-pyyaml>=6.0",
|
108
106
|
"black>=24.4",
|
109
107
|
"markdown-callouts>=0.4",
|
110
|
-
"markdown-exec>=1.8",
|
111
108
|
"mkdocs>=1.6",
|
112
109
|
"mkdocs-coverage>=1.0",
|
113
110
|
"mkdocs-gen-files>=0.5",
|
@@ -117,21 +114,20 @@ dev = [
|
|
117
114
|
"mkdocs-minify-plugin>=0.8",
|
118
115
|
"mkdocstrings[python]>=0.25",
|
119
116
|
"tomli>=2.0; python_version < '3.11'",
|
120
|
-
"pydeps>=
|
121
|
-
"diagrams>=0.
|
122
|
-
"rich>=
|
123
|
-
"matplotlib>=3.
|
124
|
-
"numpy>=1
|
125
|
-
"
|
126
|
-
"
|
127
|
-
"
|
128
|
-
"
|
129
|
-
"
|
130
|
-
"
|
131
|
-
"
|
132
|
-
"
|
133
|
-
"
|
134
|
-
"
|
135
|
-
"
|
136
|
-
"chalk-diagrams>=0.2; python_version < '3.14'",
|
117
|
+
"pydeps>=3.0; python_version == '3.12'",
|
118
|
+
"diagrams>=0.24.1; python_version == '3.12'",
|
119
|
+
"rich>=13.9; python_version == '3.12'",
|
120
|
+
"matplotlib>=3.9; python_version == '3.12'",
|
121
|
+
"numpy>=2.1; python_version == '3.12'",
|
122
|
+
"textual>=1.0; python_version == '3.12'",
|
123
|
+
"pytermgui>=7.7; python_version == '3.12'",
|
124
|
+
"pipdeptree>=2.25; python_version == '3.12'",
|
125
|
+
"pip>=25; python_version == '3.12'",
|
126
|
+
"pygments>=2.19; python_version == '3.12'",
|
127
|
+
"drawsvg>=2.4; python_version == '3.12'",
|
128
|
+
"hyperbolic>=2.0; python_version == '3.12'",
|
129
|
+
"qrcode>=8.0; python_version == '3.12'",
|
130
|
+
"plotly>=6.0; python_version == '3.12'",
|
131
|
+
"pandas>=2.2; python_version == '3.12'",
|
132
|
+
"chalk-diagrams>=0.2.2; python_version == '3.12'",
|
137
133
|
]
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"""Get current project version from Git tags or changelog."""
|
2
|
+
|
3
|
+
import re
|
4
|
+
from contextlib import suppress
|
5
|
+
from pathlib import Path
|
6
|
+
|
7
|
+
from pdm.backend.hooks.version import SCMVersion, Version, default_version_formatter, get_version_from_scm
|
8
|
+
|
9
|
+
_root = Path(__file__).parent.parent
|
10
|
+
_changelog = _root / "CHANGELOG.md"
|
11
|
+
_changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
|
12
|
+
_default_scm_version = SCMVersion(Version("0.0.0"), None, False, None, None) # noqa: FBT003
|
13
|
+
|
14
|
+
|
15
|
+
def get_version() -> str:
|
16
|
+
"""Get current project version from Git tags or changelog."""
|
17
|
+
scm_version = get_version_from_scm(_root) or _default_scm_version
|
18
|
+
if scm_version.version <= Version("0.1"): # Missing Git tags?
|
19
|
+
with suppress(OSError, StopIteration): # noqa: SIM117
|
20
|
+
with _changelog.open("r", encoding="utf8") as file:
|
21
|
+
match = next(filter(None, map(_changelog_version_re.match, file)))
|
22
|
+
scm_version = scm_version._replace(version=Version(match.group(1)))
|
23
|
+
return default_version_formatter(scm_version)
|
24
|
+
|
25
|
+
|
26
|
+
if __name__ == "__main__":
|
27
|
+
print(get_version())
|
@@ -26,7 +26,7 @@ logger = logging.getLogger(f"mkdocs.logs.{__name__}")
|
|
26
26
|
def human_readable_amount(amount: int) -> str: # noqa: D103
|
27
27
|
str_amount = str(amount)
|
28
28
|
if len(str_amount) >= 4: # noqa: PLR2004
|
29
|
-
return f"{str_amount[:len(str_amount)-3]},{str_amount[-3:]}"
|
29
|
+
return f"{str_amount[: len(str_amount) - 3]},{str_amount[-3:]}"
|
30
30
|
return str_amount
|
31
31
|
|
32
32
|
|
@@ -69,12 +69,10 @@ def setup() -> None:
|
|
69
69
|
uv_install(venv_path)
|
70
70
|
|
71
71
|
|
72
|
-
def run(version: str, cmd: str, *args: str,
|
72
|
+
def run(version: str, cmd: str, *args: str, **kwargs: Any) -> None:
|
73
73
|
"""Run a command in a virtual environment."""
|
74
74
|
kwargs = {"check": True, **kwargs}
|
75
|
-
uv_run = ["uv", "run"]
|
76
|
-
if no_sync:
|
77
|
-
uv_run.append("--no-sync")
|
75
|
+
uv_run = ["uv", "run", "--no-sync"]
|
78
76
|
if version == "default":
|
79
77
|
with environ(UV_PROJECT_ENVIRONMENT=".venv"):
|
80
78
|
subprocess.run([*uv_run, cmd, *args], **kwargs) # noqa: S603, PLW1510
|
@@ -141,7 +139,7 @@ def main() -> int:
|
|
141
139
|
)
|
142
140
|
if os.path.exists(".venv"):
|
143
141
|
print("\nAvailable tasks", flush=True)
|
144
|
-
run("default", "duty", "--list"
|
142
|
+
run("default", "duty", "--list")
|
145
143
|
return 0
|
146
144
|
|
147
145
|
while args:
|
@@ -1,5 +1,6 @@
|
|
1
1
|
"""Tests for the base formatter."""
|
2
2
|
|
3
|
+
import os
|
3
4
|
import subprocess
|
4
5
|
|
5
6
|
import pytest
|
@@ -93,6 +94,7 @@ def test_render_source_even_if_output_is_empty(md: Markdown) -> None:
|
|
93
94
|
assert "Source" in markup
|
94
95
|
|
95
96
|
|
97
|
+
@pytest.mark.skipif(os.name != "posix", reason="No time for the annoying OS.")
|
96
98
|
def test_changing_working_directory(md: Markdown) -> None:
|
97
99
|
"""Assert we can change the working directory with `workdir`.
|
98
100
|
|
@@ -109,6 +111,7 @@ def test_changing_working_directory(md: Markdown) -> None:
|
|
109
111
|
assert markup == "<p>/</p>"
|
110
112
|
|
111
113
|
|
114
|
+
@pytest.mark.skipif(os.name != "posix", reason="No time for the annoying OS.")
|
112
115
|
def test_console_width(md: Markdown) -> None:
|
113
116
|
"""Assert we can change the console width with `width`.
|
114
117
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|