diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml index 3ac7de1a..ba7fe3fc 100644 --- a/.github/workflows/build_wheel.yml +++ b/.github/workflows/build_wheel.yml @@ -1,5 +1,8 @@ # Build Python sdist and wheel. name: build_wheels +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true on: pull_request: push: @@ -7,13 +10,17 @@ on: types: [published] # Allow trigger via API workflow_dispatch: -permissions: read-all +permissions: + contents: read jobs: build_sdist: name: Build sdist runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install build dependencies run: | sudo apt update @@ -28,8 +35,11 @@ jobs: build_wheel: name: Build wheel runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install build dependencies run: | sudo apt update @@ -44,6 +54,7 @@ jobs: upload_test_pypi: needs: [build_sdist, build_wheel] runs-on: ubuntu-latest + timeout-minutes: 60 environment: pypi permissions: id-token: write @@ -60,6 +71,7 @@ jobs: upload_pypi: needs: [upload_test_pypi] runs-on: ubuntu-latest + timeout-minutes: 60 environment: pypi permissions: id-token: write diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 522ac4a3..4711dfcc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,18 +1,21 @@ # Check source. name: lint +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true on: pull_request: - branches: - - main push: - branches: - - main -permissions: read-all +permissions: + contents: read jobs: black: runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Check format of Python code uses: psf/black@stable with: @@ -20,6 +23,7 @@ jobs: src: "." pylint: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: python-version: ['3.14'] @@ -27,6 +31,8 @@ jobs: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -49,3 +55,15 @@ jobs: LANG: en_US.UTF-8 run: | tox -e pylint + typos: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Install rumdl + run: cargo install --locked typos-cli + - name: Check for typos + run: | + typos diff --git a/.github/workflows/test_docker.yml b/.github/workflows/test_docker.yml index 3cc3b2d4..9a560d81 100644 --- a/.github/workflows/test_docker.yml +++ b/.github/workflows/test_docker.yml @@ -1,10 +1,16 @@ # Run tests on Fedora and Ubuntu Docker images using GIFT COPR and GIFT PPA on commit name: test_docker -on: [push] -permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +on: + push: +permissions: + contents: read jobs: test_fedora: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: version: ['44'] @@ -12,6 +18,8 @@ jobs: image: registry.fedoraproject.org/fedora:${{ matrix.version }} steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container run: | dnf install -y dnf-plugins-core langpacks-en @@ -35,6 +43,7 @@ jobs: python3 -m build --no-isolation --wheel test_ubuntu: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: version: ['26.04'] @@ -42,6 +51,8 @@ jobs: image: ubuntu:${{ matrix.version }} steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive diff --git a/.github/workflows/test_macos.yml b/.github/workflows/test_macos.yml index 4132820d..e76cf966 100644 --- a/.github/workflows/test_macos.yml +++ b/.github/workflows/test_macos.yml @@ -1,10 +1,17 @@ # Run tests on Mac OS. name: test_macos -on: [push, pull_request] -permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +on: + pull_request: + push: +permissions: + contents: read jobs: test_macos: runs-on: ${{ matrix.os }} + timeout-minutes: 60 strategy: matrix: include: @@ -13,6 +20,8 @@ jobs: toxenv: 'py314' steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install dependencies run: | brew update -q diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index 457cee18..86e3f9af 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -1,16 +1,17 @@ # Run tox tests on Ubuntu Docker images using the deadsnakes and GIFT PPAs name: test_tox +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true on: pull_request: - branches: - - main push: - branches: - - main -permissions: read-all +permissions: + contents: read jobs: build: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: include: @@ -20,10 +21,14 @@ jobs: toxenv: 'py313' - python-version: '3.14' toxenv: 'py314' + - python-version: '3.15' + toxenv: 'py315' container: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -43,11 +48,13 @@ jobs: apt install -y build-essential git pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-pip python3-setuptools tox - name: Run tests env: + CPATH: /usr/include/python${{ matrix.python-version }} LANG: en_US.UTF-8 run: | tox -e ${{ matrix.toxenv }},wheel coverage: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: python-version: ['3.14'] @@ -55,6 +62,8 @@ jobs: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -74,6 +83,7 @@ jobs: apt install -y build-essential curl git pkg-config python${{ matrix.python-version }} python${{ matrix.python-version }}-dev python${{ matrix.python-version }}-venv python3-pip python3-setuptools tox - name: Run tests with coverage env: + CPATH: /usr/include/python${{ matrix.python-version }} LANG: en_US.UTF-8 run: | tox -e coverage diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 04331fb5..2e8f6996 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -1,10 +1,17 @@ # Run tests on Windows. name: test_windows -on: [push, pull_request] -permissions: read-all +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +on: + pull_request: + push: +permissions: + contents: read jobs: test_windows: runs-on: ${{ matrix.os }} + timeout-minutes: 60 strategy: matrix: include: @@ -15,15 +22,20 @@ jobs: - name: Configure git run: git config --global core.autocrlf false - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} cache: 'pip' + cache-dependency-path: 'tox.ini' - name: Install tox run: | python -m pip install --upgrade pip python -m pip install tox tox-gh-actions - name: Run tests + env: + PIP_CACHE_DIR: ~\AppData\Local\pip\Cache run: | tox -e ${{ matrix.toxenv }} diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..e450ab33 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,35 @@ +[files] +extend-exclude = [ + "test_data/" +] + +[default] +binary = false +check-filename = true +check-file = true +unicode = true +locale = "en-us" +extend-ignore-re = [ + # Ignore a line that is preceded with `# typos:ignore` + "(#|//)\\s*typos:ignore\\n.*", + + # Ignore code blocks between `# typos:disable` and `# typos:enable` + "(?s)(#|//)\\s*typos:disable.*?\\n\\s*(#|//)\\s*typos:enable", + + # Ignore text between and + "(?s).*?", + + # Ignore 'rpmbuild_flags="-ba"' + 'rpmbuild_flags="-ba"', + + # Ignore "Ned Batchelder" + "\\bNed Batchelder\\b", + + # Ignore "Yann Collet" + "\\bYann Collet\\b", +] +extend-words = { + "astroid" = "astroid", + "certifi" = "certifi", + "flor" = "flor", +} diff --git a/config/docker/build_dpkg.sh b/config/docker/build_dpkg.sh index 5ff171d2..4b20972c 100755 --- a/config/docker/build_dpkg.sh +++ b/config/docker/build_dpkg.sh @@ -27,13 +27,13 @@ then # Run the container in interactive mode ("run -it") to use gpg-agent to sign the builds docker run \ -it \ - -u ${UID}:${GID} \ + -u "${UID}:${GID}" \ -v "${GNUPG_DIRECTORY}:/home/ubuntu/.gnupg:z" \ -v "${L2TBUILDS_DIRECTORY}:/home/ubuntu/l2tbuilds:z" \ log2timeline/l2tbuilds_ubuntu else docker run \ - -u ${UID}:${GID} \ + -u "${UID}:${GID}" \ -v "${L2TBUILDS_DIRECTORY}:/home/ubuntu/l2tbuilds:z" \ log2timeline/l2tbuilds_ubuntu \ /bin/bash -c "(cd l2tdevtools && ./utils/build_dpkg.sh --preset plaso)" diff --git a/data/licenses/LICENSE.certifi b/data/licenses/LICENSE.certifi index 802b53ff..c2fda9a2 100644 --- a/data/licenses/LICENSE.certifi +++ b/data/licenses/LICENSE.certifi @@ -1,4 +1,4 @@ -This packge contains a modified version of ca-bundle.crt: +This package contains a modified version of ca-bundle.crt: ca-bundle.crt -- Bundle of CA Root Certificates diff --git a/data/templates/gift_copr_install.sh b/data/templates/gift_copr_install.sh index eb24d754..397bceac 100644 --- a/data/templates/gift_copr_install.sh +++ b/data/templates/gift_copr_install.sh @@ -21,16 +21,20 @@ ${debug_dependencies} sudo dnf install -q dnf-plugins-core sudo dnf copr -q -y enable @gift/dev +# shellcheck disable=SC2086 sudo dnf install -q -y $${PYTHON3_DEPENDENCIES} if [[ "$$*" =~ "include-debug" ]]; then + # shellcheck disable=SC2086 sudo dnf install -q -y $${DEBUG_DEPENDENCIES} fi if [[ "$$*" =~ "include-development" ]]; then + # shellcheck disable=SC2086 sudo dnf install -q -y $${DEVELOPMENT_DEPENDENCIES} fi if [[ "$$*" =~ "include-test" ]]; then + # shellcheck disable=SC2086 sudo dnf install -q -y $${TEST_DEPENDENCIES} fi diff --git a/data/templates/github_actions/build_wheel.yml b/data/templates/github_actions/build_wheel.yml index 3ac7de1a..3f118079 100644 --- a/data/templates/github_actions/build_wheel.yml +++ b/data/templates/github_actions/build_wheel.yml @@ -1,5 +1,8 @@ # Build Python sdist and wheel. name: build_wheels +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true on: pull_request: push: @@ -7,13 +10,17 @@ on: types: [published] # Allow trigger via API workflow_dispatch: -permissions: read-all +permissions: + contents: read jobs: build_sdist: name: Build sdist runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install build dependencies run: | sudo apt update @@ -28,8 +35,11 @@ jobs: build_wheel: name: Build wheel runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install build dependencies run: | sudo apt update @@ -44,6 +54,7 @@ jobs: upload_test_pypi: needs: [build_sdist, build_wheel] runs-on: ubuntu-latest + timeout-minutes: 60 environment: pypi permissions: id-token: write @@ -60,6 +71,7 @@ jobs: upload_pypi: needs: [upload_test_pypi] runs-on: ubuntu-latest + timeout-minutes: 60 environment: pypi permissions: id-token: write diff --git a/data/templates/github_actions/lint.yml/header.yml b/data/templates/github_actions/lint.yml/header.yml index 9c4e5224..86e2608b 100644 --- a/data/templates/github_actions/lint.yml/header.yml +++ b/data/templates/github_actions/lint.yml/header.yml @@ -1,18 +1,21 @@ # Check source. name: lint +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true on: pull_request: - branches: - - main push: - branches: - - main -permissions: read-all +permissions: + contents: read jobs: black: runs-on: ubuntu-latest + timeout-minutes: 60 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Check format of Python code uses: psf/black@stable with: @@ -20,6 +23,7 @@ jobs: src: "." pylint: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: python-version: ['3.14'] @@ -27,6 +31,8 @@ jobs: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -49,3 +55,29 @@ jobs: LANG: en_US.UTF-8 run: | tox -e pylint + shellcheck: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Install shellcheck + run: | + sudo apt-get update + sudo apt-get install -y shellcheck + - name: Check format of bash scripts + run: | + find . -name "*.sh" -exec shellcheck {} + + typos: + runs-on: ubuntu-latest + timeout-minutes: 60 + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Install rumdl + run: cargo install --locked typos-cli + - name: Check for typos + run: | + typos diff --git a/data/templates/github_actions/lint.yml/yamllint.yml b/data/templates/github_actions/lint.yml/yamllint.yml index c211b8c0..732c3b47 100644 --- a/data/templates/github_actions/lint.yml/yamllint.yml +++ b/data/templates/github_actions/lint.yml/yamllint.yml @@ -1,14 +1,19 @@ yamllint: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: - python-version: ['3.12'] + python-version: ['3.14'] steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up Python $${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: $${{ matrix.python-version }} + cache: 'pip' + cache-dependency-path: 'tox.ini' - name: Install tox run: | python -m pip install tox diff --git a/data/templates/github_actions/test_docker.yml b/data/templates/github_actions/test_docker.yml index 22bf044f..cb48cc5d 100644 --- a/data/templates/github_actions/test_docker.yml +++ b/data/templates/github_actions/test_docker.yml @@ -1,10 +1,16 @@ # Run tests on Fedora and Ubuntu Docker images using GIFT COPR and GIFT PPA on commit name: test_docker -on: [push] -permissions: read-all +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true +on: + push: +permissions: + contents: read jobs: test_fedora: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: version: ['44'] @@ -12,6 +18,8 @@ jobs: image: registry.fedoraproject.org/fedora:$${{ matrix.version }} steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container run: | dnf install -y dnf-plugins-core langpacks-en @@ -35,6 +43,7 @@ jobs: python3 -m build --no-isolation --wheel test_ubuntu: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: version: ['26.04'] @@ -42,6 +51,8 @@ jobs: image: ubuntu:$${{ matrix.version }} steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive diff --git a/data/templates/github_actions/test_docs.yml b/data/templates/github_actions/test_docs.yml index 5023b0a7..98a1a5b7 100644 --- a/data/templates/github_actions/test_docs.yml +++ b/data/templates/github_actions/test_docs.yml @@ -1,5 +1,8 @@ # Run docs tox tests on Ubuntu Docker images using the deadsnakes and GIFT PPAs name: test_docs +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true on: pull_request: branches: @@ -7,10 +10,12 @@ on: push: branches: - main -permissions: read-all +permissions: + contents: read jobs: build: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: python-version: ['3.14'] @@ -18,6 +23,8 @@ jobs: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive diff --git a/data/templates/github_actions/test_macos.yml b/data/templates/github_actions/test_macos.yml index af376325..ac53a2fd 100644 --- a/data/templates/github_actions/test_macos.yml +++ b/data/templates/github_actions/test_macos.yml @@ -1,10 +1,17 @@ # Run tests on Mac OS. name: test_macos -on: [push, pull_request] -permissions: read-all +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true +on: + pull_request: + push: +permissions: + contents: read jobs: test_macos: runs-on: $${{ matrix.os }} + timeout-minutes: 60 strategy: matrix: include: @@ -13,6 +20,8 @@ jobs: toxenv: 'py314' steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Install dependencies run: | brew update -q diff --git a/data/templates/github_actions/test_tox.yml b/data/templates/github_actions/test_tox.yml index aa8656c2..061b47ad 100644 --- a/data/templates/github_actions/test_tox.yml +++ b/data/templates/github_actions/test_tox.yml @@ -1,16 +1,17 @@ # Run tox tests on Ubuntu Docker images using the deadsnakes and GIFT PPAs name: test_tox +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true on: pull_request: - branches: - - main push: - branches: - - main -permissions: read-all +permissions: + contents: read jobs: build: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: include: @@ -24,10 +25,14 @@ jobs: toxenv: 'py313' - python-version: '3.14' toxenv: 'py314' + - python-version: '3.15' + toxenv: 'py315' container: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -47,11 +52,13 @@ jobs: apt install -y build-essential git ${dpkg_dev_dependencies} python$${{ matrix.python-version }} python$${{ matrix.python-version }}-dev python$${{ matrix.python-version }}-venv ${dpkg_dependencies} - name: Run tests env: + CPATH: /usr/include/python$${{ matrix.python-version }} LANG: en_US.UTF-8 run: | tox -e $${{ matrix.toxenv }},wheel coverage: runs-on: ubuntu-latest + timeout-minutes: 60 strategy: matrix: python-version: ['3.14'] @@ -59,6 +66,8 @@ jobs: image: ubuntu:26.04 steps: - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up container env: DEBIAN_FRONTEND: noninteractive @@ -78,6 +87,7 @@ jobs: apt install -y build-essential curl git ${dpkg_dev_dependencies} python$${{ matrix.python-version }} python$${{ matrix.python-version }}-dev python$${{ matrix.python-version }}-venv ${dpkg_dependencies} - name: Run tests with coverage env: + CPATH: /usr/include/python$${{ matrix.python-version }} LANG: en_US.UTF-8 run: | tox -e coverage diff --git a/data/templates/github_actions/test_windows-with_dependencies.yml b/data/templates/github_actions/test_windows-with_dependencies.yml index b6c23fbb..bf86dcad 100644 --- a/data/templates/github_actions/test_windows-with_dependencies.yml +++ b/data/templates/github_actions/test_windows-with_dependencies.yml @@ -1,10 +1,17 @@ # Run tests on Windows. name: test_windows -on: [push, pull_request] -permissions: read-all +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true +on: + pull_request: + push: +permissions: + contents: read jobs: test_windows: runs-on: $${{ matrix.os }} + timeout-minutes: 60 strategy: matrix: include: @@ -15,22 +22,20 @@ jobs: - name: Configure git run: git config --global core.autocrlf false - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up Python $${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: $${{ matrix.python-version }} cache: 'pip' - - name: Install dependencies - shell: cmd - run: | - git clone https://github.com/log2timeline/l2tdevtools.git ..\l2tdevtools - set PYTHONPATH=..\l2tdevtools - mkdir downloads - python ..\l2tdevtools\tools\update.py --download-directory downloads --machine-type amd64 --track dev ${dependencies} + cache-dependency-path: 'tox.ini' - name: Install tox run: | python -m pip install --upgrade pip python -m pip install tox tox-gh-actions - name: Run tests + env: + PIP_CACHE_DIR: ~\AppData\Local\pip\Cache run: | tox -e $${{ matrix.toxenv }} diff --git a/data/templates/github_actions/test_windows.yml b/data/templates/github_actions/test_windows.yml index c0785e2a..bf86dcad 100644 --- a/data/templates/github_actions/test_windows.yml +++ b/data/templates/github_actions/test_windows.yml @@ -1,10 +1,17 @@ # Run tests on Windows. name: test_windows -on: [push, pull_request] -permissions: read-all +concurrency: + group: $${{ github.workflow }}-$${{ github.ref }} + cancel-in-progress: true +on: + pull_request: + push: +permissions: + contents: read jobs: test_windows: runs-on: $${{ matrix.os }} + timeout-minutes: 60 strategy: matrix: include: @@ -15,15 +22,20 @@ jobs: - name: Configure git run: git config --global core.autocrlf false - uses: actions/checkout@v6 + with: + persist-credentials: false - name: Set up Python $${{ matrix.python-version }} uses: actions/setup-python@v6 with: python-version: $${{ matrix.python-version }} cache: 'pip' + cache-dependency-path: 'tox.ini' - name: Install tox run: | python -m pip install --upgrade pip python -m pip install tox tox-gh-actions - name: Run tests + env: + PIP_CACHE_DIR: ~\AppData\Local\pip\Cache run: | tox -e $${{ matrix.toxenv }} diff --git a/data/templates/linux_scripts/ubuntu_install_project.sh b/data/templates/linux_scripts/ubuntu_install_project.sh index d421f996..f9098e72 100644 --- a/data/templates/linux_scripts/ubuntu_install_project.sh +++ b/data/templates/linux_scripts/ubuntu_install_project.sh @@ -26,21 +26,25 @@ ${development_dependencies} # Additional dependencies for debugging, alphabetized, one per line. ${debug_dependencies} -sudo add-apt-repository ppa:gift/$${GIFT_PPA_TRACK} -y +sudo add-apt-repository "ppa:gift/$${GIFT_PPA_TRACK}" -y sudo apt update -q +# shellcheck disable=SC2086 sudo apt install -q -y $${PYTHON_DEPENDENCIES} if [[ "$$*" =~ "include-debug" ]]; then + # shellcheck disable=SC2086 sudo apt install -q -y $${DEBUG_DEPENDENCIES} fi if [[ "$$*" =~ "include-development" ]]; then + # shellcheck disable=SC2086 sudo apt install -q -y $${DEVELOPMENT_DEPENDENCIES} fi if [[ "$$*" =~ "include-test" ]]; then + # shellcheck disable=SC2086 sudo apt install -q -y $${TEST_DEPENDENCIES} fi diff --git a/data/templates/pyproject.toml/header.toml b/data/templates/pyproject.toml/header.toml index 9787c3bd..cb600497 100644 --- a/data/templates/pyproject.toml/header.toml +++ b/data/templates/pyproject.toml/header.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=77", "wheel"] build-backend = "setuptools.build_meta" diff --git a/data/templates/tox.ini/header b/data/templates/tox.ini/header index 738c44fd..12a32dc0 100644 --- a/data/templates/tox.ini/header +++ b/data/templates/tox.ini/header @@ -2,9 +2,11 @@ envlist = ${envlist} [testenv] +download = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = @@ -13,10 +15,10 @@ deps = coverage: coverage wheel: build - setuptools >= 65 + setuptools >= 77 wheel commands = - py3{10,11,12,13,14}: python run_tests.py + py3{10,11,12,13,14,15}: python run_tests.py coverage: coverage erase coverage: coverage run --source=${python_module_name} --omit="*_test*,*__init__*,*test_lib*" run_tests.py coverage: coverage xml diff --git a/data/templates/tox.ini/testenv_black b/data/templates/tox.ini/testenv_black index df5352fb..97b5ae96 100644 --- a/data/templates/tox.ini/testenv_black +++ b/data/templates/tox.ini/testenv_black @@ -4,13 +4,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = black - setuptools >= 65 + setuptools >= 77 commands = black --version black . diff --git a/data/templates/tox.ini/testenv_docformatter b/data/templates/tox.ini/testenv_docformatter index c7edc11a..c3b442d8 100644 --- a/data/templates/tox.ini/testenv_docformatter +++ b/data/templates/tox.ini/testenv_docformatter @@ -4,13 +4,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = docformatter - setuptools >= 65 + setuptools >= 77 commands = docformatter --version docformatter --in-place --recursive ${paths_to_lint_python} diff --git a/data/templates/tox.ini/testenv_pylint b/data/templates/tox.ini/testenv_pylint index 185c7f30..43d1ef5c 100644 --- a/data/templates/tox.ini/testenv_pylint +++ b/data/templates/tox.ini/testenv_pylint @@ -4,13 +4,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = pylint >= 4.0.0, < 4.1.0 - setuptools >= 65 + setuptools >= 77 commands = pylint --version pylint --rcfile=.pylintrc ${paths_to_lint_python} diff --git a/data/templates/tox.ini/testenv_yamllint b/data/templates/tox.ini/testenv_yamllint index 03225b49..da2103e7 100644 --- a/data/templates/tox.ini/testenv_yamllint +++ b/data/templates/tox.ini/testenv_yamllint @@ -4,12 +4,13 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = - setuptools >= 65 + setuptools >= 77 yamllint >= 1.26.0 commands = yamllint -v diff --git a/l2tdevtools/build_helpers/rpm.py b/l2tdevtools/build_helpers/rpm.py index ce6644e1..385e8048 100644 --- a/l2tdevtools/build_helpers/rpm.py +++ b/l2tdevtools/build_helpers/rpm.py @@ -463,7 +463,7 @@ def _GenerateSpecFile( ) except (FileNotFoundError, TypeError, ValueError) as exception: logging.warning( - f"Unable to gerenate rpm spec file with error: {exception!s}" + f"Unable to generate rpm spec file with error: {exception!s}" ) result = False diff --git a/l2tdevtools/dependencies.py b/l2tdevtools/dependencies.py index 4fe664c1..d8a6a292 100644 --- a/l2tdevtools/dependencies.py +++ b/l2tdevtools/dependencies.py @@ -598,6 +598,7 @@ def GetPylintRcExtensionPkgs(self): "pyfwps", "pyfwsi", "pyhmac", + "pykeramics", "pylnk", "pyluksde", "pymodi", diff --git a/l2tdevtools/dependency_writers/tox_ini.py b/l2tdevtools/dependency_writers/tox_ini.py index 31797d37..06d09116 100644 --- a/l2tdevtools/dependency_writers/tox_ini.py +++ b/l2tdevtools/dependency_writers/tox_ini.py @@ -76,7 +76,7 @@ def Write(self): if os.path.isdir("tools"): paths_to_lint_python.append("tools") - envlist = ["py3{10,11,12,13,14}", "black", "coverage", "docformatter"] + envlist = ["py3{10,11,12,13,14,15}", "black", "coverage", "docformatter"] if os.path.isdir("docs"): envlist.append("docs") diff --git a/l2tdevtools/download_helpers/pypi.py b/l2tdevtools/download_helpers/pypi.py index d687b511..1454b36e 100644 --- a/l2tdevtools/download_helpers/pypi.py +++ b/l2tdevtools/download_helpers/pypi.py @@ -15,7 +15,7 @@ def __init__(self, download_url, source_name=None): Args: download_url (str): download URL. - source_name (Optional[str]): PyPI source pacakge name, where None + source_name (Optional[str]): PyPI source package name, where None indicates the source package name is the same as the PyPI project name. diff --git a/l2tdevtools/spec_file.py b/l2tdevtools/spec_file.py index e249797d..dc9a583d 100644 --- a/l2tdevtools/spec_file.py +++ b/l2tdevtools/spec_file.py @@ -603,7 +603,7 @@ def _WritePython3PackageFiles( output_string = output_string.format(**template_mappings) output_file_object.write(output_string) - def _WriteSpecFileFromTempate( + def _WriteSpecFileFromTemplate( self, project_definition, source_directory, project_version, output_file_object ): """Writes the RPM spec file from a template. @@ -778,7 +778,7 @@ def Generate( with open(output_file, "w", encoding="utf8") as output_file_object: if project_definition.rpm_template_spec: - result = self._WriteSpecFileFromTempate( + result = self._WriteSpecFileFromTemplate( project_definition, source_directory, project_version, diff --git a/pyproject.toml b/pyproject.toml index c23fa57a..cc4570a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["setuptools", "wheel"] +requires = ["setuptools>=77", "wheel"] build-backend = "setuptools.build_meta" [project] name = "l2tdevtools" -version = "20260704" +version = "20261029" description = "Development tools for the log2timeline projects" maintainers = [ { name = "Log2Timeline maintainers", email = "log2timeline-maintainers@googlegroups.com" }, diff --git a/tests/download_helpers/pypi.py b/tests/download_helpers/pypi.py index d749657a..3233adcb 100644 --- a/tests/download_helpers/pypi.py +++ b/tests/download_helpers/pypi.py @@ -18,8 +18,8 @@ class PyPIDownloadHelperTest(test_lib.BaseTestCase): _GIT_URL = "https://github.com/log2timeline/dfvfs.git" _PROJECT_NAME = "dfvfs" - _PROJECT_VERSION = "20260731" - _PYPI_VERSION = "20260731" + _PROJECT_VERSION = "20260924" + _PYPI_VERSION = "20260924" @classmethod def setUpClass(cls): diff --git a/tests/update.py b/tests/update.py index 52a4d792..00f0e012 100644 --- a/tests/update.py +++ b/tests/update.py @@ -26,11 +26,9 @@ def testGetPackageDownloadURLs(self): download_helper = update.GithubRepoDownloadHelper( self._DOWNLOAD_URL, branch="dev" ) - package_download_urls = download_helper.GetPackageDownloadURLs( - preferred_machine_type="x86", preferred_operating_system="Windows" + preferred_machine_type="amd64", preferred_operating_system="Windows" ) - if (sys.version_info[0], sys.version_info[1]) not in ( download_helper._SUPPORTED_PYTHON_VERSIONS ): @@ -40,7 +38,7 @@ def testGetPackageDownloadURLs(self): self.assertIsNotNone(package_download_urls) expected_url = ( - f"https://github.com/log2timeline/l2tbinaries/raw/dev/win32/" + f"https://github.com/log2timeline/l2tbinaries/raw/dev/win64/" f"{self._PROJECT_NAME:s}-{self._PROJECT_VERSION:s}-py3-none-any.whl" ) self.assertIn(expected_url, package_download_urls) @@ -52,16 +50,15 @@ class DependencyUpdaterTest(test_lib.BaseTestCase): # pylint: disable=protected-access _PROJECT_NAME = "dfvfs" - _PROJECT_VERSION = "20260717" + _PROJECT_VERSION = "20260924" def testGetAvailableWheelPackages(self): """Tests the _GetAvailableWheelPackages function.""" dependency_updater = update.DependencyUpdater( download_track="dev", - preferred_machine_type="x86", + preferred_machine_type="amd64", preferred_operating_system="Windows", ) - available_packages = dependency_updater._GetAvailableWheelPackages() if (sys.version_info[0], sys.version_info[1]) not in ( @@ -97,10 +94,9 @@ def testUpdatePackages(self): download_directory=temp_directory, download_only=True, download_track="dev", - preferred_machine_type="x86", + preferred_machine_type="amd64", preferred_operating_system="Windows", ) - dependency_updater.UpdatePackages(projects_file, [self._PROJECT_NAME]) glob_results = sorted(glob.glob(os.path.join(temp_directory, "*.whl"))) diff --git a/tox.ini b/tox.ini index 38a0d40e..ece8f5c4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,12 @@ [tox] -envlist = py3{10,11,12,13,14},black,coverage,docformatter,pylint,wheel +envlist = py3{10,11,12,13,14,15},black,coverage,docformatter,pylint,wheel [testenv] +download = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = @@ -13,10 +15,10 @@ deps = coverage: coverage wheel: build - setuptools >= 65 + setuptools >= 77 wheel commands = - py3{10,11,12,13,14}: python run_tests.py + py3{10,11,12,13,14,15}: python run_tests.py coverage: coverage erase coverage: coverage run --source=l2tdevtools --omit="*_test*,*__init__*,*test_lib*" run_tests.py coverage: coverage xml @@ -27,13 +29,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = black - setuptools >= 65 + setuptools >= 77 commands = black --version black . @@ -43,13 +46,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = docformatter - setuptools >= 65 + setuptools >= 77 commands = docformatter --version docformatter --in-place --recursive l2tdevtools tests tools @@ -59,13 +63,14 @@ skipsdist = True pip_pre = True passenv = CFLAGS + CPATH CPPFLAGS LDFLAGS setenv = PYTHONPATH = {toxinidir} deps = pylint >= 4.0.0, < 4.1.0 - setuptools >= 65 + setuptools >= 77 commands = pylint --version pylint --rcfile=.pylintrc l2tdevtools tests tools