Skip to content

Commit 8e8327f

Browse files
committed
Merge branch 'release/3.4.1.0'
2 parents 2938320 + 4fb3065 commit 8e8327f

23 files changed

Lines changed: 1513 additions & 836 deletions

.github/workflows/python-package.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ name: Python package
55

66
on:
77
push:
8-
branches: [ develop ]
8+
branches: [develop]
99
pull_request:
10-
branches: [ develop ]
10+
branches: [develop]
1111

1212
jobs:
1313
python:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11"]
18-
poetry-version: ["1.5.1"]
19-
pandoc-version: ["3.1.3"]
17+
python-version: ['3.9', '3.10', '3.11', '3.12']
18+
poetry-version: [1.7.1]
19+
pandoc-version: [3.1.9]
2020
steps:
21-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2222
- name: Set up Python ${{ matrix.python-version }}
2323
uses: actions/setup-python@v4
2424
with:
@@ -40,11 +40,11 @@ jobs:
4040
runs-on: ubuntu-latest
4141
strategy:
4242
matrix:
43-
python-version: ["3.11"]
44-
poetry-version: ["1.2.2", "1.3.2", "1.4.2", "1.5.1"]
45-
pandoc-version: ["3.1.3"]
43+
python-version: ['3.12']
44+
poetry-version: [1.2.2, 1.3.2, 1.4.2, 1.5.1, 1.6.1, 1.7.1]
45+
pandoc-version: [3.1.9]
4646
steps:
47-
- uses: actions/checkout@v3
47+
- uses: actions/checkout@v4
4848
- name: Set up Python ${{ matrix.python-version }}
4949
uses: actions/setup-python@v4
5050
with:
@@ -66,11 +66,11 @@ jobs:
6666
runs-on: ubuntu-latest
6767
strategy:
6868
matrix:
69-
python-version: ["3.11"]
70-
poetry-version: ["1.5.1"]
71-
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"]
69+
python-version: ['3.12']
70+
poetry-version: [1.7.1]
71+
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]
7272
steps:
73-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
7474
- name: Set up Python ${{ matrix.python-version }}
7575
uses: actions/setup-python@v4
7676
with:
@@ -91,15 +91,15 @@ jobs:
9191
style:
9292
runs-on: ubuntu-latest
9393
steps:
94-
- uses: actions/checkout@v3
94+
- uses: actions/checkout@v4
9595
- name: Set up Python
9696
uses: actions/setup-python@v4
9797
with:
98-
python-version: '3.11'
98+
python-version: '3.12'
9999
- name: Set up Poetry
100100
uses: abatilo/actions-poetry@v2
101101
with:
102-
poetry-version: '1.5.1'
102+
poetry-version: 1.7.1
103103
- name: Install dependencies
104104
run: |
105105
poetry install
@@ -111,19 +111,19 @@ jobs:
111111
cov:
112112
runs-on: ubuntu-latest
113113
steps:
114-
- uses: actions/checkout@v3
114+
- uses: actions/checkout@v4
115115
- name: Set up Python
116116
uses: actions/setup-python@v4
117117
with:
118-
python-version: '3.11'
118+
python-version: '3.12'
119119
- name: Set up Poetry
120120
uses: abatilo/actions-poetry@v2
121121
with:
122-
poetry-version: '1.5.1'
122+
poetry-version: 1.7.1
123123
- name: Install dependencies
124124
run: |
125-
wget https://github.com/jgm/pandoc/releases/download/3.1.3/pandoc-3.1.3-1-amd64.deb
126-
sudo dpkg -i ./pandoc-3.1.3-1-amd64.deb
125+
wget https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-1-amd64.deb
126+
sudo dpkg -i ./pandoc-3.1.9-1-amd64.deb
127127
poetry install
128128
- name: Test
129129
env:

.github/workflows/python-publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,24 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1719
- name: Set up Python
1820
uses: actions/setup-python@v4
1921
with:
20-
python-version: '3.11'
22+
python-version: '3.12'
2123
- name: Set up Poetry
2224
uses: abatilo/actions-poetry@v2
2325
with:
24-
poetry-version: '1.5'
26+
poetry-version: 1.7.1
2527
- name: Install dependencies
2628
run: |
2729
poetry install
2830
poetry run pip install twine
31+
- name: Set up poetry-dynamic-versioning
32+
run: |
33+
poetry self add "poetry-dynamic-versioning[plugin]"
2934
- name: Build and publish
3035
env:
3136
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

