Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jul 30, 2024
1 parent a26c096 commit d88333e
Show file tree
Hide file tree
Showing 11 changed files with 876 additions and 628 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
poetry-version: [1.7.1]
pandoc-version: [3.1.11.1]
python-version: ['3.10', '3.11', '3.12']
poetry-version: [1.8.3]
pandoc-version: ['3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -41,8 +41,8 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
poetry-version: [1.2.2, 1.3.2, 1.4.2, 1.5.1, 1.6.1, 1.7.1]
pandoc-version: [3.1.11.1]
poetry-version: [1.2.2, 1.3.2, 1.4.2, 1.5.1, 1.6.1, 1.7.1, 1.8.3]
pandoc-version: ['3.3']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -67,8 +67,8 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
poetry-version: [1.7.1]
pandoc-version: [3.0.1, 3.1.11.1]
poetry-version: [1.8.3]
pandoc-version: [3.0.1, 3.1.13, 3.2.1, '3.3']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Install dependencies
run: |
poetry install
Expand All @@ -119,11 +119,11 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/3.1.11.1/pandoc-3.1.11.1-1-amd64.deb
sudo dpkg -i ./pandoc-3.1.11.1-1-amd64.deb
wget https://github.com/jgm/pandoc/releases/download/3.3/pandoc-3.3-1-amd64.deb
sudo dpkg -i ./pandoc-3.3-1-amd64.deb
poetry install
- name: Test
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.7.1
poetry-version: 1.8.3
- name: Set up poetry-dynamic-versioning
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
Expand Down
90 changes: 90 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml

- repo: https://gitlab.com/smop/pre-commit-hooks
rev: v1.0.0
hooks:
- id: check-poetry

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.14.0
hooks:
- id: pretty-format-toml
exclude: ^poetry.lock$
args: [--autofix, --no-sort]
- id: pretty-format-yaml
args: [--autofix]

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
- id: tox-ini-fmt

- repo: https://github.com/ariebovenberg/slotscheck
rev: v0.19.0
hooks:
- id: slotscheck
language: system
exclude: ^(?!pandoc_figure/)

- repo: https://github.com/dosisod/refurb
rev: v2.0.0
hooks:
- id: refurb

- repo: https://github.com/isidentical/teyit
rev: 0.4.3
hooks:
- id: teyit

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
hooks:
- id: ruff
language: system
exclude: ^(?!pandoc_figure/)

- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
- id: black-jupyter
args: [--config=pyproject.toml, pandoc_figure/, tests]

- repo: https://github.com/PyCQA/doc8/
rev: v1.1.1
hooks:
- id: doc8
args: [docs]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.0
hooks:
- id: mypy
language: system
exclude: ^(?!pandoc_figure/)

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
hooks:
- id: flake8
language: system
exclude: ^(?!pandoc_figure/)

- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a5
hooks:
- id: pylint
language: system
exclude: ^(?!pandoc_figure/)

- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
language: system
args: [--py310-plus]

4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ build:
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs

# Build documentation in the "docs/" directory with Sphinx
sphinx:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Installation
[![Last commit](https://img.shields.io/github/last-commit/chdemko/pandoc-figure/develop?logo=github)](https://github.com/chdemko/pandoc-figure/commit/develop/)
[![License](https://img.shields.io/pypi/l/pandoc-figure.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+Cgo8c3ZnCiAgIGhlaWdodD0iODAwcHgiCiAgIHdpZHRoPSI4MDBweCIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0iX3gzMl8iCiAgIHZpZXdCb3g9IjAgMCA1MTI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LDg4LjU5LTY1LjczNmgtMTEuMzg2bC02MC4zNTUtMTcxLjEzNCAgIGMzNy4xODMtMTEuNDY3LDg5LjU2OS0zMS4wNTYsMTM0LjYzNi0zNC4wNzJ2MjQuMjNoLTguNTA3djI2Ny43NDhIMjE4LjM3djIzLjg1OGMtOC43MTUsMC0xNy41NjksMC0yNC44NzQsMCAgIGMtMjMuMzU0LDAtMjIuNjYzLDMyLjk2OS0yMi42NjMsMzIuOTY5Yy0xOS4yMzMsMC0yOC44NSwxNS4xMDEtMjguODUsMzMuNjQ4aDIyOC4wMzNjMC0xOC41NDYtOS42MTYtMzMuNjQ4LTI4Ljg0NS0zMy42NDggICBjMCwwLDAuNjg2LTMyLjk2OS0yMi42NjgtMzIuOTY5Yy03LjMwNSwwLTE2LjE1OSwwLTI0Ljg3NCwwdi0yMy44NThoLTEzLjIwM1YxNDEuM2gtOC41MDd2LTI0LjIzICAgYzQ1LjA3MiwzLjAxNSw5Ny40NTcsMjIuNjA0LDEzNC42NCwzNC4wNzJsLTYwLjM1OCwxNzEuMTM0aC0xMS4zODdjMTEuNDk2LDM4LjAyNSw0Ni44MDQsNjUuNzM2LDg4LjU5LDY1LjczNiAgIGM0MS43OSwwLDc3LjA5OC0yNy43MTEsODguNTk0LTY1LjczNkg1MDAuNjA5eiBNMTQxLjI0MywzMjIuMjc1SDM1Ljk0OEw4OC41OTUsMTczTDE0MS4yNDMsMzIyLjI3NXogTTM3MC43NTgsMzIyLjI3NUw0MjMuNDEsMTczICAgbDUyLjY0MywxNDkuMjc1SDM3MC43NTh6IgogICBpZD0icGF0aDMzNzkiCiAgIHN0eWxlPSJmaWxsOiNmZmZmZmYiIC8+CjwvZz4KPC9zdmc+Cg==)](https://raw.githubusercontent.com/chdemko/pandoc-figure/develop/LICENSE)
[![Python version](https://img.shields.io/pypi/pyversions/pandoc-figure.svg?logo=Python&logoColor=white)](https://pypi.org/project/pandoc-figure/)
[![Poetry version](https://img.shields.io/badge/poetry-1.2%20|%201.3%20|%201.4%20|%201.5-blue.svg?logo=poetry)](https://python-poetry.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-3.0%20|%203.1-blue.svg?logo=markdown)](https://pandoc.org/)
[![Poetry version](https://img.shields.io/badge/poetry-1.2%20|%201.3%20|%201.4%20|%201.5%20|%201.6%20|%201.7%20|%201.8-blue.svg?logo=poetry)](https://python-poetry.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-3.0%20|%203.1%20|%203.2%20|%203.3-blue.svg?logo=markdown)](https://pandoc.org/)
[![Downloads](https://img.shields.io/pypi/dm/pandoc-figure?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjwhLS0gVXBsb2FkZWQgdG86IFNWRyBSZXBvLCB3d3cuc3ZncmVwby5jb20sIEdlbmVyYXRvcjogU1ZHIFJlcG8gTWl4ZXIgVG9vbHMgLS0+Cgo8c3ZnCiAgIHdpZHRoPSI4MDBweCIKICAgaGVpZ2h0PSI4MDBweCIKICAgdmlld0JveD0iMCAwIDI0IDI0IgogICBmaWxsPSJub25lIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmc0IgogICBzb2RpcG9kaTpkb2NuYW1lPSJkb3dubG9hZC1zdmdyZXBvLWNvbS5zdmciCiAgIGlua3NjYXBlOnZlcnNpb249IjEuMS4yICgwYTAwY2Y1MzM5LCAyMDIyLTAyLTA0KSIKICAgeG1sbnM6aW5rc2NhcGU9Imh0dHA6Ly93d3cuaW5rc2NhcGUub3JnL25hbWVzcGFjZXMvaW5rc2NhcGUiCiAgIHhtbG5zOnNvZGlwb2RpPSJodHRwOi8vc29kaXBvZGkuc291cmNlZm9yZ2UubmV0L0RURC9zb2RpcG9kaS0wLmR0ZCIKICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAv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ech/project/pandoc-figure)
[![Development Status](https://img.shields.io/pypi/status/pandoc-figure.svg?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgdmlld0JveD0iMCAwIDMyIDMyIgogICB2ZXJzaW9uPSIxLjEiCiAgIGlkPSJzdmcxMDY0IgogICBzb2RpcG9kaTpkb2NuYW1lPSIyNjcyNzY4X2FwcF9iYXR0ZXJ5X3N0YXR1c19vYmplY3RfZXNzZW50aWFsX2ljb24uc3ZnIgogICBpbmtzY2FwZTp2ZXJzaW9uPSIxLjEuMiAoMGEwMGNmNTMzOSwgMjAyMi0wMi0wNCkiCiAgIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIgogICB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGRlZnMKICAgICBpZD0iZGVmczEwNjgiIC8+CiAgPHNvZGlwb2RpOm5hbWVkdmlldwogICAgIGlkPSJuYW1lZHZpZXcxMDY2IgogICAgIHBhZ2Vjb2xvcj0iI2ZmZmZmZiIKICAgICBib3JkZXJjb2xvcj0iIzY2NjY2NiIKICAgICBib3JkZXJvcGFjaXR5PSIxLjAiCiAgICAgaW5rc2NhcGU6cGFnZXNoYWRvdz0iMiIKICAgICBpbmtzY2FwZTpwYWdlb3BhY2l0eT0iMC4wIgogICAgIGlua3NjYXBlOnBhZ2VjaGVja2VyYm9hcmQ9IjAiCiAgICAgc2hvd2dyaWQ9ImZhbHNlIgogICAgIGlua3NjYXBlOnpvb209IjIyLjQ2ODc1IgogICAgIGlua3NjYXBlOmN4PSIxNiIKICAgICBpbmtzY2FwZTpjeT0iMTUuOTc3NzQ3IgogICAgIGlua3NjYXBlOndpbmRvdy13aWR0aD0iMTkyMCIKICAgICBpbmtzY2FwZTp3aW5kb3ctaGVpZ2h0PSIxMTYzIgogICAgIGlua3NjYXBlOndpbmRvdy14PSIxOTIwIgogICAgIGlua3NjYXBlOndpbmRvdy15PSIwIgogICAgIGlua3NjYXBlOndpbmRvdy1tYXhpbWl6ZWQ9IjEiCiAgICAgaW5rc2NhcGU6Y3VycmVudC1sYXllcj0ic3ZnMTA2NCIgLz4KICA8dGl0bGUKICAgICBpZD0idGl0bGUxMDU5IiAvPgogIDxnCiAgICAgZGF0YS1uYW1lPSIyNi1CYXR0ZXJ5IHN0YXR1cyIKICAgICBpZD0iXzI2LUJhdHRlcnlfc3RhdHVzIgogICAgIHN0eWxlPSJmaWxsOiNmZmZmZmYiPgogICAgPHBhdGgKICAgICAgIGQ9Ik0zMSwxM0gzMFYxMmExLDEsMCwwLDAtMS0xSDI4VjEwYTIsMiwwLDAsMC0yLTJIMmEyLDIsMCwwLDAtMiwyVjIyYTIsMiwwLDAsMCwyLDJIMjZhMiwyLDAsMCwwLDItMlYyMWgxYTEsMSwwLDAsMCwxLTFWMTloMWExLDEsMCwwLDAsMS0xVjE0QTEsMSwwLDAsMCwzMSwxM1ptLTUtMVYyMkgxOFYxMGg4WiIKICAgICAgIGlkPSJwYXRoMTA2MSIKICAgICAgIHN0eWxlPSJmaWxsOiNmZmZmZmYiIC8+CiAgPC9nPgo8L3N2Zz4K)](https://pypi.org/project/pandoc-figure/)
[![Docs](https://img.shields.io/readthedocs/pandoc-figure.svg?logo=read-the-docs&logoColor=white)](http://pandoc-figure.readthedocs.io/en/latest/)
Expand Down
10 changes: 10 additions & 0 deletions pandoc_figure/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""
pandoc_figure package.
"""

from ._main import main

__all__ = ("main",)

if __name__ == "__main__":
main()
10 changes: 7 additions & 3 deletions pandoc_figure.py → pandoc_figure/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from panflute import (
Caption,
Div,
Doc,
Element,
Figure,
Plain,
convert_text,
Expand All @@ -16,7 +18,7 @@


# pylint: disable=broad-exception-caught
def figure(elem, doc):
def figure(elem: Element, doc: Doc) -> Figure | None:
"""
Transform a div element into a figure element.
Expand All @@ -29,6 +31,7 @@ def figure(elem, doc):
Returns
-------
Figure | None
Figure or None.
"""
if (
Expand All @@ -53,7 +56,7 @@ def figure(elem, doc):
return None


def prepare(doc):
def prepare(doc: Doc) -> None:
"""
Prepare the pandoc document.
Expand All @@ -70,7 +73,7 @@ def prepare(doc):
)


def main(doc=None):
def main(doc: Doc | None = None) -> Doc:
"""
Convert the pandoc document.
Expand All @@ -81,6 +84,7 @@ def main(doc=None):
Returns
-------
Doc
The modified pandoc document
"""
return run_filter(figure, prepare=prepare, doc=doc)
Expand Down
Loading

0 comments on commit d88333e

Please sign in to comment.