Skip to content

Commit 492cff6

Browse files
committed
chore: Template upgrade
1 parent 9b9b3fc commit 492cff6

18 files changed

+335
-176
lines changed

.copier-answers.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Changes here will be overwritten by Copier
2-
_commit: 0.4.4
2+
_commit: 0.10.2
33
_src_path: gh:pawamoy/copier-pdm
44
author_email: [email protected]
5-
author_fullname: "Timoth\xE9e Mazzucotelli"
5+
author_fullname: Timothée Mazzucotelli
66
author_username: pawamoy
77
copyright_date: '2020'
8-
copyright_holder: "Timoth\xE9e Mazzucotelli"
8+
copyright_holder: Timothée Mazzucotelli
99
copyright_holder_email: [email protected]
1010
copyright_license: ISC License
1111
project_description: Automatic Changelog generator using Jinja2 templates.
@@ -17,3 +17,4 @@ repository_name: git-changelog
1717
repository_namespace: pawamoy
1818
repository_provider: github.com
1919
use_precommit: false
20+

.github/FUNDING.yml

+2-5
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

+7-8
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: actions/checkout@v2
2929

3030
- name: Set up PDM
31-
uses: pdm-project/setup-pdm@v2.5
31+
uses: pdm-project/setup-pdm@v2.6
3232
with:
3333
python-version: "3.8"
3434

@@ -50,15 +50,13 @@ jobs:
5050
run: pdm lock
5151

5252
- name: Install dependencies
53-
run: |
54-
pdm install -G duty -G docs -G quality -G typing
55-
pip install safety
53+
run: pdm install -G duty -G docs -G quality -G typing -G security
5654

5755
- name: Check if the documentation builds correctly
5856
run: pdm run duty check-docs
5957

6058
- name: Check the code quality
61-
run: pdm run duty check-code-quality
59+
run: pdm run duty check-quality
6260

6361
- name: Check if the code is correctly typed
6462
run: pdm run duty check-types
@@ -75,10 +73,11 @@ jobs:
7573
- macos-latest
7674
- windows-latest
7775
python-version:
78-
- "3.6"
7976
- "3.7"
8077
- "3.8"
8178
- "3.9"
79+
- "3.10"
80+
- "3.11-dev"
8281

8382
runs-on: ${{ matrix.os }}
8483

@@ -87,7 +86,7 @@ jobs:
8786
uses: actions/checkout@v2
8887

8988
- name: Set up PDM
90-
uses: pdm-project/setup-pdm@v2.5
89+
uses: pdm-project/setup-pdm@v2.6
9190
with:
9291
python-version: ${{ matrix.python-version }}
9392

@@ -106,7 +105,7 @@ jobs:
106105
key: tests-cache-${{ runner.os }}-${{ matrix.python-version }}
107106

108107
- name: Install dependencies
109-
run: pdm install -G duty -G tests
108+
run: pdm install --no-editable -G duty -G tests
110109

111110
- name: Run the test suite
112111
run: pdm run duty test

.gitpod.dockerfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM gitpod/workspace-full
2+
USER gitpod
3+
ENV PIP_USER=no
4+
ENV PYTHON_VERSIONS=
5+
RUN pip3 install pipx; \
6+
pipx install pdm; \
7+
pipx ensurepath

.gitpod.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vscode:
2+
extensions:
3+
- ms-python.python
4+
5+
image:
6+
file: .gitpod.dockerfile
7+
8+
ports:
9+
- port: 8000
10+
onOpen: notify
11+
12+
tasks:
13+
- init: make setup

CONTRIBUTING.md

