Skip to content

Commit 5584bb5

Browse files
committed
Moving to src
1 parent 33650c9 commit 5584bb5

File tree

13 files changed

+373
-2610
lines changed

13 files changed

+373
-2610
lines changed

.github/workflows/python-package.yml

Lines changed: 35 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -14,122 +14,94 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.10', '3.11', '3.12']
18-
poetry-version: [1.8.3]
19-
pandoc-version: ['3.3']
17+
python-version: ['3.10', '3.11', '3.12', '3.13']
18+
pandoc-version: ['3.5']
2019
steps:
2120
- uses: actions/checkout@v4
2221
- name: Set up Python ${{ matrix.python-version }}
2322
uses: actions/setup-python@v4
2423
with:
2524
python-version: ${{ matrix.python-version }}
26-
- name: Set up Poetry ${{ matrix.poetry-version }}
27-
uses: abatilo/actions-poetry@v2
28-
with:
29-
poetry-version: ${{ matrix.poetry-version }}
25+
- name: Install Hatch
26+
run: pipx install hatch
3027
- name: Install dependencies
3128
run: |
3229
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
3330
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
34-
poetry install
35-
- name: Test with tox
31+
- name: Test
3632
run: |
37-
poetry run tox -e py
33+
hatch test -py ${{ matrix.python-version }}
3834
39-
poetry:
35+
36+
pandoc:
4037
runs-on: ubuntu-latest
4138
strategy:
4239
matrix:
4340
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, 1.8.3]
45-
pandoc-version: ['3.3']
41+
pandoc-version: [2.11.4, '2.12', '2.13', 2.14.2, '2.15', 2.16.2, 2.17.1.1, '2.18', 2.19.2, 3.0.1, 3.1.13, 3.2.1, '3.3', '3.4', '3.5']
4642
steps:
47-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4844
- name: Set up Python ${{ matrix.python-version }}
4945
uses: actions/setup-python@v4
5046
with:
5147
python-version: ${{ matrix.python-version }}
52-
- name: Set up Poetry ${{ matrix.poetry-version }}
53-
uses: abatilo/actions-poetry@v2
54-
with:
55-
poetry-version: ${{ matrix.poetry-version }}
48+
- name: Install Hatch
49+
run: pipx install hatch
5650
- name: Install dependencies
5751
run: |
5852
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
5953
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
60-
poetry install
61-
- name: Test with tox
54+
- name: Test
6255
run: |
63-
poetry run tox -e py
56+
hatch test
6457
65-
pandoc:
58+
style:
6659
runs-on: ubuntu-latest
6760
strategy:
6861
matrix:
6962
python-version: ['3.12']
70-
poetry-version: [1.8.3]
71-
pandoc-version: [2.11.4, '2.12', '2.13', 2.14.2, '2.15', 2.16.2, 2.17.1.1, '2.18', 2.19.2, 3.0.1, 3.1.13, 3.2.1, '3.3']
63+
pandoc-version: ['3.5']
7264
steps:
7365
- uses: actions/checkout@v4
74-
- name: Set up Python ${{ matrix.python-version }}
66+
- name: Set up Python
7567
uses: actions/setup-python@v4
7668
with:
7769
python-version: ${{ matrix.python-version }}
78-
- name: Set up Poetry ${{ matrix.poetry-version }}
79-
uses: abatilo/actions-poetry@v2
80-
with:
81-
poetry-version: ${{ matrix.poetry-version }}
70+
- name: Install Hatch
71+
run: pipx install hatch
8272
- name: Install dependencies
8373
run: |
8474
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
8575
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
86-
poetry install
87-
- name: Test with tox
76+
- name: Static check
8877
run: |
89-
poetry run tox -e py
90-
91-
style:
92-
runs-on: ubuntu-latest
93-
steps:
94-
- uses: actions/checkout@v4
95-
- name: Set up Python
96-
uses: actions/setup-python@v4
97-
with:
98-
python-version: '3.12'
99-
- name: Set up Poetry
100-
uses: abatilo/actions-poetry@v2
101-
with:
102-
poetry-version: 1.8.3
103-
- name: Install dependencies
78+
hatch fmt --check
79+
- name: Dynamic check
10480
run: |
105-
poetry install
106-
- name: Test with tox
107-
run: |
108-
poetry run tox -e style
109-
poetry run tox -e linter
81+
hatch run lint:check
11082
11183
cov:
11284
runs-on: ubuntu-latest
85+
strategy:
86+
matrix:
87+
python-version: ['3.12']
88+
pandoc-version: ['3.5']
11389
steps:
11490
- uses: actions/checkout@v4
11591
- name: Set up Python
11692
uses: actions/setup-python@v4
11793
with:
118-
python-version: '3.12'
119-
- name: Set up Poetry
120-
uses: abatilo/actions-poetry@v2
121-
with:
122-
poetry-version: 1.8.3
94+
python-version: ${{ matrix.python-version }}
95+
- name: Install Hatch
96+
run: pipx install hatch
12397
- name: Install dependencies
12498
run: |
125-
wget https://github.com/jgm/pandoc/releases/download/3.3/pandoc-3.3-1-amd64.deb
126-
sudo dpkg -i ./pandoc-3.3-1-amd64.deb
127-
poetry install
99+
wget https://github.com/jgm/pandoc/releases/download/${{ matrix.pandoc-version }}/pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
100+
sudo dpkg -i ./pandoc-${{ matrix.pandoc-version }}-1-amd64.deb
128101
- name: Test
129102
env:
130103
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
131104
run: |
132-
poetry run tox -e coverage
133-
poetry run pip install coveralls
134-
poetry run coveralls
135-
105+
hatch test --cover
106+
hatch run pip install coveralls
107+
hatch run coveralls

