Skip to content

Commit d4340de

Browse files
committed
feat: support pdm and uv
1 parent 3bbedea commit d4340de

8 files changed

Lines changed: 2974 additions & 974 deletions

File tree

.github/workflows/codestyle.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,12 @@ jobs:
1515
with:
1616
python-version: ${{ matrix.python-version }}
1717
allow-prereleases: true
18+
- uses: astral-sh/setup-uv@v6
1819
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
20+
run: uv sync --all-extras --all-groups
2221
- name: Lint with flake8
2322
run: |
24-
pip install flake8
2523
# stop the build if there are code styling problems. The GitHub editor is 127 chars wide.
2624
flake8 . --count --max-line-length=127 --show-source --statistics
2725
- name: Check type hints
28-
run: |
29-
pip install mypy lxml-stubs
30-
mypy .
26+
run: mypy .

.github/workflows/test.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,9 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
allow-prereleases: true
28-
- name: Install Dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install -r requirements.txt
32-
python setup.py install
28+
- uses: astral-sh/setup-uv@v6
29+
- name: Install dependencies
30+
run: uv sync --all-extras
3331
- name: Test
3432
run: python tests/runtests.py
3533

@@ -39,11 +37,8 @@ jobs:
3937
steps:
4038
- uses: actions/checkout@v4
4139
- uses: actions/setup-python@v5
42-
- name: Install Dependencies
43-
run: |
44-
python3.7 -m ensurepip
45-
python3.7 -m pip install --upgrade pip
46-
pip install -r requirements.txt
47-
python3.7 setup.py install
40+
- uses: astral-sh/setup-uv@v6
41+
- name: Install dependencies
42+
run: uv sync --all-extras
4843
- name: Test
4944
run: python3.7 tests/runtests.py

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ target/
6363

6464
#Pycharm
6565
.idea
66+
.pdm-python

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ Please see tests/inline_image.py for an example.
286286
Sub-documents
287287
-------------
288288

289+
> Need to install with the subdoc extra: `pip install "docxtpl[subdoc]"`
290+
289291
A template variable can contain a complex subdoc object and be built from scratch using python-docx document methods.
290292
To do so, first, get the sub-document object from your template object, then use it by treating it as a python-docx document object.
291293
See example in `tests/subdoc.py`.

pdm.lock

Lines changed: 874 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

poetry.lock

Lines changed: 486 additions & 954 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers=[
2020
]
2121
keywords = ["jinja2"]
2222
dependencies = [
23-
"python-docx (>=1.1.2,<2)",
23+
"python-docx",
2424
"jinja2",
2525
"lxml",
2626
]
@@ -30,7 +30,11 @@ subdoc = ["docxcompose"]
3030
docs = ["Sphinx", "sphinxcontrib-napoleon"]
3131

3232
[dependency-groups]
33-
dev = ["mypy", "lxml-stubs", "flake8"]
33+
dev = [
34+
"mypy >=1.17.0; python_version >= '3.9'",
35+
"lxml-stubs >=0.5.1; python_version >= '3.9'",
36+
"flake8 >=7.3.0; python_version >= '3.9'"
37+
]
3438

3539
[project.urls]
3640
homepage = "https://github.com/elapouya/python-docx-template"

uv.lock

Lines changed: 1596 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)