Skip to content

Commit c328088

Browse files
committed
chore: Template upgrade
1 parent 6383fde commit c328088

File tree

12 files changed

+156
-128
lines changed

12 files changed

+156
-128
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.9.2
2+
_commit: 0.9.7
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli

.github/FUNDING.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
github:
2-
- pawamoy
3-
ko_fi: pawamoy
4-
liberapay: pawamoy
5-
patreon: pawamoy
2+
- pawamoy
63
custom:
7-
- https://www.paypal.me/pawamoy
4+
- https://www.paypal.me/pawamoy

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
key: tests-cache-${{ runner.os }}-${{ matrix.python-version }}
106106

107107
- name: Install dependencies
108-
run: pdm install -G duty -G docs -G tests
108+
run: pdm install --no-editable -G duty -G docs -G tests
109109

110110
- name: Run the test suite
111111
run: pdm run duty test

CONTRIBUTING.md

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ cd python-legacy
1414
make setup
1515
```
1616

17-
!!! note
18-
If it fails for some reason,
19-
you'll need to install
20-
[PDM](https://github.com/pdm-project/pdm)
21-
manually.
22-
23-
You can install it with:
24-
25-
```bash
26-
python3 -m pip install --user pipx
27-
pipx install pdm
28-
```
29-
30-
Now you can try running `make setup` again,
31-
or simply `pdm install`.
17+
> NOTE:
18+
> If it fails for some reason,
19+
> you'll need to install
20+
> [PDM](https://github.com/pdm-project/pdm)
21+
> manually.
22+
>
23+
> You can install it with:
24+
>
25+
> ```bash
26+
> python3 -m pip install --user pipx
27+
> pipx install pdm
28+
> ```
29+
>
30+
> Now you can try running `make setup` again,
31+
> or simply `pdm install`.
3232
3333
You now have the dependencies installed.
3434
@@ -55,17 +55,14 @@ As usual:
5555
1. create a new branch: `git checkout -b feature-or-bugfix-name`
5656
1. edit the code and/or the documentation
5757
58-
If you updated the documentation or the project dependencies:
59-
60-
1. run `make docs-regen`
61-
1. run `make docs-serve`,
62-
go to http://localhost:8000 and check that everything looks good
63-
6458
**Before committing:**
6559
6660
1. run `make format` to auto-format the code
6761
1. run `make check` to check everything (fix any warning)
6862
1. run `make test` to run the tests (fix any issue)
63+
1. if you updated the documentation or the project dependencies:
64+
1. run `make docs-serve`
65+
1. go to http://localhost:8000 and check that everything looks good
6966
1. follow our [commit message convention](#commit-message-convention)
7067
7168
If you are unsure about how to fix or ignore a warning,

README.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,6 @@
88

99
A legacy Python handler for mkdocstrings.
1010

11-
## Requirements
12-
13-
mkdocstrings-python (legacy) requires Python 3.7 or above.
14-
15-
<details>
16-
<summary>To install Python 3.7, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
17-
18-
```bash
19-
# install pyenv
20-
git clone https://github.com/pyenv/pyenv ~/.pyenv
21-
22-
# setup pyenv (you should also put these three lines in .bashrc or similar)
23-
export PATH="${HOME}/.pyenv/bin:${PATH}"
24-
export PYENV_ROOT="${HOME}/.pyenv"
25-
eval "$(pyenv init -)"
26-
27-
# install Python 3.7
28-
pyenv install 3.7.12
29-
30-
# make it available globally
31-
pyenv global system 3.7.12
32-
```
33-
</details>
34-
3511
## Installation
3612

3713
With `pip`:

docs/credits.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```python exec="yes"
2+
--8<-- "scripts/gen_credits.py"
3+
```

docs/gen_credits.py

Lines changed: 0 additions & 62 deletions
This file was deleted.

docs/gen_ref_nav.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,25 @@
66

77
nav = mkdocs_gen_files.Nav()
88

9-
for path in sorted(Path("src").glob("**/*.py")):
9+
for path in sorted(Path("src").rglob("*.py")):
1010
module_path = path.relative_to("src").with_suffix("")
1111
doc_path = path.relative_to("src").with_suffix(".md")
1212
full_doc_path = Path("reference", doc_path)
1313

14-
parts = list(module_path.parts)
14+
parts = tuple(module_path.parts)
15+
1516
if parts[-1] == "__init__":
1617
parts = parts[:-1]
1718
doc_path = doc_path.with_name("index.md")
1819
full_doc_path = full_doc_path.with_name("index.md")
1920
elif parts[-1] == "__main__":
2021
continue
21-
nav_parts = list(parts)
22-
nav[nav_parts] = doc_path
22+
23+
nav[parts] = doc_path.as_posix()
2324

2425
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
2526
ident = ".".join(parts)
26-
print("::: " + ident, file=fd)
27+
fd.write(f"::: {ident}")
2728

2829
mkdocs_gen_files.set_edit_path(full_doc_path, path)
2930

mkdocs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ site_url: "https://mkdocstrings.github.io/python-legacy"
44
repo_url: "https://github.com/mkdocstrings/python-legacy"
55
repo_name: "mkdocstrings/python-legacy"
66
site_dir: "site"
7+
watch: [README.md, CONTRIBUTING.md, CHANGELOG.md, src]
78

89
nav:
910
- Home:
@@ -26,6 +27,7 @@ theme:
2627
logo: material/currency-sign
2728
features:
2829
- navigation.tabs
30+
- navigation.tabs.sticky
2931
- navigation.top
3032
palette:
3133
- media: "(prefers-color-scheme: light)"
@@ -49,6 +51,7 @@ extra_css:
4951

5052
markdown_extensions:
5153
- admonition
54+
- callouts
5255
- pymdownx.emoji
5356
- pymdownx.magiclink
5457
- pymdownx.snippets:
@@ -62,22 +65,20 @@ markdown_extensions:
6265

6366
plugins:
6467
- search
68+
- markdown-exec
6569
- gen-files:
6670
scripts:
67-
- docs/gen_credits.py
6871
- docs/gen_ref_nav.py
6972
- literate-nav:
7073
nav_file: SUMMARY.md
71-
- section-index
7274
- coverage
75+
- section-index
7376
- mkdocstrings:
7477
handlers:
7578
python:
7679
paths: [src, docs]
7780
import:
7881
- https://mkdocstrings.github.io/objects.inv
79-
watch:
80-
- src/mkdocstrings_handlers
8182

8283
extra:
8384
social:

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ build-backend = "pdm.pep517.api"
66
name = "mkdocstrings-python-legacy"
77
description = "A legacy Python handler for mkdocstrings."
88
authors = [{name = "Timothée Mazzucotelli", email = "[email protected]"}]
9-
license = {file = "LICENSE"}
9+
license-expression = "ISC"
1010
readme = "README.md"
1111
requires-python = ">=3.7"
1212
keywords = []
1313
dynamic = ["version"]
1414
classifiers = [
1515
"Development Status :: 4 - Beta",
1616
"Intended Audience :: Developers",
17-
"License :: OSI Approved :: ISC License (ISCL)",
1817
"Programming Language :: Python",
1918
"Programming Language :: Python :: 3",
2019
"Programming Language :: Python :: 3 :: Only",
@@ -52,12 +51,14 @@ editable-backend = "editables"
5251
[tool.pdm.dev-dependencies]
5352
duty = ["duty>=0.7"]
5453
docs = [
55-
"mkdocs>=1.2",
54+
"mkdocs>=1.3",
5655
"mkdocs-coverage>=0.2",
5756
"mkdocs-gen-files>=0.3",
5857
"mkdocs-literate-nav>=0.4",
5958
"mkdocs-material>=7.3",
6059
"mkdocs-section-index>=0.3",
60+
"markdown-callouts>=0.2",
61+
"markdown-exec>=0.5",
6162
"toml>=0.10",
6263
]
6364
format = [
@@ -66,7 +67,6 @@ format = [
6667
"isort>=5.10",
6768
]
6869
maintain = [
69-
# TODO: remove this section when git-changelog is more powerful
7070
"git-changelog>=0.4",
7171
]
7272
quality = [
@@ -88,7 +88,6 @@ tests = [
8888
"pytest>=6.2",
8989
"pytest-cov>=3.0",
9090
"pytest-randomly>=3.10",
91-
"pytest-sugar>=0.9",
9291
"pytest-xdist>=2.4",
9392
]
9493
typing = [

0 commit comments

Comments
 (0)