From ccdc5ce76eb8c68252a6ed13a730fb4965c69236 Mon Sep 17 00:00:00 2001 From: Sam Cunliffe Date: Tue, 3 Dec 2024 10:59:25 +0000 Subject: [PATCH 1/2] Proposal to fix #503 by excluding version numbers from the regression test. --- tests/test_package_generation.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/test_package_generation.py b/tests/test_package_generation.py index 793cceea..62d72701 100644 --- a/tests/test_package_generation.py +++ b/tests/test_package_generation.py @@ -3,6 +3,7 @@ import difflib import os import pathlib +import re import shutil import subprocess import typing @@ -71,14 +72,21 @@ def test_package_generation( continue with actual_file.open() as f1, expected_file.open() as f2: - diff += "".join( - difflib.unified_diff( - f1.readlines(), - f2.readlines(), - fromfile=str(actual_file), - tofile=str(expected_file), - ) + f1_content = f1.read() + f2_content = f2.read() + + exclude_version_numbers = r"v(\d+\.)?(\d+\.)?(\*|\d+)$" + f1_content = re.sub(exclude_version_numbers, "", f1_content) + f2_content = re.sub(exclude_version_numbers, "", f2_content) + + diff += "".join( + difflib.unified_diff( + f1_content, + f2_content, + fromfile=str(actual_file), + tofile=str(expected_file), ) + ) if diff: shutil.rmtree(expected_package_dir) From 3f8c41a4e51003df277552a41a74e073398e3e17 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:45:16 +0000 Subject: [PATCH 2/2] chore(deps): renovate: python-jsonschema/check-jsonschema to v0.30.0 --- .pre-commit-config.yaml | 2 +- {{cookiecutter.project_slug}}/.pre-commit-config.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5427ed16..4fb68417 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: - --fix=lf - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.3 + rev: 0.30.0 hooks: # Schemas taken from https://www.schemastore.org/json/ - id: check-jsonschema diff --git a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml index 59febe0b..4d32942a 100644 --- a/{{cookiecutter.project_slug}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_slug}}/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: - --fix=lf - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 0.29.4 + rev: 0.30.0 hooks: # Schemas taken from https://www.schemastore.org/json/ - id: check-jsonschema