From 4ebbd8b64341ae9d1d6461484f6d119adce55a61 Mon Sep 17 00:00:00 2001 From: Juan Escudero Pedrosa Date: Thu, 10 Aug 2023 22:23:06 +0200 Subject: [PATCH 1/4] require python>=3.9 --- README.rst | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 1435068..40d0beb 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Change Log ~~~~~ * officially remove Python 2 support that was broken since 1.0.0 - anyway; now the package works with Python 3.8+ because of a few + anyway; now the package works with Python 3.9+ because of a few features 1.0.0 diff --git a/pyproject.toml b/pyproject.toml index 11ff6b6..f8b8f15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Detects bit rotten files on the hard drive to save your precious photo and music collection from slow decay." readme = "README.rst" -requires-python = ">=3.8" +requires-python = ">=3.9" keywords = ["file", "checksum", "database"] license = {text = "MIT"} classifiers = [ From 9560debc5600ffcbb2912210a651dd7f6c94baf5 Mon Sep 17 00:00:00 2001 From: Juan Escudero Pedrosa Date: Thu, 31 Aug 2023 18:31:13 +0200 Subject: [PATCH 2/4] fix setuptools_scm usage it gave error when installing (version was None) --- .gitignore | 5 +++++ pyproject.toml | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2a719ef..6b03f54 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ .bitrot.db .bitrot.sha512 + +_version.py + +__pycache__ +*.egg-info diff --git a/pyproject.toml b/pyproject.toml index f8b8f15..ece5a9d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "setuptools-scm[toml]"] +requires = ["setuptools", "setuptools_scm[toml]"] build-backend = "setuptools.build_meta" [project] @@ -31,4 +31,4 @@ test = ["pytest", "pytest-order"] bitrot = "bitrot:run_from_command_line" [tool.setuptools_scm] -tag_regex = "^(?Pv\\d+(?:\\.\\d+){0,2}[^\\+]*)(?:\\+.*)?$" +write_to = '_version.py' From 1a337cc57752178679370d40cdbfcf40035408e6 Mon Sep 17 00:00:00 2001 From: Juan Escudero Pedrosa Date: Thu, 31 Aug 2023 18:31:34 +0200 Subject: [PATCH 3/4] Revert "require python>=3.9" This reverts commit 4ebbd8b64341ae9d1d6461484f6d119adce55a61. --- README.rst | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 40d0beb..1435068 100644 --- a/README.rst +++ b/README.rst @@ -78,7 +78,7 @@ Change Log ~~~~~ * officially remove Python 2 support that was broken since 1.0.0 - anyway; now the package works with Python 3.9+ because of a few + anyway; now the package works with Python 3.8+ because of a few features 1.0.0 diff --git a/pyproject.toml b/pyproject.toml index ece5a9d..5ae69a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Detects bit rotten files on the hard drive to save your precious photo and music collection from slow decay." readme = "README.rst" -requires-python = ">=3.9" +requires-python = ">=3.8" keywords = ["file", "checksum", "database"] license = {text = "MIT"} classifiers = [ From 5002aa3fd6e25b07b621a8f7f7992dcee15bdd5e Mon Sep 17 00:00:00 2001 From: Juan Escudero Pedrosa Date: Thu, 31 Aug 2023 18:38:02 +0200 Subject: [PATCH 4/4] keep Python 3.8 compatibility checking for typing.TYPE_CHECKING --- tests/test_bitrot.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_bitrot.py b/tests/test_bitrot.py index 73f0dc4..82a4ec4 100644 --- a/tests/test_bitrot.py +++ b/tests/test_bitrot.py @@ -15,13 +15,14 @@ import pytest +from typing import TYPE_CHECKING TMP = Path("/tmp/") - -ReturnCode = int -StdOut = list[str] -StdErr = list[str] +if TYPE_CHECKING: + ReturnCode = int + StdOut = list[str] + StdErr = list[str] def bitrot(*args: str) -> tuple[ReturnCode, StdOut, StdErr]: