From 75ef3ca004f6c168cbf55e7f1ba5eaf66b5377d0 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 11 Feb 2024 05:35:59 +0100 Subject: [PATCH] Remove end-of-life Python 3.7 support --- .github/workflows/test_docs.yml | 2 +- .github/workflows/test_tox.yml | 8 +++----- config/dpkg/changelog | 4 ++-- docs/conf.py | 1 + docs/sources/user/Installation-instructions.md | 6 +++--- dtfabric/__init__.py | 2 +- dtfabric/data_types.py | 18 +++++++++++++++--- dtfabric/runtime/data_maps.py | 6 +++++- pyproject.toml | 7 +++++++ setup.cfg | 4 ++-- tox.ini | 15 +++++++++++++-- utils/update_release.sh | 2 +- 12 files changed, 54 insertions(+), 21 deletions(-) diff --git a/.github/workflows/test_docs.yml b/.github/workflows/test_docs.yml index 50ec681..8481133 100644 --- a/.github/workflows/test_docs.yml +++ b/.github/workflows/test_docs.yml @@ -36,7 +36,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index f393288..44a7178 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -14,8 +14,6 @@ jobs: strategy: matrix: include: - - python-version: '3.7' - toxenv: 'py37,wheel' - python-version: '3.8' toxenv: 'py38,wheel' - python-version: '3.9' @@ -46,7 +44,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox @@ -82,7 +80,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox @@ -120,7 +118,7 @@ jobs: add-apt-repository -y ppa:deadsnakes/ppa add-apt-repository -y ppa:gift/dev apt-get update -q - apt-get install -y build-essential git libffi-dev python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml + apt-get install -y build-essential git python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-distutils python3-mock python3-pip python3-setuptools python3-yaml - name: Install tox run: | python3 -m pip install tox diff --git a/config/dpkg/changelog b/config/dpkg/changelog index a6d44f5..75de63d 100644 --- a/config/dpkg/changelog +++ b/config/dpkg/changelog @@ -1,5 +1,5 @@ -dtfabric (20231227-1) unstable; urgency=low +dtfabric (20240211-1) unstable; urgency=low * Auto-generated - -- Joachim Metz Wed, 27 Dec 2023 07:02:16 +0100 + -- Joachim Metz Sun, 11 Feb 2024 05:34:33 +0100 diff --git a/docs/conf.py b/docs/conf.py index daf0dea..580f298 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,6 +52,7 @@ # docstrings. napoleon_google_docstring = True napoleon_numpy_docstring = False +napoleon_include_init_with_doc = True napoleon_include_private_with_doc = False napoleon_include_special_with_doc = True diff --git a/docs/sources/user/Installation-instructions.md b/docs/sources/user/Installation-instructions.md index b3e68f5..bbbe98a 100644 --- a/docs/sources/user/Installation-instructions.md +++ b/docs/sources/user/Installation-instructions.md @@ -27,7 +27,7 @@ To deactivate the virtualenv run: deactivate ``` -## Ubuntu 18.04 and 20.04 LTS +## Ubuntu 22.04 LTS To install dtFabric from the [GIFT Personal Package Archive (PPA)](https://launchpad.net/~gift): @@ -49,14 +49,14 @@ necessary packages for running dtFabric. l2tbinaries provides the following branches: * master; branch intended for the "packaged release" of dtFabric and dependencies; +* staging; branch intended for testing pre-releases of dtFabric; * dev; branch intended for the "development release" of dtFabric; * testing; branch intended for testing newly created packages. The l2tdevtools project provides [an update script](https://github.com/log2timeline/l2tdevtools/wiki/Update-script) to ease the process of keeping the dependencies up to date. -The script requires [pywin32](https://github.com/mhammond/pywin32/releases) and -[Python WMI](https://pypi.org/project/WMI/). +The script requires [pywin32](https://github.com/mhammond/pywin32/releases). To install the release versions of the dependencies run: diff --git a/dtfabric/__init__.py b/dtfabric/__init__.py index fa68653..b770ca8 100644 --- a/dtfabric/__init__.py +++ b/dtfabric/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- """Data type fabric.""" -__version__ = '20231227' +__version__ = '20240211' diff --git a/dtfabric/data_types.py b/dtfabric/data_types.py index 1667c27..40fca32 100644 --- a/dtfabric/data_types.py +++ b/dtfabric/data_types.py @@ -433,7 +433,11 @@ def __init__( @property def members(self) -> 'List[DataTypeDefinition]': - """members (list[DataTypeDefinition]): member data type definitions.""" + """Retrieves the member data type definitions. + + Returns: + list[DataTypeDefinition]: member data type definitions. + """ return list(self._members_by_name.values()) def AddMemberDefinition( @@ -868,7 +872,11 @@ def __init__( @property def members(self) -> 'List[DataTypeDefinition]': - """members (list[DataTypeDefinition]): member data type definitions.""" + """Retrieves the member data type definitions. + + Returns: + list[DataTypeDefinition]: member data type definitions. + """ return list(self._members_by_name.values()) def AddMemberDefinition( @@ -941,7 +949,11 @@ def __init__( @property def members(self) -> 'List[DataTypeDefinition]': - """members (list[DataTypeDefinition]): member data type definitions.""" + """Retrieves the member data type definitions. + + Returns: + list[DataTypeDefinition]: member data type definitions. + """ return list(self._members_by_name.values()) def AddMemberDefinition( diff --git a/dtfabric/runtime/data_maps.py b/dtfabric/runtime/data_maps.py index 019f1a1..e8bccb5 100644 --- a/dtfabric/runtime/data_maps.py +++ b/dtfabric/runtime/data_maps.py @@ -2175,7 +2175,11 @@ class FormatMap(LayoutDataTypeMap): @property def layout(self): - """list[LayoutElementDefinition]: layout element definitions.""" + """Retrieves the layout element definitions. + + Returns: + list[LayoutElementDefinition]: layout element definitions. + """ return getattr(self._data_type_definition, 'layout', []) def MapByteStream(self, byte_stream, **unused_kwargs): # pylint: disable=redundant-returns-doc diff --git a/pyproject.toml b/pyproject.toml index 9787c3b..ee74093 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,10 @@ [build-system] requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" + +[tool.docformatter] +black = false +non-cap = ["dfDateTime", "dfImageTools", "dfVFS", "dfWinReg", "dtFabric", "iMessage", "iOS", "iPod", "mDNS"] +non-strict = false +wrap-summaries = 80 +wrap-descriptions = 80 diff --git a/setup.cfg b/setup.cfg index b4786f6..346ad83 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = dtfabric -version = 20231227 +version = 20240211 description = Data type fabric (dtfabric) long_description = dtFabric, or data type fabric, is a project to manage data types and structures, as used in the libyal projects. long_description_content_type = text/plain @@ -22,7 +22,7 @@ install_requires = file:requirements.txt package_dir = dtfabric = dtfabric packages = find: -python_requires = >=3.7 +python_requires = >=3.8 scripts = scripts/validate-definitions.py diff --git a/tox.ini b/tox.ini index 6179037..ad63129 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py3{7,8,9,10,11,12},coverage,docs,lint,wheel +envlist = py3{8,9,10,11,12},coverage,docformatter,docs,lint,wheel [testenv] allowlist_externals = ./run_tests.py @@ -19,12 +19,19 @@ deps = setuptools >= 65 wheel commands = - py3{7,8,9,10,11,12}: ./run_tests.py + py3{8,9,10,11,12}: ./run_tests.py coverage: coverage erase coverage: coverage run --source=dtfabric --omit="*_test*,*__init__*,*test_lib*" run_tests.py coverage: coverage xml wheel: python -m build --no-isolation --wheel +[testenv:docformatter] +usedevelop = True +deps = + docformatter +commands = + docformatter --in-place --recursive dtfabric tests + [testenv:docs] usedevelop = True deps = @@ -45,10 +52,14 @@ setenv = deps = -rrequirements.txt -rtest_requirements.txt + docformatter pylint >= 3.0.0, < 3.1.0 + setuptools yamllint >= 1.26.0 commands = + docformatter --version pylint --version yamllint -v + docformatter --check --diff --recursive dtfabric scripts setup.py tests pylint --rcfile=.pylintrc dtfabric scripts setup.py tests yamllint -c .yamllint.yaml test_data diff --git a/utils/update_release.sh b/utils/update_release.sh index 313ba10..78f5651 100755 --- a/utils/update_release.sh +++ b/utils/update_release.sh @@ -25,7 +25,7 @@ dtfabric (${VERSION}-1) unstable; urgency=low EOT # Regenerate the API documentation. -tox -edocs +tox -edocformatter,docs exit ${EXIT_SUCCESS};