Skip to content

Commit 326070b

Browse files
committed
chore: Template upgrade
1 parent 47868a1 commit 326070b

File tree

9 files changed

+53
-82
lines changed

9 files changed

+53
-82
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 0.7.0
2+
_commit: 0.8.1
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: pawamoy@pm.me
55
author_fullname: "Timoth\xE9e Mazzucotelli"

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ jobs:
7373
- macos-latest
7474
- windows-latest
7575
python-version:
76+
- "3.7"
7677
- "3.8"
7778
- "3.9"
7879
- "3.10"

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ A Python handler for mkdocstrings.
1010

1111
## Requirements
1212

13-
Python for mkdocstrings requires Python 3.6 or above.
13+
Python for mkdocstrings requires Python 3.7 or above.
1414

1515
<details>
16-
<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
16+
<summary>To install Python 3.7, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
1717

1818
```bash
1919
# install pyenv
@@ -24,24 +24,23 @@ export PATH="${HOME}/.pyenv/bin:${PATH}"
2424
export PYENV_ROOT="${HOME}/.pyenv"
2525
eval "$(pyenv init -)"
2626

27-
# install Python 3.6
28-
pyenv install 3.6.12
27+
# install Python 3.7
28+
pyenv install 3.7.12
2929

3030
# make it available globally
31-
pyenv global system 3.6.12
31+
pyenv global system 3.7.12
3232
```
3333
</details>
3434

3535
## Installation
3636

3737
With `pip`:
3838
```bash
39-
python3.6 -m pip install mkdocstrings-python
39+
pip install mkdocstrings-python
4040
```
4141

4242
With [`pipx`](https://github.com/pipxproject/pipx):
4343
```bash
44-
python3.6 -m pip install --user pipx
45-
46-
pipx install --python python3.6 mkdocstrings-python
44+
python3.7 -m pip install --user pipx
45+
pipx install mkdocstrings-python
4746
```

config/mypy.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
ignore_missing_imports = true
33
exclude = tests/fixtures/
44
warn_unused_ignores = true
5+
show_error_codes = true

docs/gen_ref_nav.py

100644100755
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
nav = mkdocs_gen_files.Nav()
88

99
for path in sorted(Path("src").glob("**/*.py")):
10-
# if str(path) in exclude:
11-
# continue
1210
module_path = path.relative_to("src").with_suffix("")
1311
doc_path = path.relative_to("src").with_suffix(".md")
1412
full_doc_path = Path("reference", doc_path)

duties.py

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sys
77
import tempfile
88
from contextlib import suppress
9-
from functools import wraps
109
from io import StringIO
1110
from pathlib import Path
1211
from typing import List, Optional, Pattern
@@ -43,7 +42,6 @@ def update_changelog(
4342
marker: str,
4443
version_regex: str,
4544
template_url: str,
46-
commit_style: str,
4745
) -> None:
4846
"""
4947
Update the given changelog file in place.
@@ -53,15 +51,16 @@ def update_changelog(
5351
marker: The line after which to insert new contents.
5452
version_regex: A regular expression to find currently documented versions in the file.
5553
template_url: The URL to the Jinja template used to render contents.
56-
commit_style: The style of commit messages to parse.
5754
"""
5855
from git_changelog.build import Changelog
56+
from git_changelog.commit import AngularStyle
5957
from jinja2.sandbox import SandboxedEnvironment
6058

59+
AngularStyle.DEFAULT_RENDER.insert(0, AngularStyle.TYPES["build"])
6160
env = SandboxedEnvironment(autoescape=False)
6261
template_text = urlopen(template_url).read().decode("utf8") # noqa: S310
6362
template = env.from_string(template_text)
64-
changelog = Changelog(".", style=commit_style)
63+
changelog = Changelog(".", style="angular")
6564

6665
if len(changelog.versions_list) == 1:
6766
last_version = changelog.versions_list[0]
@@ -101,7 +100,6 @@ def changelog(ctx):
101100
"marker": "<!-- insertion marker -->",
102101
"version_regex": r"^## \[v?(?P<version>[^\]]+)",
103102
"template_url": template_url,
104-
"commit_style": "angular",
105103
},
106104
title="Updating changelog",
107105
pty=PTY,
@@ -169,32 +167,7 @@ def safety(): # noqa: WPS430
169167
ctx.run(safety, title="Checking dependencies")
170168

171169

172-
def no_docs_py36(nofail=True):
173-
"""
174-
Decorate a duty that builds docs to warn that it's not possible on Python 3.6.
175-
176-
Arguments:
177-
nofail: Whether to fail or not.
178-
179-
Returns:
180-
The decorated function.
181-
"""
182-
183-
def decorator(func):
184-
@wraps(func)
185-
def wrapper(ctx):
186-
if sys.version_info <= (3, 7, 0):
187-
ctx.run(["false"], title="Docs can't be built on Python 3.6", nofail=nofail, quiet=True)
188-
else:
189-
func(ctx)
190-
191-
return wrapper
192-
193-
return decorator
194-
195-
196170
@duty
197-
@no_docs_py36()
198171
def check_docs(ctx):
199172
"""
200173
Check if the documentation builds correctly.
@@ -282,7 +255,6 @@ def clean(ctx):
282255

283256

284257
@duty
285-
@no_docs_py36(nofail=False)
286258
def docs(ctx):
287259
"""
288260
Build the documentation locally.
@@ -294,7 +266,6 @@ def docs(ctx):
294266

295267

