From d9a8af002060bd83a92958859a5a63f2f99da471 Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 1 Jul 2024 14:13:12 +0100 Subject: [PATCH] add towncrier --- .pre-commit-config.yaml | 9 ++++++++ HISTORY.rst | 2 ++ changelog.d/.gitignore | 1 + pyproject.toml | 47 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 changelog.d/.gitignore diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 807bde0f..2b77ea69 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,12 @@ repos: - id: doc8 description: This hook runs doc8 for linting docs require_serial: true + + - repo: local + hooks: + - id: changelog-fragment-filenames + name: changelog fragment + language: fail + entry: changelog fragment files must be named *.(breaking|change|provider|refiner|deprecation|doc|misc).rst + exclude: ^changelog.d/(\..*|towncrier_template.rst|.*\.(breaking|change|provider|refiner|deprecation|doc|misc).rst) + files: ^changelog.d/ diff --git a/HISTORY.rst b/HISTORY.rst index f697a3c2..fd584b8c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,8 @@ Changelog --------- +.. towncrier release notes start + 2.2.1 ^^^^^ **release date:** 2024-06-27 diff --git a/changelog.d/.gitignore b/changelog.d/.gitignore new file mode 100644 index 00000000..f935021a --- /dev/null +++ b/changelog.d/.gitignore @@ -0,0 +1 @@ +!.gitignore diff --git a/pyproject.toml b/pyproject.toml index e58d4303..cc0587e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,6 +57,7 @@ docs = [ "sphinx", "sphinx_rtd_theme", "sphinxcontrib-programoutput", + "towncrier", ] test = [ "mypy", @@ -213,6 +214,52 @@ source = ["subliminal"] relative_files = true +# https://towncrier.readthedocs.io/en/stable/tutorial.html +[tool.towncrier] +name = "subliminal" +package = "subliminal" +directory = "changelog.d" +filename = "HISTORY.rst" +title_format = "`version `_ - {project_date}" +issue_format = "`#{issue} `_" +underlines = ["^", "-", "~"] + +[[tool.towncrier.type]] +directory = "breaking" +name = "Backwards-incompatible Changes" +showcontent = true + +[[tool.towncrier.type]] +directory = "change" +name = "Changes" +showcontent = true + +[[tool.towncrier.type]] +directory = "provider" +name = "Provider Changes" +showcontent = true + +[[tool.towncrier.type]] +directory = "refiner" +name = "Refiner Changes" +showcontent = true + +[[tool.towncrier.type]] +directory = "deprecation" +name = "Deprecations" +showcontent = true + +[[tool.towncrier.type]] +directory = "doc" +name = "Documentation" +showcontent = false + +[[tool.towncrier.type]] +directory = "misc" +name = "Misc" +showcontent = false + + # https://mypy.readthedocs.io/en/stable/config_file.html [tool.mypy] files = "subliminal/**/*.py"