From 2d9f38da093436c49f361d9aecbb31122e4592fb Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Thu, 5 Nov 2026 07:41:42 +0100 Subject: [PATCH] Changes to manage script and for CI tests --- data/presets.ini | 2 +- data/templates/github_actions/build_wheel.yml | 18 ++++---- .../github_actions/lint.yml/header.yml | 12 +++--- .../github_actions/lint.yml/yamllint.yml | 4 +- data/templates/github_actions/test_docker.yml | 6 +-- data/templates/github_actions/test_docs.yml | 4 +- data/templates/github_actions/test_macos.yml | 4 +- data/templates/github_actions/test_tox.yml | 8 ++-- .../test_windows-with_dependencies.yml | 6 +-- .../templates/github_actions/test_windows.yml | 6 +-- data/templates/tox.ini/header | 1 + tools/manage.py | 41 +++++++++++-------- 12 files changed, 59 insertions(+), 53 deletions(-) diff --git a/data/presets.ini b/data/presets.ini index 11c5d35e..779808cb 100644 --- a/data/presets.ini +++ b/data/presets.ini @@ -29,7 +29,7 @@ projects: libexe,libfcrypto,libfwevt,libfwps,libfwsi,libhmac,libwrc projects: boto3,botocore,cachetools,dateutil,docutils,google-api-core,google-auth-httplib2,google-api-python-client,google-auth,googleapis-common-protos,grpcio,httplib2,jmespath,libcloudforensics,protobuf,pyasn1,pyasn1-modules,rsa,s3transfer,uritemplate [libyal] -projects: libbde,libcaes,libcdata,libcdatetime,libcdirectory,libcerror,libcfile,libclocale,libcnotify,libcpath,libcreg,libcsplit,libcthreads,libesedb,libevt,libevtx,libewf,libexe,libfcrypto,libfsext,libfsfat,libfshfs,libfsntfs,libfsxfs,libfvde,libfwevt,libfwnt,libfwps,libfwsi,libhmac,liblnk,libluksde,libmodi,libmsiecf,libolecf,libphdi,libqcow,libregf,libscca,libsigscan,libsmdev,libsmraw,libvhdi,libvmdk,libvsapm,libvsbsdl,libvsgpt,libvshadow,libvslvm,libwrc +projects: libcerror,libcdata,libcdatetime,libclocale,libcnotify,libcsplit,libuna,libcfile,libcpath,libbfio,libsigscan,libcaes,libhmac,libfcache,libfdata,libfdatetime,libfguid,libfmos,libfole,libfwnt,libfusn,libfvalue,libfwevt,libfwps,libfwsi,libcreg,libesedb,libevt,libevtx,libexe,liblnk,libmodi,libmsiecf,libolecf,libregf,libscca,libwrc,libfsapfs,libfsext,libfsfat,libfshfs,libfsntfs,libfsxfs,libbde,libfvde,libluksde,libphdi,libvsapm,libvsgpt,libvshadow,libvslvm,libewf,libqcow,libsmdev,libsmraw,libvhdi,libvmdk [plaso] presets: dfimagetools diff --git a/data/templates/github_actions/build_wheel.yml b/data/templates/github_actions/build_wheel.yml index 3f118079..53e26fb2 100644 --- a/data/templates/github_actions/build_wheel.yml +++ b/data/templates/github_actions/build_wheel.yml @@ -2,7 +2,7 @@ name: build_wheels concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install build dependencies @@ -28,7 +28,7 @@ jobs: - name: Build sdist run: | python -m build --sdist - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: cibw-sdist path: dist/*.tar.gz @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install build dependencies @@ -47,7 +47,7 @@ jobs: - name: Build wheel run: | python -m build --wheel - - uses: actions/upload-artifact@v7 + - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: cibw-wheels path: dist/*.whl @@ -60,12 +60,12 @@ jobs: id-token: write if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: pattern: cibw-* path: dist merge-multiple: true - - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: repository-url: https://test.pypi.org/legacy/ upload_pypi: @@ -77,9 +77,9 @@ jobs: id-token: write if: github.event_name == 'release' && github.event.action == 'published' steps: - - uses: actions/download-artifact@v8 + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: pattern: cibw-* path: dist merge-multiple: true - - uses: pypa/gh-action-pypi-publish@release/v1 + - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 diff --git a/data/templates/github_actions/lint.yml/header.yml b/data/templates/github_actions/lint.yml/header.yml index 86e2608b..dfb21931 100644 --- a/data/templates/github_actions/lint.yml/header.yml +++ b/data/templates/github_actions/lint.yml/header.yml @@ -2,7 +2,7 @@ name: lint concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -13,11 +13,11 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Check format of Python code - uses: psf/black@stable + uses: psf/black@258e7dbf348bc23cb70b8cdf693481c04634ebcc # 26.10.1 with: options: "--check" src: "." @@ -30,7 +30,7 @@ jobs: container: image: ubuntu:26.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container @@ -59,7 +59,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install shellcheck @@ -73,7 +73,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install rumdl diff --git a/data/templates/github_actions/lint.yml/yamllint.yml b/data/templates/github_actions/lint.yml/yamllint.yml index 732c3b47..1dbfdf2e 100644 --- a/data/templates/github_actions/lint.yml/yamllint.yml +++ b/data/templates/github_actions/lint.yml/yamllint.yml @@ -5,11 +5,11 @@ matrix: python-version: ['3.14'] steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python $${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: $${{ matrix.python-version }} cache: 'pip' diff --git a/data/templates/github_actions/test_docker.yml b/data/templates/github_actions/test_docker.yml index cb48cc5d..230e3c20 100644 --- a/data/templates/github_actions/test_docker.yml +++ b/data/templates/github_actions/test_docker.yml @@ -2,7 +2,7 @@ name: test_docker concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: push: permissions: @@ -17,7 +17,7 @@ jobs: container: image: registry.fedoraproject.org/fedora:$${{ matrix.version }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container @@ -50,7 +50,7 @@ jobs: container: image: ubuntu:$${{ matrix.version }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container diff --git a/data/templates/github_actions/test_docs.yml b/data/templates/github_actions/test_docs.yml index 98a1a5b7..21bc3dd8 100644 --- a/data/templates/github_actions/test_docs.yml +++ b/data/templates/github_actions/test_docs.yml @@ -2,7 +2,7 @@ name: test_docs concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: branches: @@ -22,7 +22,7 @@ jobs: container: image: ubuntu:26.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container diff --git a/data/templates/github_actions/test_macos.yml b/data/templates/github_actions/test_macos.yml index ac53a2fd..1156bbd3 100644 --- a/data/templates/github_actions/test_macos.yml +++ b/data/templates/github_actions/test_macos.yml @@ -2,7 +2,7 @@ name: test_macos concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -19,7 +19,7 @@ jobs: python-version: '3.14' toxenv: 'py314' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Install dependencies diff --git a/data/templates/github_actions/test_tox.yml b/data/templates/github_actions/test_tox.yml index 061b47ad..79c16ace 100644 --- a/data/templates/github_actions/test_tox.yml +++ b/data/templates/github_actions/test_tox.yml @@ -2,7 +2,7 @@ name: test_tox concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -30,7 +30,7 @@ jobs: container: image: ubuntu:26.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container @@ -65,7 +65,7 @@ jobs: container: image: ubuntu:26.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up container @@ -92,6 +92,6 @@ jobs: run: | tox -e coverage - name: Upload coverage report to Codecov - uses: codecov/codecov-action@v6 + uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 with: token: $${{ secrets.CODECOV_TOKEN }} diff --git a/data/templates/github_actions/test_windows-with_dependencies.yml b/data/templates/github_actions/test_windows-with_dependencies.yml index bf86dcad..f5a4d97a 100644 --- a/data/templates/github_actions/test_windows-with_dependencies.yml +++ b/data/templates/github_actions/test_windows-with_dependencies.yml @@ -2,7 +2,7 @@ name: test_windows concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -21,11 +21,11 @@ jobs: steps: - name: Configure git run: git config --global core.autocrlf false - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python $${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: $${{ matrix.python-version }} cache: 'pip' diff --git a/data/templates/github_actions/test_windows.yml b/data/templates/github_actions/test_windows.yml index bf86dcad..f5a4d97a 100644 --- a/data/templates/github_actions/test_windows.yml +++ b/data/templates/github_actions/test_windows.yml @@ -2,7 +2,7 @@ name: test_windows concurrency: group: $${{ github.workflow }}-$${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: $${{ github.ref != 'refs/heads/main' }} on: pull_request: push: @@ -21,11 +21,11 @@ jobs: steps: - name: Configure git run: git config --global core.autocrlf false - - uses: actions/checkout@v6 + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - name: Set up Python $${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: $${{ matrix.python-version }} cache: 'pip' diff --git a/data/templates/tox.ini/header b/data/templates/tox.ini/header index 12a32dc0..87ac98e3 100644 --- a/data/templates/tox.ini/header +++ b/data/templates/tox.ini/header @@ -10,6 +10,7 @@ passenv = CPPFLAGS LDFLAGS setenv = + PYO3_USE_ABI3_FORWARD_COMPATIBILITY = 1 PYTHONPATH = {toxinidir} deps = coverage: coverage diff --git a/tools/manage.py b/tools/manage.py index c7842e96..5f525c69 100755 --- a/tools/manage.py +++ b/tools/manage.py @@ -472,6 +472,9 @@ def _ComparePackages(self, reference_packages, packages): new_packages[name] = version continue + if not packages[name]: + continue + version_tuple = packages[name].split(".") new_version_tuple = version.split(".") @@ -546,30 +549,32 @@ def CompareDirectoryWithCSV(self, reference_directory, csv_file): # in the source packages that use the naming convention: # package-version-#.tar.gz # package-version-#.zip - if not directory_entry.endswith(".tar.gz") and not directory_entry.endswith( - ".zip" + # package_version.orig.tar.gz + if directory_entry.endswith(".debian.tar.gz") or directory_entry.endswith( + "-1.tar.gz" ): continue - if ( - directory_entry.endswith(".debian.tar.gz") - or directory_entry.endswith(".orig.tar.gz") - or directory_entry.endswith("-1.tar.gz") + if directory_entry.endswith(".orig.tar.gz"): + package_name, _, _ = directory_entry.rpartition(".orig.tar.gz") + package_name, _, package_version = package_name.rpartition("_") + elif directory_entry.endswith(".tar.gz") or directory_entry.endswith( + ".zip" ): + package_name, _, _ = directory_entry.rpartition(".") + if package_name.endswith(".tar"): + package_name, _, _ = package_name.rpartition(".") + package_name, _, package_version = package_name.rpartition("-") + + if ( + package_name.endswith("-alpha") + or package_name.endswith("-beta") + or package_name.endswith("-experimental") + ): + package_name, _, _ = package_name.rpartition("-") + else: continue - package_name, _, _ = directory_entry.rpartition(".") - if package_name.endswith(".tar"): - package_name, _, _ = package_name.rpartition(".") - package_name, _, package_version = package_name.rpartition("-") - - if ( - package_name.endswith("-alpha") - or package_name.endswith("-beta") - or package_name.endswith("-experimental") - ): - package_name, _, _ = package_name.rpartition("-") - if package_name in reference_packages: package_version_tuple = package_version.split(".") version_tuple = reference_packages[package_name].split(".")