Skip to content

Commit dcd0ce2

Browse files
Release v0.5.12 (#59)
* Bump abatilo/actions-poetry from 2.1.6 to 2.3.0 Bumps [abatilo/actions-poetry](https://github.com/abatilo/actions-poetry) from 2.1.6 to 2.3.0. - [Release notes](https://github.com/abatilo/actions-poetry/releases) - [Changelog](https://github.com/abatilo/actions-poetry/blob/master/.releaserc) - [Commits](abatilo/actions-poetry@v2.1.6...v2.3.0) --- updated-dependencies: - dependency-name: abatilo/actions-poetry dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Bump mkdocstrings from 0.19.1 to 0.25.1 Bumps [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) from 0.19.1 to 0.25.1. - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](mkdocstrings/mkdocstrings@0.19.1...0.25.1) --- updated-dependencies: - dependency-name: mkdocstrings dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * (chore) lock update and update in CICD (#35) * (chore) lock update and update in CICD * (chore) updated preprocessor and added testing * (chore) updated pre commit hooks and versions * (chore) updated test to match boostrap distro, improved test error msg. * (chore) upgraded missing versions of checkout and python setup in cicd * Bump mdformat-frontmatter from 0.4.1 to 2.0.8 (#41) Bumps [mdformat-frontmatter](https://github.com/butler54/mdformat-frontmatter) from 0.4.1 to 2.0.8. - [Release notes](https://github.com/butler54/mdformat-frontmatter/releases) - [Changelog](https://github.com/butler54/mdformat-frontmatter/blob/main/CHANGELOG.md) - [Commits](butler54/mdformat-frontmatter@v0.4.1...v2.0.8) --- updated-dependencies: - dependency-name: mdformat-frontmatter dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: add support for arbitrary separator repetitions (#58) * fix: add support for arbitrary separator repetitions * chore: migrate to uv * chore: updated pre commit hooks to remove poetry --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent c57d586 commit dcd0ce2

File tree

8 files changed

+2780
-4581
lines changed

8 files changed

+2780
-4581
lines changed

.github/workflows/CICD.yml

+28-65
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,20 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616

17-
# Python setup
18-
- uses: actions/setup-python@v5
19-
with:
20-
python-version: '3.x'
21-
22-
- name: Debug Info
23-
run: echo ${{ github.ref }} ${{ github.event_name }} ${{ endsWith(github.ref, 'heads/release') && (github.event_name == 'push') }}
24-
# refs/heads/main push false is the output of the main branch when tagged with a release ...
25-
26-
- name: View Python --version
27-
run: python --version
28-
29-
# Poetry Setup
30-
- name: Python Poetry Action
31-
uses: abatilo/[email protected]
32-
with:
33-
poetry-version: '1.7.1'
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
3419

35-
- name: View poetry --version
36-
run: poetry --version
37-
- name: Install Stuff
38-
run: poetry install --no-root --only check
3920
- name: Black
40-
run: poetry run python -m black . --check --diff
21+
run: uv run --group lint python -m black . --check --diff
4122
- name: ruff
42-
run: poetry run ruff check .
43-
- name: isort
44-
run: poetry run isort . --check
23+
run: uv run --group lint ruff check .
4524

4625
ci:
4726
needs: cheap_checks
4827
strategy:
4928
fail-fast: false
5029
matrix:
51-
python-version: [ '3.9', '3.11', '3.12' ]
52-
poetry-version: [ '1.7.1' ]
30+
python-version: [ '3.10', '3.11', '3.12' ]
5331
os: [ 'ubuntu-latest' ]
5432
runs-on: ${{ matrix.os }}
5533
steps:
@@ -62,31 +40,24 @@ jobs:
6240
- name: View Quarto version
6341
run: quarto --version
6442

43+
- name: Install uv
44+
uses: astral-sh/setup-uv@v5
45+
6546
# Python setup
66-
- uses: actions/setup-python@v5
47+
- name: Install uv and set the python version
48+
uses: astral-sh/setup-uv@v5
6749
with:
6850
python-version: ${{ matrix.python-version }}
51+
6952
- name: View Python --version
7053
run: python --version
7154

72-
# Poetry Setup
73-
- name: Python Poetry Action
74-
uses: abatilo/[email protected]
75-
with:
76-
poetry-version: ${{ matrix.poetry-version }}
77-
- name: View poetry --version
78-
run: poetry --version
79-
80-
# Package Setup
81-
- name: Install deps
82-
run: poetry install -n -v --all-extras
83-
8455
# CI checks
8556
- name: Pytest
86-
run: poetry run python -m pytest --cov . --cov-report=xml
57+
run: uv run --all-groups python -m pytest --cov . --cov-report=xml
8758

8859
- name: mkdocs
89-
run: poetry run python -m mkdocs build --strict
60+
run: uv run --all-groups python -m mkdocs build --strict
9061

9162
- uses: codecov/codecov-action@v4
9263
with:
@@ -110,39 +81,31 @@ jobs:
11081
run: quarto --version
11182

11283
# Python setup
113-
- uses: actions/setup-python@v5
84+
- name: Install uv and set the python version
85+
uses: astral-sh/setup-uv@v5
11486
with:
11587
python-version: '3.x'
116-
- name: View Python --version
117-
run: python --version
118-
119-
# Poetry Setup
120-
- name: Python Poetry Action
121-
uses: abatilo/[email protected]
122-
with:
123-
poetry-version: '1.7.1'
124-
- name: View poetry --version
125-
run: poetry --version
12688

127-
# Package Setup
128-
- name: Install deps
129-
run: poetry install -n -v --all-extras
89+
- name: View Python --version
90+
run: uv run python --version
13091

13192
- name: Build package
13293
run: |
133-
poetry build
94+
uv run --all-groups python -m build
13495
13596
# Publishing Docs
13697
- name: Deploy Docs
13798
run: |
138-
poetry run python -m mkdocs gh-deploy --strict --force
99+
uv run python -m mkdocs gh-deploy --strict --force
139100
140-
# Publish Package
141-
- name: Publish Setup
142-
env:
143-
PYPITOKEN: ${{ secrets.PYPITOKEN }}
101+
- name: Build package
144102
run: |
145-
poetry config pypi-token.pypi ${PYPITOKEN}
146-
- name: Publish
103+
uv run python -m build
104+
105+
- name: Publish to PyPI
106+
env:
107+
TWINE_USERNAME: __token__
108+
TWINE_PASSWORD: ${{ secrets.PYPITOKEN }}
147109
run: |
148-
poetry publish --no-interaction
110+
python -m twine upload --non-interactive dist/*
111+

.pre-commit-config.yaml

+2-15
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,16 @@ repos:
3232
- id: pydocstyle
3333
additional_dependencies:
3434
- toml
35-
- repo: https://github.com/python-poetry/poetry
36-
rev: 1.8.0 # add version here
37-
hooks:
38-
- id: poetry-check
39-
- id: poetry-lock
40-
- id: poetry-export
41-
args: [ "-f", "requirements.txt", "-o", "requirements.txt" ]
4235
- repo: local
4336
hooks:
44-
- id: isort
45-
name: isort
46-
entry: poetry run isort .
47-
language: system
48-
always_run: true
49-
pass_filenames: false
5037
- id: pydocstringformatter
5138
name: pydocstringformatter
52-
entry: poetry run pydocstringformatter mkquartodocs
39+
entry: uv run --all-groups pydocstringformatter mkquartodocs
5340
language: system
5441
always_run: true
5542
- id: pytest
5643
name: pytest-check
57-
entry: poetry run python -m pytest -x
44+
entry: uv run --all-groups python -m pytest -x
5845
language: system
5946
pass_filenames: false
6047
always_run: true

mkquartodocs/extension.py

+14-15
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414

1515

1616
class AdmotionCellDataPreprocessor(Preprocessor):
17-
CELL_REGEX: Final = re.compile(r"^::: \{\.cell .*}\s*$")
18-
CELL_END: Final = re.compile(r"^:{3,4}?$")
17+
18+
CELL_REGEX: Final = re.compile(r"^(:{3,}) \{\.cell .*}\s*$")
19+
CELL_END: Final = re.compile(r"^(:{3,})$")
1920
CELL_ELEM_REGEX: Final = re.compile(
20-
r"^:{3,4} \{(\.cell(-\w+)?)\s?(\.cell-[\w-]+)?( execution_count=\"\d+\")?\}"
21+
r"^(:{3,}) \{(.cell-\w+)\s?(\.cell-[\w-]+)?( execution_count=\"\d+\")?\}$"
2122
)
22-
CODEBLOCK_REGEX: Final = re.compile(r"^```{\.(\w+) .*}")
23+
CODEBLOCK_REGEX: Final = re.compile(r"^(`{3,}){\.(\w+) .*}")
2324

2425
# https://squidfunk.github.io/mkdocs-material/reference/admonitions/#supported-types
2526
TYPE_MAPPING: Final = {
@@ -46,19 +47,17 @@ def _process_line(self, line):
4647
out = "\n\n"
4748

4849
elif sr := self.CELL_ELEM_REGEX.search(line):
49-
groups = {i: x for i, x in enumerate(sr.groups())}
50-
log.debug(f"Matched Cell element: {line}, groups: {groups}")
51-
if groups[3]:
52-
out = "\n\n"
53-
else:
54-
output_type = groups[2]
55-
out = self.TYPE_MAPPING[output_type]
50+
grp = sr.groups()
51+
log.debug(f"Matched Cell element: {line}, groups: {grp}")
52+
output_type = grp[2]
53+
out = self.TYPE_MAPPING[output_type]
5654

5755
elif sr := self.CODEBLOCK_REGEX.search(line):
58-
groups = {i: x for i, x in enumerate(sr.groups())}
59-
log.debug(f"Matched codeblock: {line} -> {groups}")
60-
lang = sr.groups(1)
61-
out = f"```{lang}"
56+
grp = sr.groups()
57+
log.debug(f"Matched codeblock: {line}, groups: {grp}")
58+
lang = grp[2]
59+
nesting_level = len(grp[1])
60+
out = f"{'`' * nesting_level}{lang}"
6261
else:
6362
out = line
6463

mkquartodocs/plugin.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import re
2+
import time
23
import shutil
34
import subprocess
45
import warnings
@@ -88,11 +89,12 @@ def on_pre_build(self, config):
8889
except subprocess.CalledProcessError as e:
8990
# ERROR: Couldn't find open server
9091
# it ocasionally fails with that error ...
91-
if i == 4:
92+
if i >= 4:
9293
log.error(f"Quarto failed to render {x} after 5 tries")
9394
log.error(f"Quarto failed with error: {e}")
9495
raise
9596
warnings.warn(f"Quarto failed to render {x}, retrying")
97+
time.sleep(2)
9698
else:
9799
warnings.warn(f"No quarto files were found in directory {docs_dir}")
98100

0 commit comments

Comments
 (0)