+18-21
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ cd git-changelog
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
@@ -57,17 +57,14 @@ As usual:
5757
1. create a new branch: `git checkout -b feature-or-bugfix-name`
5858
1. edit the code and/or the documentation
5959
60-
If you updated the documentation or the project dependencies:
61-
62-
1. run `make docs-regen`
63-
1. run `make docs-serve`,
64-
go to http://localhost:8000 and check that everything looks good
65-
6660
**Before committing:**
6761
6862
1. run `make format` to auto-format the code
6963
1. run `make check` to check everything (fix any warning)
7064
1. run `make test` to run the tests (fix any issue)
65+
1. if you updated the documentation or the project dependencies:
66+
1. run `make docs-serve`
67+
1. go to http://localhost:8000 and check that everything looks good
7168
1. follow our [commit message convention](#commit-message-convention)
7269
7370
If you are unsure about how to fix or ignore a warning,

Makefile

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ SHELL := bash
44
DUTY = $(shell [ -n "${VIRTUAL_ENV}" ] || echo pdm run) duty
55

66
args = $(foreach a,$($(subst -,_,$1)_args),$(if $(value $a),$a="$($a)"))
7-
check_code_quality_args = files
7+
check_quality_args = files
88
docs_serve_args = host port
99
release_args = version
1010
test_args = match
1111

1212
BASIC_DUTIES = \
1313
changelog \
14+
check-dependencies \
1415
clean \
1516
coverage \
1617
docs \
@@ -21,9 +22,7 @@ BASIC_DUTIES = \
2122
release
2223

2324
QUALITY_DUTIES = \
24-
check \
25-
check-code-quality \
26-
check-dependencies \
25+
check-quality \
2726
check-docs \
2827
check-types \
2928
test
@@ -32,10 +31,19 @@ QUALITY_DUTIES = \
3231
help:
3332
@$(DUTY) --list
3433

34+
.PHONY: lock
35+
lock:
36+
@pdm lock
37+
3538
.PHONY: setup
3639
setup:
3740
@bash scripts/setup.sh
3841

42+
.PHONY: check
43+
check:
44+
@bash scripts/multirun.sh duty check-quality check-types check-docs
45+
@$(DUTY) check-dependencies
46+
3947
.PHONY: $(BASIC_DUTIES)
4048
$(BASIC_DUTIES):
4149
@$(DUTY) $@ $(call args,$@)

README.md

+4-28
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![ci](https://github.com/pawamoy/git-changelog/workflows/ci/badge.svg)](https://github.com/pawamoy/git-changelog/actions?query=workflow%3Aci)
44
[![documentation](https://img.shields.io/badge/docs-mkdocs%20material-blue.svg?style=flat)](https://pawamoy.github.io/git-changelog/)
55
[![pypi version](https://img.shields.io/pypi/v/git-changelog.svg)](https://pypi.org/project/git-changelog/)
6+
[![gitpod](https://img.shields.io/badge/gitpod-workspace-blue.svg?style=flat)](https://gitpod.io/#https://github.com/pawamoy/git-changelog)
67
[![gitter](https://badges.gitter.im/join%20chat.svg)](https://gitter.im/git-changelog/community)
78

89
Automatic Changelog generator using Jinja2 templates. From git logs to change logs.
@@ -48,42 +49,17 @@ Automatic Changelog generator using Jinja2 templates. From git logs to change lo
4849
[issue-17]: https://github.com/pawamoy/git-changelog/issues/17
4950
[issue-19]: https://github.com/pawamoy/git-changelog/issues/19
5051

51-
## Requirements
52-
53-
git-changelog requires Python 3.6 or above.
54-
55-
<details>
56-
<summary>To install Python 3.6, I recommend using <a href="https://github.com/pyenv/pyenv"><code>pyenv</code></a>.</summary>
57-
58-
```bash
59-
# install pyenv
60-
git clone https://github.com/pyenv/pyenv ~/.pyenv
61-
62-
# setup pyenv (you should also put these three lines in .bashrc or similar)
63-
export PATH="${HOME}/.pyenv/bin:${PATH}"
64-
export PYENV_ROOT="${HOME}/.pyenv"
65-
eval "$(pyenv init -)"
66-
67-
# install Python 3.6
68-
pyenv install 3.6.12
69-
70-
# make it available globally
71-
pyenv global system 3.6.12
72-
```
73-
</details>
74-
7552
## Installation
7653

7754
With `pip`:
7855
```bash
79-
python3.6 -m pip install git-changelog
56+
pip install git-changelog
8057
```
8158

8259
With [`pipx`](https://github.com/pipxproject/pipx):
8360
```bash
84-
python3.6 -m pip install --user pipx
85-
86-
pipx install --python python3.6 git-changelog
61+
python3.7 -m pip install --user pipx
62+
pipx install git-changelog
8763
```
8864

8965
## Usage (command-line)

config/flake8.ini

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ ignore =
1010
D105
1111
# multi-line docstring summary should start at the first line
1212
D212
13+
# does not support Parameters sections
14+
D417
1315
# whitespace before ':' (incompatible with Black)
1416
E203
1517
# redundant with E0602 (undefined variable)

config/mypy.ini

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
[mypy]
22
ignore_missing_imports = true
33
exclude = tests/fixtures/
4-
5-
[mypy-toml]
6-
ignore_missing_imports = true
7-
8-
[mypy-pkg_resources]
9-
ignore_missing_imports = true
4+
warn_unused_ignores = true
5+
show_error_codes = true

docs/credits.md

+3
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_ref_nav.py

100644100755
+14-7
Original file line numberDiff line numberDiff line change
@@ -6,18 +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("")
11-
doc_path = path.relative_to("src", "git_changelog").with_suffix(".md")
11+
doc_path = path.relative_to("src").with_suffix(".md")
1212
full_doc_path = Path("reference", doc_path)
1313

14-
parts = list(module_path.parts)
15-
parts[-1] = f"{parts[-1]}.py"
16-
nav[parts] = doc_path
14+
parts = tuple(module_path.parts)
15+
16+
if parts[-1] == "__init__":
17+
parts = parts[:-1]
18+
doc_path = doc_path.with_name("index.md")
19+
full_doc_path = full_doc_path.with_name("index.md")
20+
elif parts[-1] == "__main__":
21+
continue
22+
23+
nav[parts] = doc_path.as_posix()
1724

1825
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
19-
ident = ".".join(module_path.parts)
20-
print("::: " + ident, file=fd)
26+
ident = ".".join(parts)
27+
fd.write(f"::: {ident}")
2128

2229
mkdocs_gen_files.set_edit_path(full_doc_path, path)
2330

0 commit comments

Comments
 (0)