Skip to content

Commit

Permalink
docs: Generated changelog on the fly. (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Sep 11, 2023
1 parent e371ead commit 3275ba0
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 406 deletions.
2 changes: 2 additions & 0 deletions .readthedocs.yaml
Expand Up @@ -4,6 +4,8 @@ build:
- make reports
post_install:
- make dev-docs
pre_build:
- make changelog
os: ubuntu-22.04
tools:
python: '3.11'
Expand Down
186 changes: 0 additions & 186 deletions CHANGELOG.md

This file was deleted.

20 changes: 8 additions & 12 deletions Makefile
@@ -1,4 +1,4 @@
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit test freeze version build upload docs docs-autobuild docs-mypy docs-coverage reports docs-all
.PHONY: clean deepclean install dev black isort mypy ruff toml-sort lint pre-commit test freeze version build upload docs docs-autobuild docs-mypy docs-coverage reports changelog docs-all

########################################################################################
# Variables
Expand Down Expand Up @@ -105,14 +105,6 @@ freeze:
version:
${PIPRUN} python -m setuptools_scm

# Generate changelog from git commits.
changelog:
git-changelog -Trio CHANGELOG.md -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

# Bump new release with changelog.
bump:
git-changelog -bTrio CHANGELOG.md -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

# Build the package
build:
${PIPRUN} python -m build
Expand All @@ -137,11 +129,11 @@ docs-autobuild:
--watch src

# Generate mypy reports.
docs-mypy:
docs-mypy: docs
${PIPRUN} python -m mypy src test --html-report ${PUBLIC_DIR}/reports/mypy

# Generate coverage reports and badge.
docs-coverage:
docs-coverage: docs
${PIPRUN} python -m coverage erase
${PIPRUN} python -m coverage run -m pytest
${PIPRUN} python -m coverage html -d ${PUBLIC_DIR}/reports/coverage
Expand All @@ -150,8 +142,12 @@ docs-coverage:
# Generate all reports.
reports: docs-mypy docs-coverage

# Generate changelog from git commits.
changelog:
${PIPRUN} git-changelog -ETrio docs/changelog.md -c conventional -s build,chore,ci,docs,feat,fix,perf,refactor,revert,style,test

# Generate all documentation with reports.
docs-all: docs reports
docs-all: changelog docs reports

########################################################################################
# End
Expand Down
2 changes: 0 additions & 2 deletions README.md
Expand Up @@ -52,8 +52,6 @@ pipx install copier
pipx install pipenv
# Pre-commit: Automates Git hooks for code quality checks.
pipx install pre-commit
# Git-changelog: Automatic changelog generator from git commits.
pipx install git-changelog
```

## 🚀 Quickstart
Expand Down
2 changes: 2 additions & 0 deletions constraints/default.txt
Expand Up @@ -14,6 +14,7 @@ coverage==7.3.1
docutils==0.20.1
exceptiongroup==1.1.3
furo==2023.8.19
git-changelog==2.2.0
idna==3.4
imagesize==1.4.1
importlib-metadata==6.8.0
Expand Down Expand Up @@ -53,6 +54,7 @@ requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.5.2
ruff==0.0.287
semver==3.0.1
setuptools-scm==7.1.0
shellingham==1.5.3
six==1.16.0
Expand Down
6 changes: 3 additions & 3 deletions docs/changelog.md
@@ -1,5 +1,5 @@
# Changelog

```{include} ../CHANGELOG.md
:start-line: 1
```
<!-- insertion marker -->
<!-- placeholder for generated changelog -->
<!-- insertion marker -->
1 change: 1 addition & 0 deletions requirements/docs.txt
Expand Up @@ -2,6 +2,7 @@
autodoc-pydantic
coverage
furo
git-changelog
mypy[reports]
myst-parser
pytest
Expand Down
2 changes: 2 additions & 0 deletions template/.readthedocs.yaml.jinja
Expand Up @@ -4,6 +4,8 @@ build:
- make reports
post_install:
- make dev-docs
pre_build:
- make changelog
os: ubuntu-22.04
tools:
python: '{{ default_py }}'
Expand Down

0 comments on commit 3275ba0

Please sign in to comment.