.pre-commit-config.yaml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: check-toml
6+
- id: check-yaml
7+
8+
- repo: https://gitlab.com/smop/pre-commit-hooks
9+
rev: v1.0.0
10+
hooks:
11+
- id: check-poetry
12+
13+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
14+
rev: v2.10.0
15+
hooks:
16+
- id: pretty-format-toml
17+
exclude: ^poetry.lock$
18+
args: [--autofix, --no-sort]
19+
- id: pretty-format-yaml
20+
args: [--autofix]
21+
22+
- repo: https://github.com/tox-dev/tox-ini-fmt
23+
rev: 1.3.1
24+
hooks:
25+
- id: tox-ini-fmt
26+
27+
- repo: https://github.com/ariebovenberg/slotscheck
28+
rev: v0.17.0
29+
hooks:
30+
- id: slotscheck
31+
language: system
32+
exclude: ^(?!pandoc_numbering.py)
33+
34+
- repo: https://github.com/dosisod/refurb
35+
rev: v1.20.0
36+
hooks:
37+
- id: refurb
38+
39+
- repo: https://github.com/isidentical/teyit
40+
rev: 0.4.3
41+
hooks:
42+
- id: teyit
43+
44+
- repo: https://github.com/astral-sh/ruff-pre-commit
45+
rev: v0.0.287
46+
hooks:
47+
- id: ruff
48+
language: system
49+
exclude: ^(?!pandoc_numbering.py)
50+
51+
- repo: https://github.com/psf/black
52+
rev: 23.7.0
53+
hooks:
54+
- id: black-jupyter
55+
args: [--config=pyproject.toml, pandoc_numbering.py, tests]
56+
57+
- repo: https://github.com/PyCQA/doc8/
58+
rev: v1.1.1
59+
hooks:
60+
- id: doc8
61+
args: [docs]
62+
63+
- repo: https://github.com/pre-commit/mirrors-mypy
64+
rev: v1.5.1
65+
hooks:
66+
- id: mypy
67+
language: system
68+
exclude: ^(?!pandoc_numbering.py)
69+
70+
- repo: https://github.com/pycqa/flake8
71+
rev: 6.1.0
72+
hooks:
73+
- id: flake8
74+
language: system
75+
exclude: ^(?!pandoc_numbering.py)
76+
77+
- repo: https://github.com/pre-commit/mirrors-pylint
78+
rev: v3.0.0a5
79+
hooks:
80+
- id: pylint
81+
language: system
82+
exclude: ^(?!pandoc_numbering.py)

.readthedocs.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,24 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.11"
11+
python: '3.11'
12+
jobs:
13+
post_create_environment:
14+
# Install poetry
15+
# https://python-poetry.org/docs/#installing-manually
16+
- pip install poetry
17+
- poetry self add "poetry-dynamic-versioning[plugin]"
18+
# Tell poetry to not use a virtual environment
19+
- poetry config virtualenvs.create false
20+
post_install:
21+
# Install dependencies with 'docs' dependency group
22+
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
23+
- poetry install --with docs
1224

1325
# Build documentation in the "docs/" directory with Sphinx
1426
sphinx:
15-
configuration: docs/conf.py
27+
configuration: docs/conf.py
1628

1729
# Optionally build your docs in additional formats such as PDF and ePub
1830
formats:
19-
- htmlzip
20-
21-
# Optional but recommended, declare the Python requirements required
22-
# to build your documentation
23-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
24-
python:
25-
install:
26-
- requirements: docs/requirements.txt
27-
31+
- htmlzip

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2015-2021, Christophe Demko
3+
Copyright (c) 2015-2024, Christophe Demko
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

Lines changed: 49 additions & 31 deletions
Large diffs are not rendered by default.

docs/conf.py

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@
1616
# import sys
1717
# sys.path.insert(0, os.path.abspath('.'))
1818

19+
import importlib.metadata
1920
import os
2021
import sys
2122

23+
from datetime import date
24+
2225
sys.path.insert(0, os.path.abspath("../.."))
2326

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

2629
# -- Project information -----------------------------------------------------
2730

28-
project = "pandoc-numbering"
29-
copyright = "2015-2023, Christophe Demko"
30-
author = "Christophe Demko"
31+
project, release = os.popen("poetry version").readline().strip().split(" ")
32+
author = importlib.metadata.metadata(project)["Author"]
33+
year = date.today().year
34+
copyright = f"2015-{year}, {author}"
3135

3236
# The short X.Y version
33-
version = "3.4"
34-
# The full version, including alpha/beta/rc tags
35-
release = "3.4.0.2"
36-
37+
version = ".".join(release.split(".")[:2])
3738

3839
# -- General configuration ---------------------------------------------------
3940

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

5251
# Add any paths that contain templates here, relative to this directory.
5352
templates_path = []
@@ -57,8 +56,8 @@
5756
#
5857
# source_suffix = ['.rst', '.md']
5958
source_suffix = {
60-
'.rst': 'restructuredtext',
61-
'.md': 'markdown',
59+
".rst": "restructuredtext",
60+
".md": "markdown",
6261
}
6362

6463

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

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

93-
html_theme = "sphinx_rtd_theme"
94-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
90+
html_theme = "sphinx_rtd_theme"
9591

9692
# Theme options are theme-specific and customize the look and feel of a theme
9793
# further. For a list of options available for each theme, see the
@@ -113,4 +109,3 @@
113109
# 'searchbox.html']``.
114110
#
115111
# html_sidebars = {}
116-
-19 Bytes
Binary file not shown.

docs/images/pandoc-numbering-sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
class="pandoc-numbering-entry theorem">Theorem 2.2</span></a></li>
3535
</ul>
3636
<h1 id="this-is-the-first-section">This is the first section</h1>
37-
<p><span id="exercise:1"></span><span id="exercise:1"
37+
<p><span></span><span id="exercise:1"
3838
class="pandoc-numbering-text exercise"><strong>Exercise
3939
1</strong></span></p>
4040
<p>This is the first exercise. Have also a look at the <a
-189 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)