Skip to content

Commit a31b4bb

Browse files
authored
Use pyproject.toml, update gh actions
1 parent d424ed9 commit a31b4bb

File tree

18 files changed

+130
-72
lines changed

18 files changed

+130
-72
lines changed

.github/workflows/pythonpublish.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,10 @@ jobs:
3030
run: |
3131
git config --global user.name "Github Action"
3232
git config --global user.email "[email protected]"
33-
pip install -r tests/test_requirements.txt
34-
pip install mkdocs-material
33+
pip install -r requirements_dev.txt
3534
pip install .
3635
pytest
3736
38-
3937
- name: Build
4038
run: |
4139
python setup.py sdist bdist_wheel
@@ -46,5 +44,5 @@ jobs:
4644

4745
- name: Deploy mkdocs site
4846
run: |
49-
pip install mkdocs-git-authors-plugin
47+
pip install -r requirements_dev.txt
5048
mkdocs gh-deploy --force

.github/workflows/scheduled_unittests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ jobs:
2020
- name: Setup Python
2121
uses: actions/setup-python@master
2222
with:
23-
python-version: "3.11"
23+
python-version: "3.12"
2424

2525
- name: Install dependencies
2626
run: |
2727
pip3 install --upgrade pip
2828
pip3 install --upgrade setuptools
2929
pip3 install --upgrade wheel
30-
pip3 install -r tests/test_requirements.txt
30+
pip3 install -r requirements_dev.txt
3131
pip3 install .
3232
3333
- name: Run unit tests

.github/workflows/unittests.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@ jobs:
2323
pip3 install --upgrade pip
2424
pip3 install --upgrade setuptools
2525
pip3 install --upgrade wheel
26-
pip3 install pyflakes
27-
pip3 install -r tests/test_requirements.txt
26+
pip3 install -r requirements_dev.txt
2827
pip3 install .
2928
30-
- name: Static code checking with pyflakes
31-
run: |
32-
pyflakes mkdocs_git_revision_date_localized_plugin
33-
3429
- name: Run unit tests
3530
run: |
3631
git config --global user.name "Github Action"

.github/workflows/unittests_codecov.yml

+5-9
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ jobs:
3131
pip3 install --upgrade pip
3232
pip3 install --upgrade setuptools
3333
pip3 install --upgrade wheel
34-
pip3 install pyflakes
35-
pip3 install -r tests/test_requirements.txt
34+
pip install -r requirements_dev.txt
3635
pip3 install .
3736
38-
- name: Static code checking with pyflakes
39-
run: |
40-
pyflakes mkdocs_git_revision_date_localized_plugin
41-
4237
- name: Generate coverage report
4338
run: |
4439
git config --global user.name "Github Action"
@@ -47,9 +42,10 @@ jobs:
4742
4843
- name: Upload coverage to Codecov
4944
if: "contains(env.USING_COVERAGE, matrix.python-version)"
50-
uses: codecov/codecov-action@v1
45+
uses: codecov/codecov-action@v4
5146
with:
52-
token: ${{ secrets.CODECOV_TOKEN }}
53-
file: ./coverage.xml
47+
files: ./coverage.xml
5448
flags: unittests
5549
fail_ci_if_error: false
50+
env:
51+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

CONTRIBUTING.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,13 @@ Thanks for considering to contribute to this project! Some guidelines:
1212
Make sure to install an editable version before running the tests:
1313

1414
```python
15-
pip install -r tests/test_requirements.txt
15+
pip install -r requirement_dev.txt
1616
pip install -e .
1717
pytest --cov=mkdocs_git_revision_date_localized_plugin --cov-report term-missing tests/
1818
```
1919

2020
If it makes sense, writing tests for your PRs is always appreciated and will help get them merged.
2121

22-
In addition, this project uses [flake8](https://github.com/PyCQA/flake8) for static code checking:
23-
24-
```python
25-
pip install pyflakes
26-
pyflakes tests/ mkdocs_git_revision_date_localized_plugin/
27-
```
28-
2922
## Manual testing
3023

3124
To quickly serve a test website with your latest changes to the plugin use the sites in our tests suite.

mkdocs_git_revision_date_localized_plugin/__init__.py

Whitespace-only changes.

pyproject.toml

+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
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+
"git-revision-date-localized" = "mkdocs_git_revision_date_localized_plugin.plugin:GitRevisionDateLocalizedPlugin"
7+
8+
[project]
9+
name="mkdocs-git-revision-date-localized-plugin"
10+
keywords = ["mkdocs", "plugin"]
11+
authors = [
12+
{ name = "Tim Vink", email = "[email protected]" }
13+
]
14+
license = { text = "MIT" }
15+
16+
description="Mkdocs plugin that enables displaying the localized date of the last git modification of a markdown file."
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+
]
31+
32+
dynamic = ["version","dependencies","optional-dependencies"]
33+
34+
[project.urls]
35+
"Homepage" = "https://github.com/timvink/mkdocs-git-revision-date-localized-plugin"
36+
37+
[tool.setuptools.dynamic]
38+
version = {attr = "mkdocs_git_revision_date_localized_plugin.__version__"}
39+
40+
dependencies={file = ["requirements.txt"]}
41+
42+
optional-dependencies.dev={file = ["requirements_dev.txt"]}
43+
optional-dependencies.base={file = ["requirements.txt"]}
44+
optional-dependencies.all={file = ["requirements.txt", "requirements_dev.txt"]}
45+
46+
[tool.pytest.ini_options]
47+
markers = [
48+
"serial",
49+
"no_temp_caching",
50+
]
51+
52+
# https://github.com/charliermarsh/ruff
53+
[tool.ruff]
54+
55+
# Rules to apply
56+
lint.select= ["E", "F", "I", "UP"]
57+
58+
# Exclude rules
59+
lint.ignore = ['D104'
60+
,'D212'
61+
,'D200'
62+
,'D412'
63+
,'E731'
64+
,'E501'
65+
,'E722'
66+
,'D104'
67+
,'E402'
68+
,"UP038" # UP038 Use `X | Y` in `isinstance` call instead of `(X, Y)`
69+
]
70+
71+
# Exclude files in tests dir
72+
lint.exclude = [
73+
".bzr",
74+
".direnv",
75+
".eggs",
76+
".git",
77+
".hg",
78+
".mypy_cache",
79+
".nox",
80+
".pants.d",
81+
".pytype",
82+
".ruff_cache",
83+
".svn",
84+
".tox",
85+
".venv",
86+
"__pypackages__",
87+
"_build",
88+
"buck-out",
89+
"build",
90+
"dist",
91+
"node_modules",
92+
"venv",
93+
]
94+
95+
# Set line length, keep same as black
96+
line-length = 120
97+
98+
extend-exclude = [
99+
"*.yml",
100+
"*.toml",
101+
"*.md",
102+
".json",
103+
"Makefile",
104+
"*.txt",
105+
]
106+
107+
#supported for python 3.10
108+
target-version = "py310"
109+
110+
# Always autofix
111+
fix = true
112+
113+
[tool.uv]
114+
dev-dependencies = [
115+
"ruff",
116+
]

tests/test_requirements.txt requirements_dev.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ codecov
44
click
55
mkdocs-material
66
mkdocs-static-i18n
7-
mkdocs-gen-files
7+
mkdocs-gen-files
8+
mkdocs-git-authors-plugin

setup.py

-42
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.2.8"

0 commit comments

Comments
 (0)