Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dissect/esedb/c_esedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import datetime
import struct
import uuid
from typing import NamedTuple, Union
from typing import NamedTuple

from dissect.cstruct import cstruct

Expand Down Expand Up @@ -481,7 +481,7 @@
CODEPAGE.ASCII: "ascii",
}

RecordValue = Union[int, float, str, bytes, datetime.datetime, None]
RecordValue = int | float | str | bytes | datetime.datetime | None


def decode_bit(buf: bytes) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion dissect/esedb/lcmapstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def map_string(value: str, flags: MapFlags, locale: str) -> bytes:
if flags & MapFlags.LINGUISTIC_IGNOREDIACRITIC:
diacritic_weight = 2

if len(key_diacritic):
if key_diacritic:
key_diacritic[-1] += diacritic_weight
else:
key_diacritic.append(diacritic_weight)
Expand Down
2 changes: 1 addition & 1 deletion dissect/esedb/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def get_long_value(self, key: bytes) -> bytes:

buf = []
chunk_offset = 0
for chunk, next_chunk_offset in zip(chunks, chunk_offsets[1:]):
for chunk, next_chunk_offset in zip(chunks, chunk_offsets[1:], strict=False):
# Chunk sizes should be used to determine if a chunk is compressed
if len(chunk) != next_chunk_offset - chunk_offset:
chunk = compression.decompress(chunk)
Expand Down
4 changes: 2 additions & 2 deletions dissect/esedb/tools/ual.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import ipaddress
from collections.abc import Iterator
from pathlib import Path
from typing import BinaryIO, Union
from typing import BinaryIO

from dissect.util.ts import wintimestamp

from dissect.esedb.c_esedb import RecordValue
from dissect.esedb.esedb import EseDB
from dissect.esedb.table import Table

UalValue = Union[RecordValue, ipaddress.IPv4Address, ipaddress.IPv6Interface, tuple[datetime.datetime]]
UalValue = RecordValue | ipaddress.IPv4Address | ipaddress.IPv6Interface | tuple[datetime.datetime]

SKIP_TABLES = [
"MSysObjects",
Expand Down
33 changes: 25 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[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]
name = "dissect.esedb"
description = "A Dissect module implementing a parser for Microsofts Extensible Storage Engine Database (ESEDB), used for example in Active Directory, Exchange and Windows Update"
readme = "README.md"
requires-python = "~=3.9"
license.text = "Apache License 2.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to this licence change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's an error, there are no plans to change this license. The only acceptable future license changes are other dissect projects to Apache2 😄.

requires-python = ">=3.10"
license = "Apache-2.0"
license-files = ["LICENSE", "COPYRIGHT"]
authors = [
{name = "Dissect Team", email = "dissect@fox-it.com"}
]
Expand All @@ -16,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",
Expand All @@ -41,9 +41,29 @@ dev = [
"dissect.util>=3.5.dev,<4.0.dev",
]

[dependency-groups]
test = [
"pytest",
]
lint = [
"ruff==0.13.1",
"vermin",
]
build = [
"build",
]
debug = [
"ipdb",
]
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "debug"},
]

[tool.ruff]
line-length = 120
required-version = ">=0.9.0"
required-version = ">=0.13.1"

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

[tool.setuptools]
license-files = ["LICENSE", "COPYRIGHT"]

[tool.setuptools.packages.find]
include = ["dissect.*"]

Expand Down
18 changes: 8 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -14,36 +14,34 @@ 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
coverage xml

[testenv:build]
package = skip
deps =
build
dependency_groups = build
commands =
pyproject-build

[testenv:fix]
package = skip
deps =
ruff==0.9.2
dependency_groups = lint
commands =
ruff check --fix dissect tests
ruff format dissect tests

[testenv:lint]
package = skip
deps =
ruff==0.9.2
vermin
dependency_groups = lint
commands =
ruff check dissect tests
vermin -t=3.9- --no-tips --lint dissect tests
ruff format --check dissect tests
vermin -t=3.10- --no-tips --lint dissect tests

[flake8]
max-line-length = 120
Expand Down
Loading