Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit e0d6bf4

Browse files
authored
Update pyproject.toml license settings and minimum python version (#49)
1 parent d7ed551 commit e0d6bf4

File tree

6 files changed

+39
-24
lines changed

6 files changed

+39
-24
lines changed

dissect/esedb/c_esedb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import datetime
44
import struct
55
import uuid
6-
from typing import NamedTuple, Union
6+
from typing import NamedTuple
77

88
from dissect.cstruct import cstruct
99

@@ -481,7 +481,7 @@
481481
CODEPAGE.ASCII: "ascii",
482482
}
483483

484-
RecordValue = Union[int, float, str, bytes, datetime.datetime, None]
484+
RecordValue = int | float | str | bytes | datetime.datetime | None
485485

486486

487487
def decode_bit(buf: bytes) -> bool:

dissect/esedb/lcmapstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def map_string(value: str, flags: MapFlags, locale: str) -> bytes:
129129
if flags & MapFlags.LINGUISTIC_IGNOREDIACRITIC:
130130
diacritic_weight = 2
131131

132-
if len(key_diacritic):
132+
if key_diacritic:
133133
key_diacritic[-1] += diacritic_weight
134134
else:
135135
key_diacritic.append(diacritic_weight)

dissect/esedb/table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def get_long_value(self, key: bytes) -> bytes:
214214

215215
buf = []
216216
chunk_offset = 0
217-
for chunk, next_chunk_offset in zip(chunks, chunk_offsets[1:]):
217+
for chunk, next_chunk_offset in zip(chunks, chunk_offsets[1:], strict=False):
218218
# Chunk sizes should be used to determine if a chunk is compressed
219219
if len(chunk) != next_chunk_offset - chunk_offset:
220220
chunk = compression.decompress(chunk)

dissect/esedb/tools/ual.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
import ipaddress
44
from collections.abc import Iterator
55
from pathlib import Path
6-
from typing import BinaryIO, Union
6+
from typing import BinaryIO
77

88
from dissect.util.ts import wintimestamp
99

1010
from dissect.esedb.c_esedb import RecordValue
1111
from dissect.esedb.esedb import EseDB
1212
from dissect.esedb.table import Table
1313

14-
UalValue = Union[RecordValue, ipaddress.IPv4Address, ipaddress.IPv6Interface, tuple[datetime.datetime]]
14+
UalValue = RecordValue | ipaddress.IPv4Address | ipaddress.IPv6Interface | tuple[datetime.datetime]
1515

1616
SKIP_TABLES = [
1717
"MSysObjects",

pyproject.toml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
[build-system]
2-
requires = ["setuptools>=65.5.0", "setuptools_scm[toml]>=6.4.0"]
2+
requires = ["setuptools>=77.0.0", "setuptools_scm[toml]>=6.4.0"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "dissect.esedb"
77
description = "A Dissect module implementing a parser for Microsofts Extensible Storage Engine Database (ESEDB), used for example in Active Directory, Exchange and Windows Update"
88
readme = "README.md"
9-
requires-python = "~=3.9"
10-
license.text = "Apache License 2.0"
9+
requires-python = ">=3.10"
10+
license = "Apache-2.0"
11+
license-files = ["LICENSE", "COPYRIGHT"]
1112
authors = [
1213
{name = "Dissect Team", email = "dissect@fox-it.com"}
1314
]
@@ -16,7 +17,6 @@ classifiers = [
1617
"Environment :: Console",
1718
"Intended Audience :: Developers",
1819
"Intended Audience :: Information Technology",
19-
"License :: OSI Approved",
2020
"Operating System :: OS Independent",
2121
"Programming Language :: Python :: 3",
2222
"Topic :: Internet :: Log Analysis",
@@ -41,9 +41,29 @@ dev = [
4141
"dissect.util>=3.5.dev,<4.0.dev",
4242
]
4343

44+
[dependency-groups]
45+
test = [
46+
"pytest",
47+
]
48+
lint = [
49+
"ruff==0.13.1",
50+
"vermin",
51+
]
52+
build = [
53+
"build",
54+
]
55+
debug = [
56+
"ipdb",
57+
]
58+
dev = [
59+
{include-group = "test"},
60+
{include-group = "lint"},
61+
{include-group = "debug"},
62+
]
63+
4464
[tool.ruff]
4565
line-length = 120
46-
required-version = ">=0.9.0"
66+
required-version = ">=0.13.1"
4767

4868
[tool.ruff.format]
4969
docstring-code-format = true
@@ -92,9 +112,6 @@ ignore = ["E203", "B904", "UP024", "ANN002", "ANN003", "ANN204", "ANN401", "SIM1
92112
known-first-party = ["dissect.esedb"]
93113
known-third-party = ["dissect"]
94114

95-
[tool.setuptools]
96-
license-files = ["LICENSE", "COPYRIGHT"]
97-
98115
[tool.setuptools.packages.find]
99116
include = ["dissect.*"]
100117

tox.ini

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ envlist = lint, py3, pypy3
44
# requires if they are not available on the host system. This requires the
55
# locally installed tox to have a minimum version 3.3.0. This means the names
66
# of the configuration options are still according to the tox 3.x syntax.
7-
minversion = 4.4.3
7+
minversion = 4.27.0
88
# This version of virtualenv will install setuptools version 68.2.2 and pip
99
# 23.3.1. These versions fully support python projects defined only through a
1010
# pyproject.toml file (PEP-517/PEP-518/PEP-621). This pip version also support
@@ -14,36 +14,34 @@ requires = virtualenv>=20.24.6
1414
[testenv]
1515
extras = dev
1616
deps =
17-
pytest
1817
pytest-cov
1918
coverage
19+
dependency_groups = test
2020
commands =
2121
pytest --basetemp="{envtmpdir}" {posargs:--color=yes --cov=dissect --cov-report=term-missing -v tests}
2222
coverage report
2323
coverage xml
2424

2525
[testenv:build]
2626
package = skip
27-
deps =
28-
build
27+
dependency_groups = build
2928
commands =
3029
pyproject-build
3130

3231
[testenv:fix]
3332
package = skip
34-
deps =
35-
ruff==0.9.2
33+
dependency_groups = lint
3634
commands =
35+
ruff check --fix dissect tests
3736
ruff format dissect tests
3837

3938
[testenv:lint]
4039
package = skip
41-
deps =
42-
ruff==0.9.2
43-
vermin
40+
dependency_groups = lint
4441
commands =
4542
ruff check dissect tests
46-
vermin -t=3.9- --no-tips --lint dissect tests
43+
ruff format --check dissect tests
44+
vermin -t=3.10- --no-tips --lint dissect tests
4745

4846
[flake8]
4947
max-line-length = 120

0 commit comments

Comments
 (0)