From 2b9e04cd1993b17b51b4ebb6cb4dd8396387f159 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 24 Sep 2024 17:03:08 +0100 Subject: [PATCH 1/2] Allow custom filenames for changelog command (#247) --- docs/tools.md | 8 ++++++++ samples/integration/nox.txt | 2 ++ samples/integration/typeshed.txt | 2 -- src/mk/tools/pre.py | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/tools.md b/docs/tools.md index 0f46288..43f9ae2 100644 --- a/docs/tools.md +++ b/docs/tools.md @@ -69,3 +69,11 @@ basic commands: If a [pytest](https://docs.pytest.org/en/stable/) configuration file is found, a `test` command will be exposed that runs `pytest`. + +## changelog (github) + +`changelog` command will produce a `CHANGELOG.md` file based on Github Releases. +You can define `CHANGELOG_FILE` environment variable to make it generate the +file in a different location. + +This command is available only when `gh` command line utility is installed. diff --git a/samples/integration/nox.txt b/samples/integration/nox.txt index 8cb0d4a..fb1d8ce 100644 --- a/samples/integration/nox.txt +++ b/samples/integration/nox.txt @@ -16,6 +16,8 @@ tests(python='3.11', tox_version='<4') tests(python='3.11', tox_version='latest') tests(python='3.12', tox_version='<4') tests(python='3.12', tox_version='latest') +tests(python='3.13', tox_version='<4') +tests(python='3.13', tox_version='latest') tests(python='3.8', tox_version='<4') tests(python='3.8', tox_version='latest') tests(python='3.9', tox_version='<4') diff --git a/samples/integration/typeshed.txt b/samples/integration/typeshed.txt index a4367c6..9a51168 100644 --- a/samples/integration/typeshed.txt +++ b/samples/integration/typeshed.txt @@ -2,7 +2,5 @@ alerts changelog create_baseline_stubs drafts -generate_proto_stubs lint prs -sync_tensorflow_protobuf_stubs diff --git a/src/mk/tools/pre.py b/src/mk/tools/pre.py index 2c2e28a..83c2c25 100644 --- a/src/mk/tools/pre.py +++ b/src/mk/tools/pre.py @@ -55,7 +55,8 @@ def changelog(self) -> None: result = result.rstrip("\r\n") + "\n" result = result.replace("\r\n", "\n") result = re.sub(r"\n{3,}", "\n\n", result, re.MULTILINE) - with open("CHANGELOG.md", "w", encoding="utf-8") as f: + filename = os.environ.get("CHANGELOG_FILE", "CHANGELOG.md") + with open(filename, "w", encoding="utf-8") as f: f.write(result) logging.info("Wrote CHANGELOG.md") From 0cdcca7937633be13e7b90afc7c758ebe546c4e2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 17:07:30 +0100 Subject: [PATCH 2/2] [pre-commit.ci] pre-commit autoupdate (#244) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.6.7) - [github.com/ansible/ansible-lint: v24.7.0 → v24.9.2](https://github.com/ansible/ansible-lint/compare/v24.7.0...v24.9.2) - [github.com/pycqa/pylint: v3.2.7 → v3.3.0](https://github.com/pycqa/pylint/compare/v3.2.7...v3.3.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Sorin Sbarnea --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6af02dc..b28a221 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ ci: - deps repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.3 + rev: v0.6.7 hooks: - id: ruff args: @@ -49,7 +49,7 @@ repos: - id: debug-statements language_version: python3 - repo: https://github.com/ansible/ansible-lint - rev: v24.7.0 + rev: v24.9.2 hooks: - id: ansible-lint language_version: python3.10 # minimal supported officially @@ -79,7 +79,7 @@ repos: - typer-config - typer>=0.12.2 - repo: https://github.com/pycqa/pylint - rev: v3.2.7 + rev: v3.3.0 hooks: - id: pylint additional_dependencies: