Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@ jobs:
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -27,16 +31,14 @@ jobs:
run: |
git config --global user.name "Github Action"
git config --global user.email "[email protected]"
pip install -r tests/test_requirements.txt
pip install mkdocs-material
pip install .
pytest
- name: Build package
uv run pytest
- name: Build
run: |
python setup.py sdist bdist_wheel
uv build
# See https://docs.pypi.org/trusted-publishers/using-a-publisher/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@release/v1

- name: Deploy mkdocs site
run: |
mkdocs gh-deploy --force
uv run mkdocs gh-deploy --force
13 changes: 4 additions & 9 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Static code checking with pyflakes
run: |
pip install pyflakes
pyflakes mkdocs_git_authors_plugin

- name: Generate coverage report
run: |
pip install -r tests/test_requirements.txt
pip install -e .
pytest --cov=mkdocs_git_authors_plugin --cov-report=xml
uv run pytest --cov=mkdocs_git_authors_plugin --cov-report=xml
12 changes: 3 additions & 9 deletions .github/workflows/unittests_codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,13 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Static code checking with pyflakes
run: |
pip install pyflakes
pyflakes mkdocs_git_authors_plugin
- name: Generate coverage report
run: |
pip install -r tests/test_requirements.txt
pip install -e .
pytest --cov=mkdocs_git_authors_plugin --cov-report=xml
uv run pytest --cov=mkdocs_git_authors_plugin --cov-report=xml
- name: Upload coverage to Codecov
if: "contains(env.USING_COVERAGE, matrix.python-version)"
uses: codecov/codecov-action@v1
Expand Down
20 changes: 4 additions & 16 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,20 @@ Thanks for considering to contribute to this project! Some guidelines:

## Unit Tests

Make sure to install an editable version before running tests:
We use `uv`.

```python
pip install -r tests/test_requirements.txt
pip install -e .
pytest --cov=mkdocs_git_authors_plugin --cov-report term-missing tests
uv run pytest --cov=mkdocs_git_authors_plugin --cov-report term-missing tests
```

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

In addition, this project uses pyflakes for static code checking:

```python
pip install pyflakes
pyflakes tests/ mkdocs_git_authors_plugin/
```

## Manual testing

To quickly serve a website with your latest changes to the plugin use the sites in our tests suite. For example:

```python
pip install -r tests/test_requirements.txt
pip install -e .
mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material.yml
uv run mkdocs serve -f ./tests/basic_setup/mkdocs_complete_material.yml
```

## Code Style
Expand All @@ -43,11 +32,10 @@ Make sure your code *roughly* follows [PEP-8](https://www.python.org/dev/peps/pe

We use google-style docstrings.


## Documentation site

Manually deployed by Tim Vink using

```bash
mkdocs gh-deploy
uv run mkdocs gh-deploy
```
1 change: 1 addition & 0 deletions mkdocs_git_authors_plugin/git/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def _process_git_blame(self) -> None:
args.append("--ignore-revs-file")
args.append(self.repo().config("ignore_commits"))
args.append("--porcelain")
args.append("-w") # Ignore whitespace changes
args.append(str(self._path))
cmd = GitCommand("blame", args)
cmd.run()
Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "mkdocs-git-authors-plugin"
description = "Mkdocs plugin to display git authors of a page"
readme = { file = "README.md", content-type = "text/markdown" }
license = {text = "MIT"}
authors = [
{name = "Tim Vink", email = "[email protected]"}
]
keywords = ["mkdocs", "git", "contributors", "committers", "authors", "plugin"]
urls = {Homepage = "https://github.com/timvink/mkdocs-git-authors-plugin"}
version = "0.9.2"
requires-python = ">=3.8"
dependencies = ["mkdocs>=1.0"]
classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Topic :: Documentation",
"Topic :: Text Processing",
]

[project.entry-points."mkdocs.plugins"]
git-authors = "mkdocs_git_authors_plugin.plugin:GitAuthorsPlugin"

[dependency-groups]
dev = [
"click>=8.1.8",
"codecov>=2.1.13",
"gitpython>=3.1.44",
"mkapi!=2.0.*",
"mkdocs>=1.6.1",
"mkdocs-git-revision-date-localized-plugin>=1.4.4",
"mkdocs-macros-plugin>=1.3.7",
"mkdocs-material>=9.6.7",
"pytest>=8.3.5",
"pytest-cov>=5.0.0",
]
40 changes: 0 additions & 40 deletions setup.py

This file was deleted.

19 changes: 0 additions & 19 deletions tests/test_requirements.txt

This file was deleted.

Loading