From 677e7a2eb89597154f221f85c526d405a36821b7 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Tue, 25 Nov 2025 16:14:17 +0100 Subject: [PATCH] Migrated setup.cfg to pyproject.toml --- .github/workflows/test_docker.yml | 2 +- MANIFEST.in | 8 ++-- MANIFEST.test_data.in | 6 +-- README => README.md | 0 config/dpkg/changelog | 4 +- dfimagetools/__init__.py | 2 +- pyproject.toml | 71 +++++++++++++++++++++++++++++++ requirements.txt | 36 ---------------- setup.cfg | 41 ------------------ setup.py | 8 ---- test_requirements.txt | 0 tox.ini | 6 +-- utils/dependencies.py | 2 +- utils/update_release.sh | 4 +- 14 files changed, 84 insertions(+), 106 deletions(-) rename README => README.md (100%) delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100755 setup.py delete mode 100644 test_requirements.txt diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index ff38b8b..30d6c76 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - version: ['24.04'] + version: ['26.04'] container: image: ubuntu:${{ matrix.version }} steps: diff --git a/MANIFEST.in b/MANIFEST.in index 35edbc7..11b72d7 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,14 +1,12 @@ -include ACKNOWLEDGEMENTS AUTHORS LICENSE README +include ACKNOWLEDGEMENTS AUTHORS LICENSE README.md include dependencies.ini run_tests.py utils/__init__.py utils/dependencies.py include utils/check_dependencies.py -include requirements.txt test_requirements.txt exclude .gitignore exclude *.pyc recursive-exclude dfimagetools *.pyc recursive-include config * -# Do not include the test data otherwise the sdist will be too large for PyPi. +# Do not include the test data otherwise the sdist will be too large for PyPI. recursive-exclude test_data * # The test scripts are not required in a binary distribution package they -# are considered source distribution files and excluded in find_package() -# in setup.py. +# are considered source distribution files and excluded by find_package(). recursive-include tests *.py diff --git a/MANIFEST.test_data.in b/MANIFEST.test_data.in index 076d220..fe1e89b 100644 --- a/MANIFEST.test_data.in +++ b/MANIFEST.test_data.in @@ -1,13 +1,11 @@ -include ACKNOWLEDGEMENTS AUTHORS LICENSE README +include ACKNOWLEDGEMENTS AUTHORS LICENSE README.md include dependencies.ini run_tests.py utils/__init__.py utils/dependencies.py include utils/check_dependencies.py -include requirements.txt test_requirements.txt exclude .gitignore exclude *.pyc recursive-exclude dfimagetools *.pyc recursive-include config * recursive-include test_data * # The test scripts are not required in a binary distribution package they -# are considered source distribution files and excluded in find_package() -# in setup.py. +# are considered source distribution files and excluded by find_package(). recursive-include tests *.py diff --git a/README b/README.md similarity index 100% rename from README rename to README.md diff --git a/config/dpkg/changelog b/config/dpkg/changelog index 6fef56c..c258d55 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dfimagetools (20251124-1) unstable; urgency=low +dfimagetools (20251125-1) unstable; urgency=low * Auto-generated - -- Log2Timeline maintainers Mon, 24 Nov 2025 13:21:58 +0100 + -- Log2Timeline maintainers Tue, 25 Nov 2025 16:08:33 +0100 diff --git a/dfimagetools/__init__.py b/dfimagetools/__init__.py index 8c64b3c..0474661 100644 --- a/dfimagetools/__init__.py +++ b/dfimagetools/__init__.py @@ -2,4 +2,4 @@ """Collection of tools to process storage media images.""" -__version__ = '20251124' +__version__ = '20251125' diff --git a/pyproject.toml b/pyproject.toml index 9787c3b..4a8923c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,74 @@ [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" + +[project] +name = "dfimagetools" +version = "20251125" +description = "Storage media image tools" +maintainers = [ + { name = "Log2Timeline maintainers", email = "log2timeline-maintainers@googlegroups.com" }, +] +license = "Apache-2.0" +license-files = ["ACKNOWLEDGEMENTS", "AUTHORS", "LICENSE"] +readme = "README.md" +classifiers = [ + "Development Status :: 3 - Alpha", + "Programming Language :: Python", +] +requires-python = ">=3.10" +dependencies = [ + "PyYAML >= 3.10", + "artifacts >= 20220219", + "cffi >= 1.9.1", + "dfdatetime >= 20251018", + "dfvfs >= 20251019", + "dfwinreg >= 20240229", + "dtfabric >= 20230518", + "libbde-python >= 20220121", + "libcaes-python >= 20240114", + "libcreg-python >= 20200725", + "libewf-python >= 20131210", + "libfcrypto-python >= 20240114", + "libfsapfs-python >= 20220709", + "libfsext-python >= 20220829", + "libfsfat-python >= 20220925", + "libfshfs-python >= 20220831", + "libfsntfs-python >= 20251018", + "libfsxfs-python >= 20220829", + "libfvde-python >= 20220121", + "libfwnt-python >= 20210717", + "libluksde-python >= 20220121", + "libmodi-python >= 20210405", + "libphdi-python >= 20220228", + "libqcow-python >= 20201213", + "libregf-python >= 20201002", + "libsigscan-python >= 20230109", + "libsmdev-python >= 20140529", + "libsmraw-python >= 20140612", + "libvhdi-python >= 20201014", + "libvmdk-python >= 20140421", + "libvsapm-python >= 20230506", + "libvsgpt-python >= 20211115", + "libvshadow-python >= 20160109", + "libvslvm-python >= 20160109", + "pytsk3 >= 20210419", + "xattr >= 0.7.2 ; platform_system != \"Windows\"", +] + +[project.scripts] +extract_data_streams = "dfimagetools.scripts.extract_data_streams:Main" +list_file_entries = "dfimagetools.scripts.list_file_entries:Main" +map_extents = "dfimagetools.scripts.map_extents:Main" +recursive_hasher = "dfimagetools.scripts.recursive_hasher:Main" +source_analyzer = "dfimagetools.scripts.source_analyzer:Main" + +[project.urls] +Documentation = "https://dfimagetools.readthedocs.io/en/latest" +Homepage = "https://github.com/log2timeline/dfimagetools" +Repository = "https://github.com/log2timeline/dfimagetools" + +[tool.setuptools.packages.find] +where = ["."] +include = ["dfimagetools"] +exclude = ["docs", "tests", "tests.*", "utils"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6c38c20..0000000 --- a/requirements.txt +++ /dev/null @@ -1,36 +0,0 @@ -PyYAML >= 3.10 -artifacts >= 20220219 -cffi >= 1.9.1 -dfdatetime >= 20251018 -dfvfs >= 20251019 -dfwinreg >= 20240229 -dtfabric >= 20230518 -libbde-python >= 20220121 -libcaes-python >= 20240114 -libcreg-python >= 20200725 -libewf-python >= 20131210 -libfcrypto-python >= 20240114 -libfsapfs-python >= 20220709 -libfsext-python >= 20220829 -libfsfat-python >= 20220925 -libfshfs-python >= 20220831 -libfsntfs-python >= 20251018 -libfsxfs-python >= 20220829 -libfvde-python >= 20220121 -libfwnt-python >= 20210717 -libluksde-python >= 20220121 -libmodi-python >= 20210405 -libphdi-python >= 20220228 -libqcow-python >= 20201213 -libregf-python >= 20201002 -libsigscan-python >= 20230109 -libsmdev-python >= 20140529 -libsmraw-python >= 20140612 -libvhdi-python >= 20201014 -libvmdk-python >= 20140421 -libvsapm-python >= 20230506 -libvsgpt-python >= 20211115 -libvshadow-python >= 20160109 -libvslvm-python >= 20160109 -pytsk3 >= 20210419 -xattr >= 0.7.2 ; platform_system != "Windows" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 44284e1..0000000 --- a/setup.cfg +++ /dev/null @@ -1,41 +0,0 @@ -[metadata] -name = dfimagetools -version = 20251124 -description = Storage media image tools -long_description = Collection of tools to process storage media images. -long_description_content_type = text/plain -url = https://github.com/log2timeline/dfimagetools -maintainer = Log2Timeline maintainers -maintainer_email = log2timeline-maintainers@googlegroups.com -license = Apache License, Version 2.0 -license_files = - ACKNOWLEDGEMENTS - AUTHORS - LICENSE - README -classifiers = - Development Status :: 3 - Alpha - Programming Language :: Python - -[options] -install_requires = file:requirements.txt -package_dir = - dfimagetools = dfimagetools -packages = find: -python_requires = >=3.10 - -[options.packages.find] -exclude = - docs - tests - tests.* - utils -where = . - -[options.entry_points] -console_scripts = - extract_data_streams = dfimagetools.scripts.extract_data_streams:Main - list_file_entries = dfimagetools.scripts.list_file_entries:Main - map_extents = dfimagetools.scripts.map_extents:Main - recursive_hasher = dfimagetools.scripts.recursive_hasher:Main - source_analyzer = dfimagetools.scripts.source_analyzer:Main diff --git a/setup.py b/setup.py deleted file mode 100755 index 232fc4f..0000000 --- a/setup.py +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -"""Installation and deployment script.""" - -from setuptools import setup - - -setup() diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tox.ini b/tox.ini index d9f9e6b..994d320 100644 --- a/tox.ini +++ b/tox.ini @@ -11,8 +11,6 @@ passenv = setenv = PYTHONPATH = {toxinidir} deps = - -rrequirements.txt - -rtest_requirements.txt coverage: coverage wheel: build @@ -43,13 +41,11 @@ passenv = setenv = PYTHONPATH = {toxinidir} deps = - -rrequirements.txt - -rtest_requirements.txt pylint >= 3.3.0, < 3.4.0 setuptools >= 65 yamllint >= 1.26.0 commands = pylint --version yamllint -v - pylint --rcfile=.pylintrc dfimagetools setup.py tests + pylint --rcfile=.pylintrc dfimagetools tests yamllint -c .yamllint.yaml test_data diff --git a/utils/dependencies.py b/utils/dependencies.py index a2c4040..4767e85 100644 --- a/utils/dependencies.py +++ b/utils/dependencies.py @@ -26,7 +26,7 @@ class DependencyDefinition(object): skip_check (bool): True if the dependency should be skipped by the CheckDependencies or CheckTestDependencies methods of DependencyHelper. skip_requires (bool): True if the dependency should be excluded from - requirements.txt or setup.py install_requires. + pyproject.toml dependencies. version_property (str): name of the version attribute or function. """ diff --git a/utils/update_release.sh b/utils/update_release.sh index ae99e14..ff12b48 100755 --- a/utils/update_release.sh +++ b/utils/update_release.sh @@ -11,8 +11,8 @@ VERSION=$(date -u +"%Y%m%d") # Update the Python module version. sed "s/__version__ = '[0-9]*'/__version__ = '${VERSION}'/" -i dfimagetools/__init__.py -# Update the version in the setuptools configuration. -sed "s/version = [0-9]*/version = ${VERSION}/" -i setup.cfg +# Update the version in the pyproject configuration. +sed "s/version = \"[0-9]*\"/version = \"${VERSION}\"/" -i pyproject.toml # Ensure shebangs of Python scripts are consistent. find . -name \*.py -exec sed '1s?^#!.*$?#!/usr/bin/env python3?' -i {} \;