Skip to content

Commit 319398b

Browse files
authored
Merge pull request #121 from timvink/toml
Update to pyproject.toml structure
2 parents d876f02 + 122b172 commit 319398b

27 files changed

+133
-64
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@ jobs:
2323
pip install setuptools wheel twine
2424
- name: Make sure unit tests succeed
2525
run: |
26-
pip install -r tests/test_requirements.txt
27-
pip install .
26+
pip install ".[dev]""
2827
pytest
2928
- name: Build package
3029
run: |
31-
python setup.py sdist bdist_wheel
30+
python -m build
3231
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/
3332
- name: Publish package distributions to PyPI
3433
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/unittests.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@ jobs:
1414
uses: actions/setup-python@master
1515
with:
1616
python-version: ${{ matrix.python-version }}
17-
- name: Static code checking with pyflakes
18-
run: |
19-
pip install pyflakes
20-
pyflakes mkdocs_print_site_plugin
2117
- name: Generate coverage report
2218
run: |
23-
pip install -r tests/test_requirements.txt
24-
pip install .
25-
pytest --cov=mkdocs_print_site_plugin --cov-report=xml
19+
pip install ".[dev]"
20+
pytest --cov=mkdocs_print_site_plugin --cov-report=xml
21+

.github/workflows/unittests_codecov.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ jobs:
2424
uses: actions/setup-python@v5
2525
with:
2626
python-version: ${{ matrix.python-version }}
27-
- name: Static code checking with pyflakes
28-
run: |
29-
pip install pyflakes
30-
pyflakes mkdocs_print_site_plugin
3127
- name: Generate coverage report
3228
run: |
33-
pip install -r tests/test_requirements.txt
34-
pip install .
29+
pip install ".[dev]"
3530
pytest --cov=mkdocs_print_site_plugin --cov-report=xml -vvv
3631
- name: Upload coverage to Codecov
3732
if: "contains(env.USING_COVERAGE, matrix.python-version)"

mkdocs_print_site_plugin/__init__.py

Whitespace-only changes.

pyproject.toml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
[build-system]
2+
requires = ["setuptools>=70.0", "setuptools-scm>=8.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project.entry-points."mkdocs.plugins"]
6+
"print-site" = "mkdocs_print_site_plugin.plugin:PrintSitePlugin"
7+
8+
[project]
9+
name="mkdocs-print-site-plugin"
10+
keywords = ["mkdocs", "plugin","print","pdf"]
11+
authors = [
12+
{ name = "Tim Vink", email = "vinktim@gmail.com" }
13+
]
14+
license = { text = "MIT" }
15+
16+
description="MkDocs plugin that combines all pages into one, allowing for easy export to PDF and standalone HTML."
17+
readme = { file = "README.md", content-type = "text/markdown" }
18+
19+
requires-python=">=3.8"
20+
21+
classifiers=[
22+
"Operating System :: OS Independent",
23+
"Programming Language :: Python",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3.8",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
29+
"License :: OSI Approved :: MIT License",
30+
"Topic :: Documentation",
31+
"Topic :: Text Processing",
32+
]
33+
34+
dynamic = ["version","dependencies","optional-dependencies"]
35+
36+
[project.urls]
37+
"Homepage" = "https://github.com/timvink/mkdocs-print-site-plugin"
38+
39+
[tool.setuptools.dynamic]
40+
version = {attr = "mkdocs_print_site_plugin.__version__"}
41+
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+
48+
[tool.pytest.ini_options]
49+
markers = [
50+
"integration: marks tests as integration, meaning they use databases (deselect with '-m \"not integration\"')",
51+
"serial",
52+
"no_temp_caching",
53+
]
54+
55+
# https://github.com/charliermarsh/ruff
56+
[tool.ruff]
57+
58+
# Rules to apply
59+
lint.select= ["E", "F", "I", "UP"]
60+
61+
# Exclude rules
62+
lint.ignore = ['D104'
63+
,'D212'
64+
,'D200'
65+
,'D412'
66+
,'E731'
67+
,'E501'
68+
,'E722'
69+
,'D104'
70+
,'E402'
71+
,"UP038" # UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
72+
]
73+
74+
# Exclude files in tests dir
75+
lint.exclude = [
76+
".bzr",
77+
".direnv",
78+
".eggs",
79+
".git",
80+
".hg",
81+
".mypy_cache",
82+
".nox",
83+
".pants.d",
84+
".pytype",
85+
".ruff_cache",
86+
".svn",
87+
".tox",
88+
".venv",
89+
"__pypackages__",
90+
"_build",
91+
"buck-out",
92+
"build",
93+
"dist",
94+
"node_modules",
95+
"venv",
96+
]
97+
98+
# Set line length, keep same as black
99+
line-length = 120
100+
101+
extend-exclude = [
102+
"*.yml",
103+
"*.toml",
104+
"*.md",
105+
".json",
106+
"Makefile",
107+
"*.txt",
108+
]
109+
110+
#supported for python 3.10
111+
target-version = "py310"
112+
113+
# Always autofix
114+
fix = true
115+
116+
[tool.uv]
117+
dev-dependencies = [
118+
"ruff",
119+
]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mkdocs-material>=7.3.0
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
mkdocs
22
mkdocs-material
3-
pyflakes
3+
mkdocs-git-revision-date-localized-plugin
4+
# building the package
5+
build
6+
# testing
47
pytest
58
pytest-cov
69
click
7-
# docs
8-
mkdocs-git-revision-date-localized-plugin
10+
# testing for compatibility
911
mkdocs-windmill
1012
mkdocs-img2fig-plugin
11-
mkdocs-charts-plugin
13+
mkdocs-charts-plugin

setup.py

Lines changed: 0 additions & 44 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "2.6.0"

0 commit comments

Comments
 (0)