Skip to content

Commit 2d0613d

Browse files
committed
chore: Template upgrade
1 parent fa3494a commit 2d0613d

File tree

14 files changed

+663
-271
lines changed

14 files changed

+663
-271
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: 309bc30
2+
_commit: 4aa16ef
33
_src_path: gh:pawamoy/copier-poetry
44
author_email: pawamoy@pm.me
55
author_fullname: "Timoth\xE9e Mazzucotelli"

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pip-wheel-metadata/
1111
.pytest_cache/
1212
input.json
1313
poetry.lock
14-
.mypy_cache
14+
.mypy_cache/
1515
.tox/
1616
site/
17-
17+
.venv/

CHANGELOG.md

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
<!-- insertion marker -->
8-
## [v0.7.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.7.0) - 2020-07-24
8+
## [0.7.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.7.0) - 2020-07-24
99

10-
<small>[Compare with v0.6.0](https://github.com/pawamoy/pytkdocs/compare/v0.6.0...v0.7.0)</small>
10+
<small>[Compare with 0.6.0](https://github.com/pawamoy/pytkdocs/compare/0.6.0...0.7.0)</small>
1111

1212
### Bug Fixes
1313
- Fix code detecting dataclass fields ([4c4a18b](https://github.com/pawamoy/pytkdocs/commit/4c4a18b881865c3182eef77a95ef1a6b1f1a5b6d) by Timothée Mazzucotelli).
@@ -18,33 +18,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1818
- Add support for Marshmallow models ([c250466](https://github.com/pawamoy/pytkdocs/commit/c250466e219edf24d2f85b7337b5670e6f27a724) by Stu Fisher). References: [#51](https://github.com/pawamoy/pytkdocs/issues/51)
1919

2020

21-
## [v0.6.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.6.0) - 2020-06-14
21+
## [0.6.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.6.0) - 2020-06-14
2222

23-
<small>[Compare with v0.5.2](https://github.com/pawamoy/pytkdocs/compare/v0.5.2...v0.6.0)</small>
23+
<small>[Compare with 0.5.2](https://github.com/pawamoy/pytkdocs/compare/0.5.2...0.6.0)</small>
2424

2525
### Features
2626
- Support attributes sections for Google-style docstrings ([02c0042](https://github.com/pawamoy/pytkdocs/commit/02c0042f9d4d8ab799550418d8474d1a6669feec) by Timothée Mazzucotelli).
2727

2828

29-
## [v0.5.2](https://github.com/pawamoy/pytkdocs/releases/tag/v0.5.2) - 2020-06-11
29+
## [0.5.2](https://github.com/pawamoy/pytkdocs/releases/tag/0.5.2) - 2020-06-11
3030

31-
<small>[Compare with v0.5.1](https://github.com/pawamoy/pytkdocs/compare/v0.5.1...v0.5.2)</small>
31+
<small>[Compare with 0.5.1](https://github.com/pawamoy/pytkdocs/compare/0.5.1...0.5.2)</small>
3232

3333
### Bug Fixes
3434
- Ignore exceptions when trying to unwrap ([02ba876](https://github.com/pawamoy/pytkdocs/commit/02ba8762716c416499bdd4d4834c5de35bca23cb) by Timothée Mazzucotelli). References: [#45](https://github.com/pawamoy/pytkdocs/issues/45)
3535

3636

37-
## [v0.5.1](https://github.com/pawamoy/pytkdocs/releases/tag/v0.5.1) - 2020-06-09
37+
## [0.5.1](https://github.com/pawamoy/pytkdocs/releases/tag/0.5.1) - 2020-06-09
3838

39-
<small>[Compare with v0.5.0](https://github.com/pawamoy/pytkdocs/compare/v0.5.0...v0.5.1)</small>
39+
<small>[Compare with 0.5.0](https://github.com/pawamoy/pytkdocs/compare/0.5.0...0.5.1)</small>
4040

4141
### Bug Fixes
4242
- Fix parsing tuple unpacking assignment ([6535fe8](https://github.com/pawamoy/pytkdocs/commit/6535fe813b6c4b756d1d481f097208c52470da6a) by Timothée Mazzucotelli). References: [#43](https://github.com/pawamoy/pytkdocs/issues/43)
4343

4444

45-
## [v0.5.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.5.0) - 2020-06-08
45+
## [0.5.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.5.0) - 2020-06-08
4646

47-
<small>[Compare with v0.4.0](https://github.com/pawamoy/pytkdocs/compare/v0.4.0...v0.5.0)</small>
47+
<small>[Compare with 0.4.0](https://github.com/pawamoy/pytkdocs/compare/0.4.0...0.5.0)</small>
4848

4949
### Bug Fixes
5050
- Fix getting documentation for wrapped objects ([09f38a5](https://github.com/pawamoy/pytkdocs/commit/09f38a501edde2963af50130c11ff38107d14367) by Timothée Mazzucotelli). References: [#32](https://github.com/pawamoy/pytkdocs/issues/32)
@@ -64,9 +64,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6464
- As a consequence of the attribute parser refactor: pick attributes without docstrings. References: [#11](https://github.com/pawamoy/pytkdocs/issues/11)
6565

6666

67-
## [v0.4.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.4.0) - 2020-05-17
67+
## [0.4.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.4.0) - 2020-05-17
6868

69-
<small>[Compare with v0.3.0](https://github.com/pawamoy/pytkdocs/compare/v0.3.0...v0.4.0)</small>
69+
<small>[Compare with 0.3.0](https://github.com/pawamoy/pytkdocs/compare/0.3.0...0.4.0)</small>
7070

7171
### Bug Fixes
7272
- Never attempt to parse a null docstring ([aa92668](https://github.com/pawamoy/pytkdocs/commit/aa926686c9f3b9922968387ec68e3a1caeee08a7) by Timothée Mazzucotelli). References: [#37](https://github.com/pawamoy/pytkdocs/issues/37)
@@ -82,9 +82,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
8282
- Add dataclass and pydantic support ([a172ad8](https://github.com/pawamoy/pytkdocs/commit/a172ad88ee3b1735ee4ad0c91f3274c359e1e82e) by Shyam Dwaraknath). References: [#9](https://github.com/pawamoy/pytkdocs/issues/9), [#27](https://github.com/pawamoy/pytkdocs/issues/27)
8383

8484

85-
## [v0.3.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.3.0) - 2020-04-10
85+
## [0.3.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.3.0) - 2020-04-10
8686

87-
<small>[Compare with v0.2.1](https://github.com/pawamoy/pytkdocs/compare/v0.2.1...v0.3.0)</small>
87+
<small>[Compare with 0.2.1](https://github.com/pawamoy/pytkdocs/compare/0.2.1...0.3.0)</small>
8888

8989
### Bug Fixes
9090
- Fix parsing of `*args` and `**kwargs` ([b81c93e](https://github.com/pawamoy/pytkdocs/commit/b81c93eef2435f2ed1d70b4d7c3946caa564c59e) by adrienhenry). Related issues/PRs: [#20](https://github.com/pawamoy/pytkdocs/issues/20), [#21](https://github.com/pawamoy/pytkdocs/issues/21)
@@ -93,18 +93,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9393
- Support different indentations and complex markup in docstrings sections ([2f53082](https://github.com/pawamoy/pytkdocs/commit/2f53082dbd2bcb72423d4aff0cb3bf4319476be7) by Timothée Mazzucotelli). Related issues/PRs: [#17](https://github.com/pawamoy/pytkdocs/issues/17)
9494

9595

96-
## [v0.2.1](https://github.com/pawamoy/pytkdocs/releases/tag/v0.2.1) - 2020-04-07
96+
## [0.2.1](https://github.com/pawamoy/pytkdocs/releases/tag/0.2.1) - 2020-04-07
9797

98-
<small>[Compare with v0.2.0](https://github.com/pawamoy/pytkdocs/compare/v0.2.0...v0.2.1)</small>
98+
<small>[Compare with 0.2.0](https://github.com/pawamoy/pytkdocs/compare/0.2.0...0.2.1)</small>
9999

100100
### Bug Fixes
101101
- Fix forward refs replacement for python > 3.6 ([6a90aca](https://github.com/pawamoy/pytkdocs/commit/6a90aca346209fe2a4e3eec6bfb45f353bce679f) by Timothée Mazzucotelli).
102102
- Handle exception parsing error ([d6561f8](https://github.com/pawamoy/pytkdocs/commit/d6561f86362e7a9d8c45471f1d6eb5deffd5e0c8) by Timothée Mazzucotelli). Related issues/PRs: [#16](https://github.com/pawamoy/pytkdocs/issues/16)
103103

104104

105-
## [v0.2.0](https://github.com/pawamoy/py-tkdocs/releases/tag/v0.2.0) - 2020-03-27
105+
## [0.2.0](https://github.com/pawamoy/py-tkdocs/releases/tag/0.2.0) - 2020-03-27
106106

107-
<small>[Compare with v0.1.2](https://github.com/pawamoy/pytkdocs/compare/v0.1.2...V0.2.0)</small>
107+
<small>[Compare with 0.1.2](https://github.com/pawamoy/pytkdocs/compare/0.1.2...V0.2.0)</small>
108108

109109
### Added
110110
- Add members and filters options ([7af68cc](https://github.com/pawamoy/py-tkdocs/commit/7af68ccffe51557853899a04b5ce5610891d9228)).
@@ -119,26 +119,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
119119
- the docstring `parsing_errors` value was moved from `obj.docstring.parsing_errors` to `obj.docstring_errors`,
120120

121121

122-
## [v0.1.2](https://github.com/pawamoy/pytkdocs/releases/tag/v0.1.2) - 2020-03-23
122+
## [0.1.2](https://github.com/pawamoy/pytkdocs/releases/tag/0.1.2) - 2020-03-23
123123

124-
<small>[Compare with v0.1.1](https://github.com/pawamoy/pytkdocs/compare/v0.1.1...v0.1.2)</small>
124+
<small>[Compare with 0.1.1](https://github.com/pawamoy/pytkdocs/compare/0.1.1...0.1.2)</small>
125125

126126
### Fixed
127127
- Catch error when trying to get builtins module file path ([48df6bc](https://github.com/pawamoy/pytkdocs/commit/48df6bc9cf878f3ce281fac6ccaf8fe1d4e89c84)).
128128

129-
## [v0.1.1](https://github.com/pawamoy/pytkdocs/releases/tag/v0.1.1) - 2020-03-21
129+
## [0.1.1](https://github.com/pawamoy/pytkdocs/releases/tag/0.1.1) - 2020-03-21
130130

131-
<small>[Compare with v0.1.0](https://github.com/pawamoy/pytkdocs/compare/v0.1.0...v0.1.1)</small>
131+
<small>[Compare with 0.1.0](https://github.com/pawamoy/pytkdocs/compare/0.1.0...0.1.1)</small>
132132

133133
### Fixed
134134

135135
- Fix 'no parsing_errors attribute in Docstring' error ([0c8a986](https://github.com/pawamoy/pytkdocs/commit/0c8a986a05efe35caebb67d66320ced813065ae4)).
136136
- Handle `KeyError` when searching for param type annotation in signature ([b87fe78](https://github.com/pawamoy/pytkdocs/commit/b87fe78fc5201bac8d54fa70ebb53476480a4126)).
137137

138138

139-
## [v0.1.0](https://github.com/pawamoy/pytkdocs/releases/tag/v0.1.0) - 2020-03-20
139+
## [0.1.0](https://github.com/pawamoy/pytkdocs/releases/tag/0.1.0) - 2020-03-20
140140

141-
<small>[Compare with first commit](https://github.com/pawamoy/pytkdocs/compare/dce21c1b7e15e44529d3cd3ff0fc33f88328de5d...v0.1.0)</small>
141+
<small>[Compare with first commit](https://github.com/pawamoy/pytkdocs/compare/dce21c1b7e15e44529d3cd3ff0fc33f88328de5d...0.1.0)</small>
142142

143143
### Added
144144

Makefile

Lines changed: 31 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,37 @@
11
.DEFAULT_GOAL := help
2+
SHELL := bash
3+
4+
INVOKE_OR_POETRY = $(shell ! command -v invoke &>/dev/null && echo poetry run) invoke
5+
INVOKE_AND_POETRY = $(shell [ ! -n "${VIRTUAL_ENV}" ] && echo poetry run) invoke
6+
7+
POETRY_TASKS = \
8+
changelog \
9+
check \
10+
check-code-quality \
11+
check-dependencies \
12+
check-docs \
13+
check-types \
14+
combine \
15+
coverage \
16+
docs \
17+
docs-deploy \
18+
docs-regen \
19+
docs-serve \
20+
format \
21+
release \
22+
test
23+
24+
INVOKE_TASKS = \
25+
clean \
26+
setup
227

3-
PY_SRC := src/ tests/ scripts/
4-
CI ?= false
5-
TESTING ?= false
6-
7-
.PHONY: changelog
8-
changelog: ## Update the changelog in-place with latest commits.
9-
@poetry run failprint -t "Updating changelog" -- python scripts/update_changelog.py \
10-
CHANGELOG.md "<!-- insertion marker -->" "^## \[(?P<version>[^\]]+)"
11-
12-
.PHONY: check
13-
check: check-docs check-code-quality check-types check-dependencies ## Check it all!
14-
15-
.PHONY: check-code-quality
16-
check-code-quality: ## Check the code quality.
17-
@poetry run failprint -t "Checking code quality" -- flake8 --config=config/flake8.ini $(PY_SRC)
18-
19-
.PHONY: check-dependencies
20-
check-dependencies: ## Check for vulnerabilities in dependencies.
21-
@SAFETY=safety; \
22-
if ! $(CI); then \
23-
if ! command -v $$SAFETY &>/dev/null; then \
24-
SAFETY="pipx run safety"; \
25-
fi; \
26-
fi; \
27-
poetry export -f requirements.txt --without-hashes | \
28-
poetry run failprint --no-pty -t "Checking dependencies" -- $$SAFETY check --stdin --full-report
29-
30-
.PHONY: check-docs
31-
check-docs: ## Check if the documentation builds correctly.
32-
@poetry run failprint -t "Building documentation" -- mkdocs build -s
33-
34-
.PHONY: check-types
35-
check-types: ## Check that the code is correctly typed.
36-
@poetry run failprint -t "Type-checking" -- mypy --config-file config/mypy.ini $(PY_SRC)
37-
38-
.PHONY: clean
39-
clean: ## Delete temporary files.
40-
@rm -rf build 2>/dev/null
41-
@rm -rf .coverage* 2>/dev/null
42-
@rm -rf dist 2>/dev/null
43-
@rm -rf .mypy_cache 2>/dev/null
44-
@rm -rf pip-wheel-metadata 2>/dev/null
45-
@rm -rf .pytest_cache 2>/dev/null
46-
@rm -rf src/*.egg-info 2>/dev/null
47-
@rm -rf src/pytkdocs/__pycache__ 2>/dev/null
48-
@rm -rf scripts/__pycache__ 2>/dev/null
49-
@rm -rf site 2>/dev/null
50-
@rm -rf tests/__pycache__ 2>/dev/null
51-
@find . -name "*.rej" -delete 2>/dev/null
52-
53-
.PHONY: docs
54-
docs: docs-regen ## Build the documentation locally.
55-
@poetry run mkdocs build
56-
57-
.PHONY: docs-regen
58-
docs-regen: ## Regenerate some documentation pages.
59-
@poetry run python scripts/regen_docs.py
60-
61-
.PHONY: docs-serve
62-
docs-serve: docs-regen ## Serve the documentation (localhost:8000).
63-
@poetry run mkdocs serve
64-
65-
.PHONY: docs-deploy
66-
docs-deploy: docs-regen ## Deploy the documentation on GitHub pages.
67-
@poetry run mkdocs gh-deploy
6828

6929
.PHONY: help
70-
help: ## Print this help.
71-
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
72-
73-
.PHONY: format
74-
format: ## Run formatting tools on the code.
75-
@poetry run failprint -t "Formatting code" -- black $(PY_SRC)
76-
@poetry run failprint -t "Ordering imports" -- isort -y -rc $(PY_SRC)
77-
78-
.PHONY: release
79-
release: ## Create a new release (commit, tag, push, build, publish, deploy docs).
80-
ifndef v
81-
$(error Pass the new version with 'make release v=0.0.0')
82-
endif
83-
@poetry run failprint -t "Bumping version" -- poetry version $(v)
84-
@poetry run failprint -t "Staging files" -- git add pyproject.toml CHANGELOG.md
85-
@poetry run failprint -t "Committing changes" -- git commit -m "chore: Prepare release $(v)"
86-
@poetry run failprint -t "Tagging commit" -- git tag v$(v)
87-
@poetry run failprint -t "Building dist/wheel" -- poetry build
88-
-@if ! $(CI) && ! $(TESTING); then \
89-
poetry run failprint -t "Pushing commits" -- git push; \
90-
poetry run failprint -t "Pushing tags" -- git push --tags; \
91-
poetry run failprint -t "Publishing version" -- poetry publish; \
92-
poetry run failprint -t "Deploying docs" -- poetry run mkdocs gh-deploy; \
93-
fi
30+
help:
31+
@$(INVOKE) --list
9432

95-
.PHONY: setup
96-
setup: ## Setup the development environment (install dependencies).
97-
@if ! $(CI); then \
98-
if ! command -v poetry &>/dev/null; then \
99-
if ! command -v pipx &>/dev/null; then \
100-
pip install --user pipx; \
101-
fi; \
102-
pipx install poetry; \
103-
fi; \
104-
fi; \
105-
poetry install -v
33+
$(POETRY_TASKS):
34+
@$(INVOKE_AND_POETRY) $@ $(args)
10635

107-
.PHONY: test
108-
test: ## Run the test suite and report coverage.
109-
@poetry run pytest -c config/pytest.ini -n auto -k "$(K)" 2>/dev/null
110-
-@poetry run coverage html --rcfile=config/coverage.ini
36+
$(INVOKE_TASKS):
37+
@$(INVOKE_OR_POETRY) $@ $(args)

config/pytest.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ python_files =
99
test_*.py
1010
*_test.py
1111
tests.py
12-
addopts =
13-
--cov
14-
--cov-config config/coverage.ini

0 commit comments

Comments
 (0)