Skip to content

Commit d55299f

Browse files
authoredMar 13, 2025··
migrate to uv
1 parent 033d84b commit d55299f

7 files changed

+1251
-50
lines changed
 

‎.github/workflows/pythonpublish.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,32 @@ on:
88
jobs:
99
deploy:
1010
runs-on: ubuntu-latest
11+
environment: release
1112
permissions:
1213
# IMPORTANT: this permission is mandatory for trusted publishing
1314
id-token: write
15+
contents: write
1416
steps:
1517
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: '0'
1620
- name: Set up Python
1721
uses: actions/setup-python@v5
1822
with:
1923
python-version: '3.x'
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
2427
- name: Make sure unit tests succeed
2528
run: |
26-
pip install ".[dev]"
27-
pytest
28-
- name: Build package
29+
git config --global user.name "Github Action"
30+
git config --global user.email "githubaction@gmail.com"
31+
uv run pytest
32+
33+
- name: Build
2934
run: |
30-
python -m build
35+
uv build
36+
3137
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/
3238
- name: Publish package distributions to PyPI
3339
uses: pypa/gh-action-pypi-publish@release/v1
34-

‎.github/workflows/unittests.yml

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,22 @@ jobs:
44
run:
55
name: Run unit tests
66
runs-on: ${{ matrix.os }}
7+
env:
8+
USING_COVERAGE: '3.10'
79
strategy:
8-
matrix:
10+
matrix:
911
os: [ubuntu-latest, macos-latest, windows-latest]
1012
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
1113
steps:
1214
- uses: actions/checkout@master
13-
- name: Setup Python
14-
uses: actions/setup-python@master
15+
16+
- name: Install uv and set the python version
17+
uses: astral-sh/setup-uv@v5
1518
with:
1619
python-version: ${{ matrix.python-version }}
17-
- name: Generate coverage report
20+
21+
- name: Run unit tests
1822
run: |
19-
pip install ".[dev]"
20-
pytest --cov=mkdocs_print_site_plugin --cov-report=xml
21-
23+
git config --global user.name "Github Action"
24+
git config --global user.email "githubaction@gmail.com"
25+
uv run pytest --cov=mkdocs_print_site_plugin --cov-report=xml

‎.github/workflows/unittests_codecov.yml

+14-9
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,31 @@ jobs:
1313
name: Run unit tests with codecov upload
1414
runs-on: ${{ matrix.os }}
1515
env:
16-
USING_COVERAGE: '3.9'
16+
USING_COVERAGE: '3.10'
1717
strategy:
18-
matrix:
18+
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
20+
python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"]
2121
steps:
2222
- uses: actions/checkout@master
23-
- name: Setup Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v5
23+
24+
- name: Install uv and set the python version
25+
uses: astral-sh/setup-uv@v5
2526
with:
2627
python-version: ${{ matrix.python-version }}
28+
2729
- name: Generate coverage report
2830
run: |
29-
pip install ".[dev]"
30-
pytest --cov=mkdocs_print_site_plugin --cov-report=xml -vvv
31+
git config --global user.name "Github Action"
32+
git config --global user.email "githubaction@gmail.com"
33+
uv run pytest --cov=mkdocs_print_site_plugin --cov-report=xml
34+
3135
- name: Upload coverage to Codecov
3236
if: "contains(env.USING_COVERAGE, matrix.python-version)"
3337
uses: codecov/codecov-action@v4
3438
with:
35-
token: ${{ secrets.CODECOV_TOKEN }}
36-
file: ./coverage.xml
39+
files: ./coverage.xml
3740
flags: unittests
3841
fail_ci_if_error: false
42+
env:
43+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

‎pyproject.toml

+18-11
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,17 @@ classifiers=[
3131
"Topic :: Text Processing",
3232
]
3333

34-
dynamic = ["version","dependencies","optional-dependencies"]
34+
dynamic = ["version"]
35+
dependencies = [
36+
"mkdocs-material>=7.3.0",
37+
]
3538

3639
[project.urls]
3740
"Homepage" = "https://github.com/timvink/mkdocs-print-site-plugin"
3841

3942
[tool.setuptools.dynamic]
4043
version = {attr = "mkdocs_print_site_plugin.__version__"}
4144

42-
dependencies={file = ["requirements.txt"]}
43-
44-
optional-dependencies.dev={file = ["requirements_dev.txt"]}
45-
optional-dependencies.base={file = ["requirements.txt"]}
46-
optional-dependencies.all={file = ["requirements.txt", "requirements_dev.txt"]}
47-
4845
[tool.pytest.ini_options]
4946
markers = [
5047
"integration: marks tests as integration, meaning they use databases (deselect with '-m \"not integration\"')",
@@ -113,7 +110,17 @@ target-version = "py310"
113110
# Always autofix
114111
fix = true
115112

116-
[tool.uv]
117-
dev-dependencies = [
118-
"ruff",
119-
]
113+
[dependency-groups]
114+
dev = [
115+
"click>=8.1.8",
116+
"mkdocs>=1.6.1",
117+
"mkdocs-charts-plugin>=0.0.12",
118+
"mkdocs-git-revision-date-localized-plugin>=1.4.4",
119+
"mkdocs-img2fig-plugin>=0.9.3",
120+
"mkdocs-material>=9.6.7",
121+
"mkdocs-windmill>=1.0.5",
122+
"pytest>=8.3.5",
123+
"pytest-cov>=5.0.0",
124+
"ruff>=0.9.10",
125+
]
126+

‎requirements.txt

-1
This file was deleted.

‎requirements_dev.txt

-13
This file was deleted.

‎uv.lock

+1,194
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.