Skip to content

Commit

Permalink
Merge branch 'release/3.2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Dec 17, 2024
2 parents 416b5ca + c5d6595 commit c2ec567
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 118 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
pandoc-version: ['3.5']
pandoc-version: ['3.6']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,7 +25,6 @@ jobs:
- name: Install Hatch
run: |
pipx install hatch
pipx inject --force hatch hatchling==1.25.0
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
Expand All @@ -40,7 +39,7 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
pandoc-version: [3.2.1, '3.3', '3.4', '3.5']
pandoc-version: [3.2.1, '3.3', '3.4', '3.5', '3.6']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -50,7 +49,6 @@ jobs:
- name: Install Hatch
run: |
pipx install hatch
pipx inject --force hatch hatchling==1.25.0
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
Expand All @@ -65,7 +63,7 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
pandoc-version: ['3.5']
pandoc-version: ['3.6']
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -75,7 +73,6 @@ jobs:
- name: Install Hatch
run: |
pipx install hatch
pipx inject --force hatch hatchling==1.25.0
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
Expand All @@ -93,7 +90,7 @@ jobs:
strategy:
matrix:
python-version: ['3.12']
pandoc-version: ['3.5']
pandoc-version: ['3.6']
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -103,7 +100,6 @@ jobs:
- name: Install Hatch
run: |
pipx install hatch
pipx inject --force hatch hatchling==1.25.0
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- name: Install Hatch
run: |
pipx install hatch
pipx inject --force hatch hatchling==1.25.0
- name: Build and publish
env:
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
Expand Down
1 change: 0 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ build:
python: '3.11'
commands:
- git fetch --unshallow || true
- pip install hatchling==1.25.0
- pip install hatch
- hatch run docs:build $READTHEDOCS_OUTPUT/html/

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Installation
============