296268
@duty
297-
@no_docs_py36(nofail=False)
298269
def docs_serve(ctx, host="127.0.0.1", port=8000):
299270
"""
300271
Serve the documentation (localhost:8000).
@@ -308,7 +279,6 @@ def docs_serve(ctx, host="127.0.0.1", port=8000):
308279

309280

310281
@duty
311-
@no_docs_py36(nofail=False)
312282
def docs_deploy(ctx):
313283
"""
314284
Deploy the documentation on GitHub pages.

pyproject.toml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "A Python handler for mkdocstrings."
88
authors = [{name = "Timothée Mazzucotelli", email = "pawamoy@pm.me"}]
99
license = {file = "LICENSE"}
1010
readme = "README.md"
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.7"
1212
keywords = []
1313
dynamic = ["version"]
1414
classifiers = [
@@ -18,6 +18,7 @@ classifiers = [
1818
"Programming Language :: Python",
1919
"Programming Language :: Python :: 3",
2020
"Programming Language :: Python :: 3 :: Only",
21+
"Programming Language :: Python :: 3.7",
2122
"Programming Language :: Python :: 3.8",
2223
"Programming Language :: Python :: 3.9",
2324
"Programming Language :: Python :: 3.10",
@@ -47,53 +48,54 @@ version = {use_scm = true}
4748
includes = ["src/mkdocstrings"]
4849

4950
[tool.pdm.dev-dependencies]
50-
duty = ["duty~=0.7"]
51+
duty = ["duty>=0.7"]
5152
docs = [
52-
"mkdocs~=1.2",
53-
"mkdocs-coverage~=0.2",
54-
"mkdocs-gen-files~=0.3",
55-
"mkdocs-literate-nav~=0.4",
56-
"mkdocs-material~=8.0",
57-
"mkdocstrings~=0.16",
58-
"toml~=0.10",
53+
"mkdocs>=1.2",
54+
"mkdocs-coverage>=0.2",
55+
"mkdocs-gen-files>=0.3",
56+
"mkdocs-literate-nav>=0.4",
57+
"mkdocs-material>=7.3",
58+
"mkdocs-section-index>=0.3",
59+
"mkdocstrings>=0.16",
60+
"toml>=0.10",
5961
]
6062
format = [
61-
"autoflake~=1.4",
62-
"black~=21.10b0",
63-
"isort~=5.10",
63+
"autoflake>=1.4",
64+
"black>=21.10b0",
65+
"isort>=5.10",
6466
]
6567
maintain = [
6668
# TODO: remove this section when git-changelog is more powerful
67-
"git-changelog~=0.4",
69+
"git-changelog>=0.4",
6870
]
6971
quality = [
70-
"darglint~=1.8",
71-
"flake8-bandit~=2.1",
72-
"flake8-black~=0.2",
73-
"flake8-bugbear~=21.9",
74-
"flake8-builtins~=1.5",
75-
"flake8-comprehensions~=3.7",
76-
"flake8-docstrings~=1.6",
77-
"flake8-pytest-style~=1.5",
78-
"flake8-string-format~=0.3",
79-
"flake8-tidy-imports~=4.5",
80-
"flake8-variables-names~=0.0",
81-
"pep8-naming~=0.12",
82-
"wps-light~=0.15",
72+
"darglint>=1.8",
73+
"flake8-bandit>=2.1",
74+
"flake8-black>=0.2",
75+
"flake8-bugbear>=21.9",
76+
"flake8-builtins>=1.5",
77+
"flake8-comprehensions>=3.7",
78+
"flake8-docstrings>=1.6",
79+
"flake8-pytest-style>=1.5",
80+
"flake8-string-format>=0.3",
81+
"flake8-tidy-imports>=4.5",
82+
"flake8-variables-names>=0.0",
83+
"pep8-naming>=0.12",
84+
"wps-light>=0.15",
8385
]
8486
tests = [
85-
"pytest~=6.2",
86-
"pytest-cov~=3.0",
87-
"pytest-randomly~=3.10",
88-
"pytest-sugar~=0.9",
89-
"pytest-xdist~=2.4",
87+
"pytest>=6.2",
88+
"pytest-cov>=3.0",
89+
"pytest-randomly>=3.10",
90+
"pytest-sugar>=0.9",
91+
"pytest-xdist>=2.4",
9092
]
9193
typing = [
92-
"mypy~=0.910",
93-
"types-markdown~=3.3",
94-
"types-toml~=0.10",
94+
"mypy>=0.910",
95+
"types-markdown>=3.3",
96+
"types-toml>=0.10",
9597
]
96-
security = ["safety~=1.10"]
98+
security = ["safety>=1.10"]
9799

98100
[tool.black]
99101
line-length = 120

scripts/multirun.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
PYTHON_VERSIONS="${PYTHON_VERSIONS-3.8 3.9 3.10 3.11}"
4+
PYTHON_VERSIONS="${PYTHON_VERSIONS-3.7 3.8 3.9 3.10 3.11}"
55

66
if [ -n "${PYTHON_VERSIONS}" ]; then
77
for python_version in ${PYTHON_VERSIONS}; do

scripts/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
PYTHON_VERSIONS="${PYTHON_VERSIONS-3.8 3.9 3.10 3.11}"
4+
PYTHON_VERSIONS="${PYTHON_VERSIONS-3.7 3.8 3.9 3.10 3.11}"
55

66
install_with_pipx() {
77
if ! command -v "$1" &>/dev/null; then

0 commit comments

Comments
 (0)