comrak 0.0.8__tar.gz → 0.0.9__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.
Potentially problematic release.
This version of comrak might be problematic. Click here for more details.
- {comrak-0.0.8 → comrak-0.0.9}/.github/workflows/CI.yml +7 -2
- comrak-0.0.9/.github/workflows/deploy.yml +36 -0
- comrak-0.0.9/.github/workflows/test.yml +111 -0
- {comrak-0.0.8 → comrak-0.0.9}/.pre-commit-config.yaml +1 -15
- {comrak-0.0.8 → comrak-0.0.9}/Cargo.toml +1 -1
- {comrak-0.0.8 → comrak-0.0.9}/PKG-INFO +1 -1
- {comrak-0.0.8 → comrak-0.0.9}/pyproject.toml +8 -1
- {comrak-0.0.8 → comrak-0.0.9}/uv.lock +1 -1
- comrak-0.0.8/.github/workflows/test.yml +0 -86
- {comrak-0.0.8 → comrak-0.0.9}/.aiignore +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/.gitignore +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/.just/commit.just +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/.just/ship.just +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/.just/test.just +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/Cargo.lock +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/DEVELOPMENT.md +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/Justfile +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/LICENSE +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/README.md +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/README.md +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/awesome_python_readme_x1000/comrak_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/awesome_python_readme_x1000/markdown2_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/awesome_python_readme_x1000/markdown_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/hello_world_x1000/comrak_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/hello_world_x1000/markdown2_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/hello_world_x1000/markdown_bench.py +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/run_medium_benchmark.sh +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/benchmark/run_small_benchmark.sh +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/src/lib.rs +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/src/options.rs +0 -0
- {comrak-0.0.8 → comrak-0.0.9}/tests/comrak_test.py +0 -0
|
@@ -14,6 +14,10 @@ on:
|
|
|
14
14
|
- "*"
|
|
15
15
|
pull_request:
|
|
16
16
|
workflow_dispatch:
|
|
17
|
+
workflow_run:
|
|
18
|
+
workflows: ["Deploy Release"]
|
|
19
|
+
types:
|
|
20
|
+
- completed
|
|
17
21
|
|
|
18
22
|
permissions:
|
|
19
23
|
contents: read
|
|
@@ -35,6 +39,7 @@ jobs:
|
|
|
35
39
|
)
|
|
36
40
|
)
|
|
37
41
|
|| (github.event_name == 'workflow_dispatch')
|
|
42
|
+
|| (github.event_name == 'workflow_run')
|
|
38
43
|
steps:
|
|
39
44
|
- name: Confirm commit message matched
|
|
40
45
|
run: echo "Commit message matched the condition."
|
|
@@ -182,7 +187,7 @@ jobs:
|
|
|
182
187
|
name: Release
|
|
183
188
|
environment: pypi
|
|
184
189
|
runs-on: ubuntu-latest
|
|
185
|
-
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
|
|
190
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_run' }}
|
|
186
191
|
needs: [linux, musllinux, windows, macos, sdist]
|
|
187
192
|
permissions:
|
|
188
193
|
# Use to sign the release artifacts
|
|
@@ -198,7 +203,7 @@ jobs:
|
|
|
198
203
|
with:
|
|
199
204
|
subject-path: "wheels-*/*"
|
|
200
205
|
- name: Publish to PyPI
|
|
201
|
-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
206
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }} || (github.event_name == 'workflow_run')
|
|
202
207
|
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
|
|
203
208
|
with:
|
|
204
209
|
command: upload
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Deploy Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
deploy-release:
|
|
8
|
+
name: Run just release
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: write
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout repository
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
persist-credentials: true
|
|
19
|
+
|
|
20
|
+
- name: Install uv
|
|
21
|
+
uses: astral-sh/setup-uv@v7
|
|
22
|
+
|
|
23
|
+
- name: Install just
|
|
24
|
+
uses: taiki-e/install-action@64adfd9e935fa438859b9e080fd026720b2ba070 # tag=just
|
|
25
|
+
with:
|
|
26
|
+
tool: just@1.38.0,echo-comment@0.2.0
|
|
27
|
+
|
|
28
|
+
- name: Configure git identity
|
|
29
|
+
run: |
|
|
30
|
+
git config user.name "github-actions[bot]"
|
|
31
|
+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
32
|
+
|
|
33
|
+
# Bump version, commit changes, tag as `py-v*`, and push both
|
|
34
|
+
# commit and tag (pushing the latter triggers package release)
|
|
35
|
+
- name: Run just release
|
|
36
|
+
run: just release
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
get-python-versions:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
timeout-minutes: 5
|
|
18
|
+
outputs:
|
|
19
|
+
python-versions: ${{ steps.get-versions.outputs.python-versions }}
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- name: Install uv
|
|
24
|
+
uses: astral-sh/setup-uv@v7
|
|
25
|
+
|
|
26
|
+
- name: Get Python versions from uv
|
|
27
|
+
id: get-versions
|
|
28
|
+
run: |
|
|
29
|
+
set -euo pipefail
|
|
30
|
+
MIN_VERSION=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.requires-python | sed 's/>=//;s/"//g')
|
|
31
|
+
PYO3_FFI_VERSION=$(grep -m 1 -A 1 'name = "pyo3-ffi"' Cargo.lock | tail -n1 | cut -d '"' -f 2)
|
|
32
|
+
# Download the crate once and reuse the Cargo.toml extraction to avoid repeated curl calls
|
|
33
|
+
TMP_CRATE=$(mktemp)
|
|
34
|
+
curl -sL "https://static.crates.io/crates/pyo3-ffi/pyo3-ffi-$PYO3_FFI_VERSION.crate" -o "$TMP_CRATE"
|
|
35
|
+
# extract Cargo.toml content from the downloaded crate
|
|
36
|
+
CARGO_TOML_CONTENT=$(tar -xzO -f "$TMP_CRATE" "pyo3-ffi-$PYO3_FFI_VERSION/Cargo.toml" 2>/dev/null || true)
|
|
37
|
+
# get the supported CPython max version from the pyo3-ffi crate (from the extracted Cargo.toml)
|
|
38
|
+
MAX_VERSION=$(echo "$CARGO_TOML_CONTENT" | uvx --from=toml-cli toml get --toml-path=/dev/stdin package.metadata.cpython.max-version | tr -d '"')
|
|
39
|
+
# get the supported PyPy min version
|
|
40
|
+
PYPY_MIN=$(echo "$CARGO_TOML_CONTENT" | uvx --from=toml-cli toml get --toml-path=/dev/stdin package.metadata.pypy.min-version | tr -d '"')
|
|
41
|
+
# get the supported PyPy max version
|
|
42
|
+
PYPY_MAX=$(echo "$CARGO_TOML_CONTENT" | uvx --from=toml-cli toml get --toml-path=/dev/stdin package.metadata.pypy.max-version | tr -d '"')
|
|
43
|
+
# gather the list once and derive CPython and (optional) PyPy sets from it
|
|
44
|
+
LIST=$(uv python list --all-versions --output-format json)
|
|
45
|
+
|
|
46
|
+
CPYTHON_VERSIONS=$(echo "$LIST" | jq -c --arg min "$MIN_VERSION" --arg max "$MAX_VERSION" '
|
|
47
|
+
($min | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $minv |
|
|
48
|
+
($max | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $maxv |
|
|
49
|
+
[.[] | {v:.version_parts, t:.variant, impl:.implementation}]
|
|
50
|
+
| unique_by([.v.minor,.t])
|
|
51
|
+
| map(select(
|
|
52
|
+
(.impl == "cpython") and
|
|
53
|
+
((.v.major > $minv.major or (.v.major == $minv.major and .v.minor >= $minv.minor)) and
|
|
54
|
+
(.v.major < $maxv.major or (.v.major == $maxv.major and .v.minor <= $maxv.minor)))
|
|
55
|
+
))
|
|
56
|
+
| map("\(.v.major).\(.v.minor)\(if .t=="freethreaded" then "t" else "" end)")')
|
|
57
|
+
PYPY_VERSIONS=$(echo "$LIST" | jq -c --arg min "$PYPY_MIN" --arg max "$PYPY_MAX" '
|
|
58
|
+
($min | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $minv |
|
|
59
|
+
($max | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $maxv |
|
|
60
|
+
[.[] | {v:.version_parts, t:.variant, impl:.implementation}]
|
|
61
|
+
| unique_by([.v.minor,.impl])
|
|
62
|
+
| map(select(
|
|
63
|
+
(.impl == "pypy") and
|
|
64
|
+
((.v.major > $minv.major or (.v.major == $minv.major and .v.minor >= $minv.minor)) and
|
|
65
|
+
(.v.major < $maxv.major or (.v.major == $maxv.major and .v.minor <= $maxv.minor)))
|
|
66
|
+
))
|
|
67
|
+
| map("pypy-\(.v.major).\(.v.minor)")')
|
|
68
|
+
# merge arrays
|
|
69
|
+
versions=$(jq -nc --argjson a "$CPYTHON_VERSIONS" --argjson b "$PYPY_VERSIONS" '$a + $b')
|
|
70
|
+
|
|
71
|
+
echo "python-versions=$versions" >> $GITHUB_OUTPUT
|
|
72
|
+
|
|
73
|
+
test:
|
|
74
|
+
needs: get-python-versions
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
timeout-minutes: 10
|
|
77
|
+
strategy:
|
|
78
|
+
fail-fast: false
|
|
79
|
+
matrix:
|
|
80
|
+
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-versions) }}
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
|
|
84
|
+
- name: Set up mold linker
|
|
85
|
+
uses: rui314/setup-mold@v1
|
|
86
|
+
|
|
87
|
+
- uses: Swatinem/rust-cache@v2.8.1
|
|
88
|
+
|
|
89
|
+
- name: Install uv
|
|
90
|
+
uses: astral-sh/setup-uv@v7
|
|
91
|
+
with:
|
|
92
|
+
enable-cache: false # true
|
|
93
|
+
python-version: ${{ matrix.python-version }}
|
|
94
|
+
|
|
95
|
+
- name: Set up Rust
|
|
96
|
+
uses: dtolnay/rust-toolchain@stable
|
|
97
|
+
|
|
98
|
+
- name: Sync build and test dependencies
|
|
99
|
+
run: uv sync --only-group build --only-group test
|
|
100
|
+
|
|
101
|
+
- name: Build extension
|
|
102
|
+
run: |
|
|
103
|
+
# https://github.com/astral-sh/uv/issues/16434
|
|
104
|
+
# $(uv python find) -m maturin develop --uv
|
|
105
|
+
.venv/bin/python -m maturin develop --uv
|
|
106
|
+
|
|
107
|
+
- name: Run tests
|
|
108
|
+
run: |
|
|
109
|
+
# https://github.com/astral-sh/uv/issues/16434
|
|
110
|
+
# $(uv python find) -m pytest
|
|
111
|
+
.venv/bin/pytest
|
|
@@ -23,25 +23,11 @@ repos:
|
|
|
23
23
|
- id: end-of-file-fixer
|
|
24
24
|
- id: name-tests-test
|
|
25
25
|
- id: trailing-whitespace
|
|
26
|
-
- repo: https://github.com/pappasam/toml-sort
|
|
27
|
-
rev: v0.24.3
|
|
28
|
-
hooks:
|
|
29
|
-
- id: toml-sort-fix
|
|
30
|
-
exclude: ^Cargo.lock$
|
|
31
|
-
- repo: https://github.com/asottile/add-trailing-comma
|
|
32
|
-
rev: v4.0.0
|
|
33
|
-
hooks:
|
|
34
|
-
- id: add-trailing-comma
|
|
35
|
-
- repo: https://github.com/asottile/pyupgrade
|
|
36
|
-
rev: v3.21.0
|
|
37
|
-
hooks:
|
|
38
|
-
- id: pyupgrade
|
|
39
|
-
args: [--py310-plus]
|
|
40
26
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
41
27
|
rev: v0.14.1
|
|
42
28
|
hooks:
|
|
43
29
|
# Run the linter
|
|
44
|
-
- id: ruff
|
|
30
|
+
- id: ruff-check
|
|
45
31
|
args: [--fix]
|
|
46
32
|
# Run the formatter
|
|
47
33
|
- id: ruff-format
|
|
@@ -51,7 +51,7 @@ keywords = [
|
|
|
51
51
|
]
|
|
52
52
|
readme = "README.md"
|
|
53
53
|
requires-python = ">=3.9"
|
|
54
|
-
version = "0.0.
|
|
54
|
+
version = "0.0.9"
|
|
55
55
|
|
|
56
56
|
[project.license]
|
|
57
57
|
file = "LICENSE"
|
|
@@ -65,6 +65,13 @@ features = [
|
|
|
65
65
|
"pyo3/extension-module"
|
|
66
66
|
]
|
|
67
67
|
|
|
68
|
+
[tool.pytest.ini_options]
|
|
69
|
+
testpaths = "tests"
|
|
70
|
+
addopts = "-v"
|
|
71
|
+
|
|
72
|
+
[tool.ruff]
|
|
73
|
+
extend-select = ["F", "UP"]
|
|
74
|
+
|
|
68
75
|
[tool.uv]
|
|
69
76
|
# Build Rust code in development mode (faster builds)
|
|
70
77
|
# config-settings = { build-args = "--profile=dev" }
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
name: Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
pull_request:
|
|
8
|
-
workflow_dispatch:
|
|
9
|
-
|
|
10
|
-
concurrency:
|
|
11
|
-
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
12
|
-
cancel-in-progress: true
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
get-python-versions:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
timeout-minutes: 5
|
|
18
|
-
outputs:
|
|
19
|
-
python-versions: ${{ steps.get-versions.outputs.python-versions }}
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v4
|
|
22
|
-
|
|
23
|
-
- name: Install uv
|
|
24
|
-
uses: astral-sh/setup-uv@v7
|
|
25
|
-
|
|
26
|
-
- name: Get Python versions from uv
|
|
27
|
-
id: get-versions
|
|
28
|
-
run: |
|
|
29
|
-
set -euo pipefail
|
|
30
|
-
MIN_VERSION=$(uvx --from=toml-cli toml get --toml-path=pyproject.toml project.requires-python | sed 's/>=//;s/"//g')
|
|
31
|
-
PYO3_FFI_VERSION=$(grep -m 1 -A 1 'name = "pyo3-ffi"' Cargo.lock | tail -n1 | cut -d '"' -f 2)
|
|
32
|
-
MAX_VERSION=$(
|
|
33
|
-
curl -sL "https://static.crates.io/crates/pyo3-ffi/pyo3-ffi-$PYO3_FFI_VERSION.crate" \
|
|
34
|
-
| tar -xzO "pyo3-ffi-$PYO3_FFI_VERSION/Cargo.toml" \
|
|
35
|
-
| uvx --from=toml-cli toml get --toml-path=/dev/stdin package.metadata.cpython.max-version \
|
|
36
|
-
| tr -d '"'
|
|
37
|
-
)
|
|
38
|
-
versions=$(uv python list --all-versions --output-format json | jq -c --arg min "$MIN_VERSION" --arg max "$MAX_VERSION" '
|
|
39
|
-
($min | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $minv |
|
|
40
|
-
($max | split(".") | {major: .[0]|tonumber, minor: .[1]|tonumber}) as $maxv |
|
|
41
|
-
[.[] | {v:.version_parts, t:.variant}]
|
|
42
|
-
| unique_by([.v.minor,.t])
|
|
43
|
-
| map(select(
|
|
44
|
-
(.v.major > $minv.major or (.v.major == $minv.major and .v.minor >= $minv.minor)) and
|
|
45
|
-
(.v.major < $maxv.major or (.v.major == $maxv.major and .v.minor <= $maxv.minor))
|
|
46
|
-
))
|
|
47
|
-
| map("\(.v.major).\(.v.minor)\(if .t=="freethreaded" then "t" else "" end)")')
|
|
48
|
-
echo "python-versions=$versions" >> $GITHUB_OUTPUT
|
|
49
|
-
|
|
50
|
-
test:
|
|
51
|
-
needs: get-python-versions
|
|
52
|
-
runs-on: ubuntu-latest
|
|
53
|
-
timeout-minutes: 10
|
|
54
|
-
strategy:
|
|
55
|
-
fail-fast: false
|
|
56
|
-
matrix:
|
|
57
|
-
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-versions) }}
|
|
58
|
-
steps:
|
|
59
|
-
- uses: actions/checkout@v4
|
|
60
|
-
|
|
61
|
-
- name: Set up mold linker
|
|
62
|
-
uses: rui314/setup-mold@v1
|
|
63
|
-
|
|
64
|
-
- uses: Swatinem/rust-cache@v2.8.1
|
|
65
|
-
|
|
66
|
-
- name: Install uv
|
|
67
|
-
uses: astral-sh/setup-uv@v7
|
|
68
|
-
with:
|
|
69
|
-
enable-cache: false # true
|
|
70
|
-
python-version: ${{ matrix.python-version }}
|
|
71
|
-
|
|
72
|
-
- name: Set up Rust
|
|
73
|
-
uses: dtolnay/rust-toolchain@stable
|
|
74
|
-
|
|
75
|
-
- name: Sync build and test dependencies
|
|
76
|
-
run: uv sync --only-group build --only-group test
|
|
77
|
-
|
|
78
|
-
- name: Build extension
|
|
79
|
-
run: |
|
|
80
|
-
source .venv/bin/activate
|
|
81
|
-
.venv/bin/maturin develop --uv
|
|
82
|
-
|
|
83
|
-
- name: Run tests
|
|
84
|
-
run: |
|
|
85
|
-
source .venv/bin/activate
|
|
86
|
-
.venv/bin/pytest tests/ -v
|
|
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
|