Skip to content

Commit

Permalink
Merge branch 'release/3.4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
chdemko committed Jan 18, 2024
2 parents 2938320 + 4fb3065 commit 8e8327f
Show file tree
Hide file tree
Showing 23 changed files with 1,513 additions and 836 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ name: Python package

on:
push:
branches: [ develop ]
branches: [develop]
pull_request:
branches: [ develop ]
branches: [develop]

jobs:
python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.5.1"]
pandoc-version: ["3.1.3"]
python-version: ['3.9', '3.10', '3.11', '3.12']
poetry-version: [1.7.1]
pandoc-version: [3.1.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -40,11 +40,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.2.2", "1.3.2", "1.4.2", "1.5.1"]
pandoc-version: ["3.1.3"]
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.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -66,11 +66,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.5.1"]
pandoc-version: ["2.14.2", "2.15", "2.16.2", "2.17.1.1", "2.18", "2.19.2", "3.0.1", "3.1.3"]
python-version: ['3.12']
poetry-version: [1.7.1]
pandoc-version: [2.14.2, '2.15', 2.16.2, 2.17.1.1, '2.18', 2.19.2, 3.0.1, 3.1.9]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand All @@ -91,15 +91,15 @@ jobs:
style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
poetry-version: 1.7.1
- name: Install dependencies
run: |
poetry install
Expand All @@ -111,19 +111,19 @@ jobs:
cov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5.1'
poetry-version: 1.7.1
- name: Install dependencies
run: |
wget https://github.com/jgm/pandoc/releases/download/3.1.3/pandoc-3.1.3-1-amd64.deb
sudo dpkg -i ./pandoc-3.1.3-1-amd64.deb
wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
sudo dpkg -i ./pandoc-3.1.9-1-amd64.deb
poetry install
- name: Test
env:
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- name: Set up Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.5'
poetry-version: 1.7.1
- name: Install dependencies
run: |
poetry install
poetry run pip install twine
- name: Set up poetry-dynamic-versioning
run: |
poetry self add "poetry-dynamic-versioning[plugin]"
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
82 changes: 82 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.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.10.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.17.0
hooks:
- id: slotscheck
language: system
exclude: ^(?!pandoc_numbering.py)

- repo: https://github.com/dosisod/refurb
rev: v1.20.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.0.287
hooks:
- id: ruff
language: system
exclude: ^(?!pandoc_numbering.py)

- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black-jupyter
args: [--config=pyproject.toml, pandoc_numbering.py, 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.5.1
hooks:
- id: mypy
language: system
exclude: ^(?!pandoc_numbering.py)

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

- repo: https://github.com/pre-commit/mirrors-pylint
rev: v3.0.0a5
hooks:
- id: pylint
language: system
exclude: ^(?!pandoc_numbering.py)
26 changes: 15 additions & 11 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: '3.11'
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
- poetry self add "poetry-dynamic-versioning[plugin]"
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
configuration: docs/conf.py

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- htmlzip

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt

- htmlzip
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2015-2021, Christophe Demko
Copyright (c) 2015-2024, Christophe Demko
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
80 changes: 49 additions & 31 deletions README.md

Large diffs are not rendered by default.

31 changes: 13 additions & 18 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,25 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import importlib.metadata
import os
import sys

from datetime import date

sys.path.insert(0, os.path.abspath("../.."))

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

# -- Project information -----------------------------------------------------

project = "pandoc-numbering"
copyright = "2015-2023, Christophe Demko"
author = "Christophe Demko"
project, release = os.popen("poetry version").readline().strip().split(" ")
author = importlib.metadata.metadata(project)["Author"]
year = date.today().year
copyright = f"2015-{year}, {author}"

# The short X.Y version
version = "3.4"
# The full version, including alpha/beta/rc tags
release = "3.4.0.2"

version = ".".join(release.split(".")[:2])

# -- General configuration ---------------------------------------------------

Expand All @@ -45,9 +46,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'myst_parser'
]
extensions = ["myst_parser"]

# Add any paths that contain templates here, relative to this directory.
templates_path = []
Expand All @@ -57,8 +56,8 @@
#
# source_suffix = ['.rst', '.md']
source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
".rst": "restructuredtext",
".md": "markdown",
}


Expand All @@ -75,7 +74,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['images']
exclude_patterns = ["images"]

# The name of the Pygments (syntax highlighting) style to use.
# pygments_style = None
Expand All @@ -87,11 +86,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -113,4 +109,3 @@
# 'searchbox.html']``.
#
# html_sidebars = {}

Binary file modified docs/images/pandoc-numbering-sample.epub
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/images/pandoc-numbering-sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
class="pandoc-numbering-entry theorem">Theorem 2.2</span></a></li>
</ul>
<h1 id="this-is-the-first-section">This is the first section</h1>
<p><span id="exercise:1"></span><span id="exercise:1"
<p><span></span><span id="exercise:1"
class="pandoc-numbering-text exercise"><strong>Exercise
1</strong></span></p>
<p>This is the first exercise. Have also a look at the <a
Expand Down
Binary file modified docs/images/pandoc-numbering-sample.pdf
Binary file not shown.
Loading

0 comments on commit 8e8327f

Please sign in to comment.