.github/workflows/python-publish.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,24 @@ on:
1010
jobs:
1111
deploy:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: ['3.12']
1316
steps:
1417
- uses: actions/checkout@v4
1518
with:
1619
fetch-depth: 0
1720
- name: Set up Python
1821
uses: actions/setup-python@v4
1922
with:
20-
python-version: '3.12'
21-
- name: Set up Poetry
22-
uses: abatilo/actions-poetry@v2
23-
with:
24-
poetry-version: 1.8.3
25-
- name: Set up poetry-dynamic-versioning
26-
run: |
27-
poetry self add "poetry-dynamic-versioning[plugin]"
28-
- name: Install dependencies
29-
run: |
30-
poetry install
31-
poetry run pip install twine
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install Hatch
25+
run: pipx install hatch
3226
- name: Build and publish
3327
env:
34-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
35-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
36-
run: |
37-
poetry build
38-
poetry run twine upload dist/*
28+
HATCH_INDEX_USER: ${{ secrets.PYPI_USERNAME }}
29+
HATCH_INDEX_AUTH: ${{ secrets.PYPI_PASSWORD }}
30+
SETUPTOOLS_SCM_PRETEND_VERSION: ${{ github.ref_name }}
31+
run: |-
32+
hatch build -t wheel
33+
hatch publish dist/*.whl

.pre-commit-config.yaml

Lines changed: 22 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,43 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-toml
66
- id: check-yaml
77

8-
- repo: https://gitlab.com/smop/pre-commit-hooks
9-
rev: v1.0.0
10-
hooks:
11-
- id: check-poetry
12-
138
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
149
rev: v2.14.0
1510
hooks:
1611
- id: pretty-format-toml
17-
exclude: ^poetry.lock$
1812
args: [--autofix, --no-sort]
1913
- id: pretty-format-yaml
2014
args: [--autofix]
2115

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.19.0
29-
hooks:
30-
- id: slotscheck
31-
language: system
32-
exclude: ^(?!pandoc_codeblock_include/)
33-
34-
- repo: https://github.com/dosisod/refurb
35-
rev: v2.0.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.6.3
46-
hooks:
47-
- id: ruff
48-
language: system
49-
exclude: ^(?!pandoc_codeblock_include/)
50-
51-
- repo: https://github.com/psf/black
52-
rev: 24.8.0
53-
hooks:
54-
- id: black-jupyter
55-
args: [--config=pyproject.toml, pandoc_codeblock_include/, tests]
56-
57-
- repo: https://github.com/PyCQA/doc8/
58-
rev: v1.1.1
16+
- repo: https://github.com/asottile/pyupgrade
17+
rev: v3.18.0
5918
hooks:
60-
- id: doc8
61-
files: \.(rst|md)$
19+
- id: pyupgrade
20+
args: [--py310-plus]
6221

63-
- repo: https://github.com/pre-commit/mirrors-mypy
64-
rev: v1.11.2
22+
- repo: local
6523
hooks:
66-
- id: mypy
24+
- id: format
25+
name: format
26+
entry: hatch fmt --check
6727
language: system
68-
exclude: ^(?!pandoc_codeblock_include/)
69-
70-
- repo: https://github.com/pycqa/flake8
71-
rev: 7.1.1
72-
hooks:
73-
- id: flake8
28+
pass_filenames: false
29+
- id: lint
30+
name: lint
31+
entry: hatch run lint:check
7432
language: system
75-
exclude: ^(?!pandoc_codeblock_include/)
76-
77-
- repo: https://github.com/pre-commit/mirrors-pylint
78-
rev: v3.0.0a5
79-
hooks:
80-
- id: pylint
33+
pass_filenames: false
34+
- id: test
35+
name: test
36+
entry: hatch test
8137
language: system
82-
exclude: ^(?!pandoc_codeblock_include/)
83-
84-
- repo: https://github.com/asottile/pyupgrade
85-
rev: v3.17.0
86-
hooks:
87-
- id: pyupgrade
38+
pass_filenames: false
39+
- id: lock
40+
name: lock
41+
entry: uv lock --upgrade
8842
language: system
89-
args: [--py310-plus]
90-
43+
pass_filenames: false

.readthedocs.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,10 @@ build:
99
os: ubuntu-22.04
1010
tools:
1111
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-
# VIRTUAL_ENV needs to be set manually for now.
24-
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
25-
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
26-
27-
# Build documentation in the "docs/" directory with Sphinx
28-
sphinx:
29-
configuration: docs/conf.py
12+
commands:
13+
- git fetch --unshallow || true
14+
- pip install hatch
15+
- hatch run docs:build $READTHEDOCS_OUTPUT/html/
3016

3117
# Optionally build your docs in additional formats such as PDF and ePub
3218
formats:

README.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Installation
1515
[![Downloads](https://img.shields.io/pypi/dm/pandoc-codeblock-include?logo=pypi&logoColor=white)](https://pepy.tech/project/pandoc-codeblock-include)
1616
[![Development Status](https://img.shields.io/pypi/status/pandoc-codeblock-include.svg?logo=pypi&logoColor=white)](https://pypi.org/project/pandoc-codeblock-include/)
1717
[![Python version](https://img.shields.io/pypi/pyversions/pandoc-codeblock-include.svg?logo=Python&logoColor=white)](https://pypi.org/project/pandoc-codeblock-include/)
18-
[![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/)
19-
[![Pandoc version](https://img.shields.io/badge/pandoc-2.11%20|%202.12%20|%202.13%20|%202.14%20|%202.15%20|%202.16%20|%202.17%20|%202.18%20|%202.19%20|%203.0%20|%203.1%20|%203.2%20|%203.3-blue.svg?logo=markdown)](https://pandoc.org/)
18+
[![Pandoc version](https://img.shields.io/badge/pandoc-2.11%20|%202.12%20|%202.13%20|%202.14%20|%202.15%20|%202.16%20|%202.17%20|%202.18%20|%202.19%20|%203.0%20|%203.1%20|%203.2%20|%203.3%20|%203.4%20|%203.5-blue.svg?logo=markdown)](https://pandoc.org/)
2019
[![Latest release](https://img.shields.io/github/release-date/chdemko/pandoc-codeblock-include.svg?logo=github)](https://github.com/chdemko/pandoc-codeblock-include/releases)
2120
[![Last commit](https://img.shields.io/github/last-commit/chdemko/pandoc-codeblock-include/develop?logo=github)](https://github.com/chdemko/pandoc-codeblock-include/commit/develop/)
2221
[![Repo Size](https://img.shields.io/github/repo-size/chdemko/pandoc-codeblock-include.svg?logo=github)](http://pandoc-codeblock-include.readthedocs.io/en/latest/)
@@ -65,3 +64,34 @@ welcome to [file an issue] on github so that we can help.
6564

6665
[file an issue]: https://github.com/chdemko/pandoc-codeblock-include/issues
6766

67+
Contribute
68+
==========
69+
70+
Instructions
71+
------------
72+
73+
Install `hatch`, then run
74+
75+
~~~shell-session
76+
$ hatch run pip install pre-commit
77+
$ hatch run pre-commit install
78+
~~~
79+
80+
to install `pre-commit` before working on your changes.
81+
82+
Tests
83+
-----
84+
85+
When your changes are ready, run
86+
87+
~~~shell-session
88+
$ hatch test
89+
$ hatch fmt --check
90+
$ hatch run lint:check
91+
$ hatch run docs:build
92+
$ hatch build -t wheel
93+
~~~
94+
95+
for running the tests, checking the style, building the documentation
96+
and building the wheel.
97+

0 commit comments

Comments
 (0)