From ddf7ed647097158968f3f639319dea72cc8a3f54 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Fri, 19 Sep 2025 14:12:11 +0000 Subject: [PATCH 1/9] Change the minimum python version to 3.10 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 0efe6a5..c92c226 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" name = "dissect.archive" description = "A Dissect module implementing parsers for various archive and backup formats" readme = "README.md" -requires-python = "~=3.9" +requires-python = ">=3.10" license.text = "Affero General Public License v3" authors = [ {name = "Dissect Team", email = "dissect@fox-it.com"} From e9817e9450970eecc621e6b7c15ac49871cc94c5 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Fri, 19 Sep 2025 14:48:15 +0000 Subject: [PATCH 2/9] Update deprecated license settings --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c92c226..25b3433 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=65.5.0", "setuptools_scm[toml]>=6.4.0"] +requires = ["setuptools>=77.0.0", "setuptools_scm[toml]>=6.4.0"] build-backend = "setuptools.build_meta" [project] @@ -7,7 +7,8 @@ name = "dissect.archive" description = "A Dissect module implementing parsers for various archive and backup formats" readme = "README.md" requires-python = ">=3.10" -license.text = "Affero General Public License v3" +license = "AGPL-3.0-or-later" +license-files = ["LICENSE", "COPYRIGHT"] authors = [ {name = "Dissect Team", email = "dissect@fox-it.com"} ] @@ -101,9 +102,6 @@ ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM1 known-first-party = ["dissect.archive"] known-third-party = ["dissect"] -[tool.setuptools] -license-files = ["LICENSE", "COPYRIGHT"] - [tool.setuptools.packages.find] include = ["dissect.*"] From dc30546c80513d6c53a31750b681b8ac16f1f377 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Fri, 19 Sep 2025 15:38:53 +0000 Subject: [PATCH 3/9] remove 'License :: OSI approved' from specifiers --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 25b3433..5648b21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,6 @@ classifiers = [ "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Information Technology", - "License :: OSI Approved", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Internet :: Log Analysis", From d9a1c5325890fcade7e00bd06f99c91ea54e76d2 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Mon, 22 Sep 2025 09:31:21 +0000 Subject: [PATCH 4/9] Change vermin minimum version to python3.10 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 07a0873..6ff0ebf 100644 --- a/tox.ini +++ b/tox.ini @@ -43,7 +43,7 @@ deps = vermin commands = ruff check dissect tests - vermin -t=3.9- --no-tips --lint dissect tests + vermin -t=3.10- --no-tips --lint dissect tests [flake8] max-line-length = 120 From 431ef3be567e8be70184fe013f12d781483cb1ed Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Tue, 23 Sep 2025 09:19:55 +0000 Subject: [PATCH 5/9] Update lint and fix steps tox.ini --- tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tox.ini b/tox.ini index 6ff0ebf..e5c68b9 100644 --- a/tox.ini +++ b/tox.ini @@ -34,6 +34,7 @@ package = skip deps = ruff==0.9.2 commands = + ruff check --fix dissect tests ruff format dissect tests [testenv:lint] @@ -43,6 +44,7 @@ deps = vermin commands = ruff check dissect tests + ruff format --check dissect tests vermin -t=3.10- --no-tips --lint dissect tests [flake8] From 25f3e47fb3f5bb1edc131466c281b798ac396cd1 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Tue, 23 Sep 2025 09:31:56 +0000 Subject: [PATCH 6/9] Bump ruff version --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index e5c68b9..25ebd17 100644 --- a/tox.ini +++ b/tox.ini @@ -32,7 +32,7 @@ commands = [testenv:fix] package = skip deps = - ruff==0.9.2 + ruff==0.13.1 commands = ruff check --fix dissect tests ruff format dissect tests @@ -40,7 +40,7 @@ commands = [testenv:lint] package = skip deps = - ruff==0.9.2 + ruff==0.13.1 vermin commands = ruff check dissect tests From 2eae6d51e9605a13364fd6ae3d0343fdd8ecd04e Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Mon, 22 Sep 2025 12:49:13 +0000 Subject: [PATCH 7/9] Fix linting for python3.10 --- dissect/archive/vma.py | 4 ++-- dissect/archive/wim.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dissect/archive/vma.py b/dissect/archive/vma.py index 83ae325..e11a6b5 100644 --- a/dissect/archive/vma.py +++ b/dissect/archive/vma.py @@ -61,7 +61,7 @@ def __init__(self, fh: BinaryIO): blob_offset += size + 2 self._config: dict[str, bytes] = {} - for conf_name, conf_data in zip(self.header.config_names, self.header.config_data): + for conf_name, conf_data in zip(self.header.config_names, self.header.config_data, strict=False): if (conf_name, conf_data) == (0, 0): continue @@ -179,7 +179,7 @@ def __init__(self, fh: BinaryIO, offset: int): elif mask == 0: pass else: - block_offset += bin(mask).count("1") * c_vma.VMA_BLOCK_SIZE + block_offset += mask.bit_count() * c_vma.VMA_BLOCK_SIZE def __repr__(self) -> str: return f"" diff --git a/dissect/archive/wim.py b/dissect/archive/wim.py index f28358b..48a83d0 100644 --- a/dissect/archive/wim.py +++ b/dissect/archive/wim.py @@ -3,7 +3,7 @@ import io import struct from functools import cached_property, lru_cache -from typing import TYPE_CHECKING, BinaryIO, Callable +from typing import TYPE_CHECKING, BinaryIO from dissect.util.stream import AlignedStream, BufferedStream, RelativeStream from dissect.util.ts import wintimestamp @@ -26,7 +26,7 @@ ) if TYPE_CHECKING: - from collections.abc import Iterator + from collections.abc import Callable, Iterator from datetime import datetime DEFAULT_CHUNK_SIZE = 32 * 1024 From 22587f9fac5e2becf144a0d58609b868020c8472 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Tue, 23 Sep 2025 13:43:44 +0000 Subject: [PATCH 8/9] Update project to use dependency groups --- pyproject.toml | 20 ++++++++++++++++++++ tox.ini | 14 +++++--------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5648b21..a5d6fb8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,6 +45,26 @@ dev = [ "dissect.util>=3.22.dev,<4.0.dev", #TODO: Remove once we release a new version ] +[dependency-groups] +test = [ + "pytest", +] +lint = [ + "ruff==0.13.1", + "vermin", +] +build = [ + "build", +] +debug = [ + "ipdb", +] +dev = [ + {include-group = "test"}, + {include-group = "lint"}, + {include-group = "debug"}, +] + [project.scripts] vma-extract = "dissect.archive.tools.backup:main" vbk-extract = "dissect.archive.tools.backup:main" diff --git a/tox.ini b/tox.ini index 25ebd17..9685232 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ envlist = lint, py3, pypy3 # requires if they are not available on the host system. This requires the # locally installed tox to have a minimum version 3.3.0. This means the names # of the configuration options are still according to the tox 3.x syntax. -minversion = 4.4.3 +minversion = 4.27.0 # This version of virtualenv will install setuptools version 68.2.2 and pip # 23.3.1. These versions fully support python projects defined only through a # pyproject.toml file (PEP-517/PEP-518/PEP-621). This pip version also support @@ -14,9 +14,9 @@ requires = virtualenv>=20.24.6 [testenv] extras = dev deps = - pytest pytest-cov coverage +dependency_groups = test commands = pytest --basetemp="{envtmpdir}" {posargs:--color=yes --cov=dissect --cov-report=term-missing -v tests} coverage report @@ -24,24 +24,20 @@ commands = [testenv:build] package = skip -deps = - build +dependency_groups = build commands = pyproject-build [testenv:fix] package = skip -deps = - ruff==0.13.1 +dependency_groups = lint commands = ruff check --fix dissect tests ruff format dissect tests [testenv:lint] package = skip -deps = - ruff==0.13.1 - vermin +dependency_groups = lint commands = ruff check dissect tests ruff format --check dissect tests From 11ed62d6a1791b0dd791e774936fdf8e063b8ed3 Mon Sep 17 00:00:00 2001 From: Miauwkeru Date: Wed, 24 Sep 2025 12:38:14 +0000 Subject: [PATCH 9/9] Changing required ruff version to ">=0.13.1" --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a5d6fb8..71ab0f7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,7 +72,7 @@ backup-extract = "dissect.archive.tools.backup:main" [tool.ruff] line-length = 120 -required-version = ">=0.9.0" +required-version = ">=0.13.1" [tool.ruff.format] docstring-code-format = true