[![Python package](https://github.com/chdemko/pandoc-latex-tip/workflows/Python%20package/badge.svg?branch=develop)](https://github.com/chdemko/pandoc-latex-tip/actions/workflows/python-package.yml)
[![Python package](https://img.shields.io/github/actions/workflow/status/chdemko/pandoc-latex-tip/python-package.yml?logo=github&branch=develop)](https://github.com/chdemko/pandoc-latex-tip/actions/workflows/python-package.yml)
[![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://pypi.org/project/black/)
[![Coveralls](https://img.shields.io/coveralls/github/chdemko/pandoc-latex-tip/develop.svg?logo=Codecov&logoColor=white)](https://coveralls.io/github/chdemko/pandoc-latex-tip?branch=develop)
[![Scrutinizer](https://img.shields.io/scrutinizer/g/chdemko/pandoc-latex-tip.svg?logo=scrutinizer)](https://scrutinizer-ci.com/g/chdemko/pandoc-latex-tip/)
[![Code Climate](https://codeclimate.com/github/chdemko/pandoc-latex-tip/badges/gpa.svg)](https://codeclimate.com/github/chdemko/pandoc-latex-tip/)
[![Code Climate](https://img.shields.io/codeclimate/maintainability/chdemko/pandoc-latex-tip?logo=codeclimate&barnch=develop)](https://codeclimate.com/github/chdemko/pandoc-latex-tip/)
[![CodeFactor](https://img.shields.io/codefactor/grade/github/chdemko/pandoc-latex-tip/develop.svg?logo=codefactor)](https://www.codefactor.io/repository/github/chdemko/pandoc-latex-tip)
[![Codacy](https://img.shields.io/codacy/grade/de425638e13b4ceab3bfad1c4557aa6c.svg?logo=codacy&logoColor=white)](https://app.codacy.com/gh/chdemko/pandoc-latex-tip/dashboard)
[![PyPI version](https://img.shields.io/pypi/v/pandoc-latex-tip.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pandoc-latex-tip/)
Expand All @@ -16,7 +16,7 @@ Installation
[![Downloads](https://img.shields.io/pypi/dm/pandoc-latex-tip?logo=pypi&logoColor=white)](https://pepy.tech/project/pandoc-latex-tip)
[![Development Status](https://img.shields.io/pypi/status/pandoc-latex-tip.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pandoc-numbering/)
[![Python version](https://img.shields.io/pypi/pyversions/pandoc-latex-tip.svg?logo=Python&logoColor=white)](https://pypi.org/project/pandoc-latex-tip/)
[![Pandoc version](https://img.shields.io/badge/pandoc-3.2%20|%203.3%20|%203.4%20|%203.5-blue.svg?logo=markdown)](https://pandoc.org/)
[![Pandoc version](https://img.shields.io/badge/pandoc-3.2%20..%203.6-blue.svg?logo=markdown)](https://pandoc.org/)
[![Latest release](https://img.shields.io/github/release-date/chdemko/pandoc-latex-tip.svg?logo=github)](https://github.com/chdemko/pandoc-latex-tip/releases)
[![Last commit](https://img.shields.io/github/last-commit/chdemko/pandoc-latex-tip/develop?logo=github)](https://github.com/chdemko/pandoc-latex-tip/commit/develop/)
[![Repo Size](https://img.shields.io/github/repo-size/chdemko/pandoc-latex-tip.svg?logo=github)](http://pandoc-latex-tip.readthedocs.io/en/latest/)
Expand Down
27 changes: 15 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "A pandoc filter for adding icons on specific elements"
readme = "README.md"
requires-python = ">=3.10,<3.14"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
license-files = {paths = ["LICENSE"]}
authors = [{name = "Christophe Demko", email = "[email protected]"}]
maintainers = [{name = "Christophe Demko", email = "[email protected]"}]
keywords = ["pandoc", "filters", "latex", "tip", "Font-Awesome", "icon"]
Expand Down Expand Up @@ -109,7 +109,7 @@ dependencies = [
"pydoclint[flake8]~=0.5",
"teyit~=0.4",
"refurb~=2.0",
"ruff~=0.7"
"ruff~=0.8"
]

[tool.hatch.envs.hatch-static-analysis.scripts]
Expand Down Expand Up @@ -216,21 +216,24 @@ arg-type-hints-in-docstring = false
style = "numpy"

[tool.mypy]
disallow_any_generics = true
disallow_subclassing_any = true
# disallow_untyped_calls = true
# disallow_untyped_defs = true
# disallow_incomplete_defs = true
# check_untyped_defs = true
disallow_untyped_decorators = true
ignore_missing_imports = true
no_implicit_optional = true
no_implicit_reexport = true
warn_redundant_casts = true
warn_return_any = true
# equivalent to --strict option
warn_unused_configs = true
disallow_any_generics = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
no_implicit_reexport = true
strict_equality = true
extra_checks = true
mypy_path = "src"

[[tool.mypy.overrides]]
ignore_missing_imports = true
Expand Down
63 changes: 32 additions & 31 deletions src/pandoc_latex_tip/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,18 +684,18 @@ def get_prefix_odd(position: str) -> str:
The latex prefix.
"""
if position == "right":
return "\\pandoclatextipoddright"
return "\\PandocLatexTipOddRight"
if position in ("left", ""):
return "\\pandoclatextipoddleft"
return "\\PandocLatexTipOddLeft"
if position == "inner":
return "\\pandoclatextipoddinner"
return "\\PandocLatexTipOddInner"
if position == "outer":
return "\\pandoclatextipoddouter"
return "\\PandocLatexTipOddOuter"
debug(
f"[WARNING] pandoc-latex-tip: {position}"
" is not a correct position; using left"
)
return "\\pandoclatextipoddleft"
return "\\PandocLatexTipOddLeft"


def get_prefix_even(position: str) -> str:
Expand All @@ -713,18 +713,18 @@ def get_prefix_even(position: str) -> str:
The latex prefix.
"""
if position == "right":
return "\\pandoclatextipevenright"
return "\\PandocLatexTipEvenRight"
if position in ("left", ""):
return "\\pandoclatextipevenleft"
return "\\PandocLatexTipEvenLeft"
if position == "inner":
return "\\pandoclatextipeveninner"
return "\\PandocLatexTipEvenInner"
if position == "outer":
return "\\pandoclatextipevenouter"
return "\\PandocLatexTipEvenOuter"
debug(
f"[WARNING] pandoc-latex-tip: {position}"
" is not a correct position; using left"
)
return "\\pandoclatextipevenleft"
return "\\PandocLatexTipEvenLeft"


def get_size(size: str) -> str:
Expand All @@ -741,16 +741,17 @@ def get_size(size: str) -> str:
str
The correct size.
"""
try:
int_value = int(size)
if int_value > 0:
size = str(int_value)
else:
debug(
f"[WARNING] pandoc-latex-tip: size must be greater than 0; using {size}"
)
except ValueError:
debug(f"[WARNING] pandoc-latex-tip: size must be a number; using {size}")
regex = re.compile("^(?P<length>\\d+(\\.\\d*)?)(pt|mm|cm|in|ex|em|mu|sp)?$")
if regex.match(size):
length = float(regex.match(size).group("length"))
if length <= 0:
debug("[WARNING] pandoc-latex-tip: size must be greater than 0; using 18")
return "18"
else:
debug(
"[WARNING] pandoc-latex-tip: size must be a correct LaTeX length; using 18"
)
return "18"
return size


Expand Down Expand Up @@ -939,21 +940,21 @@ def finalize(doc: Doc) -> None:
RawInline(
r"""
\makeatletter%
\newcommand{\pandoclatextipoddinner}{\reversemarginpar}%
\newcommand{\pandoclatextipeveninner}{\reversemarginpar}%
\newcommand{\pandoclatextipoddouter}{\normalmarginpar}%
\newcommand{\pandoclatextipevenouter}{\normalmarginpar}%
\newcommand{\pandoclatextipoddleft}{\reversemarginpar}%
\newcommand{\pandoclatextipoddright}{\normalmarginpar}%
\newcommand{\PandocLatexTipOddInner}{\reversemarginpar}%
\newcommand{\PandocLatexTipEvenInner}{\reversemarginpar}%
\newcommand{\PandocLatexTipOddOuter}{\normalmarginpar}%
\newcommand{\PandocLatexTipEvenOuter}{\normalmarginpar}%
\newcommand{\PandocLatexTipOddLeft}{\reversemarginpar}%
\newcommand{\PandocLatexTipOddRight}{\normalmarginpar}%
\if@twoside%
\newcommand{\pandoclatextipevenright}{\reversemarginpar}%
\newcommand{\pandoclatextipevenleft}{\normalmarginpar}%
\newcommand{\PandocLatexTipEvenRight}{\reversemarginpar}%
\newcommand{\PandocLatexTipEvenLeft}{\normalmarginpar}%
\else%
\newcommand{\pandoclatextipevenright}{\normalmarginpar}%
\newcommand{\pandoclatextipevenleft}{\reversemarginpar}%
\newcommand{\PandocLatexTipEvenRight}{\normalmarginpar}%
\newcommand{\PandocLatexTipEvenLeft}{\reversemarginpar}%
\fi%
\makeatother%
\checkoddpage
\checkoddpage%
""",
"tex",
)
Expand Down
Loading

0 comments on commit c2ec567

Please sign in to comment.