From 99c0fa423d3c11b31ca2f2e503e4c53ab16dbc17 Mon Sep 17 00:00:00 2001 From: Joachim Metz Date: Sun, 27 Sep 2026 07:21:11 +0200 Subject: [PATCH] Changes for CI tests --- .github/workflows/lint.yml | 28 ++++++++++++++----- .github/workflows/test_macos.yml | 2 +- .github/workflows/test_tox.yml | 10 ++----- .github/workflows/test_windows.yml | 12 +++----- .shellcheckrc | 2 ++ .typos.toml | 11 ++++++++ acstore/helpers/json_serializer.py | 2 +- acstore/sqlite_store.py | 2 +- .../sources/user/Installation-instructions.md | 2 +- pyproject.toml | 4 +-- tox.ini | 13 +++++---- utils/update_release.sh | 6 ---- 12 files changed, 54 insertions(+), 40 deletions(-) create mode 100644 .shellcheckrc create mode 100644 .typos.toml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index c0bb74d..3356117 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,12 +1,6 @@ # Check source. name: lint -on: - pull_request: - branches: - - main - push: - branches: - - main +on: [pull_request, push] permissions: read-all jobs: black: @@ -49,6 +43,26 @@ jobs: LANG: en_US.UTF-8 run: | tox -e pylint + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - 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 + steps: + - uses: actions/checkout@v6 + - name: Install rumdl + run: cargo install --locked typos-cli + - name: Check for typos + run: | + typos yamllint: runs-on: ubuntu-latest strategy: diff --git a/.github/workflows/test_macos.yml b/.github/workflows/test_macos.yml index 4132820..5cad276 100644 --- a/.github/workflows/test_macos.yml +++ b/.github/workflows/test_macos.yml @@ -1,6 +1,6 @@ # Run tests on Mac OS. name: test_macos -on: [push, pull_request] +on: [pull_request, push] permissions: read-all jobs: test_macos: diff --git a/.github/workflows/test_tox.yml b/.github/workflows/test_tox.yml index 498e372..25749fe 100644 --- a/.github/workflows/test_tox.yml +++ b/.github/workflows/test_tox.yml @@ -1,12 +1,6 @@ # Run tox tests on Ubuntu Docker images using the deadsnakes and GIFT PPAs name: test_tox -on: - pull_request: - branches: - - main - push: - branches: - - main +on: [pull_request, push] permissions: read-all jobs: build: @@ -24,6 +18,8 @@ jobs: toxenv: 'py313' - python-version: '3.14' toxenv: 'py314' + - python-version: '3.15' + toxenv: 'py315' container: image: ubuntu:26.04 steps: diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 28c0518..e9a5b26 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -1,6 +1,6 @@ # Run tests on Windows. name: test_windows -on: [push, pull_request] +on: [pull_request, push] permissions: read-all jobs: test_windows: @@ -20,17 +20,13 @@ jobs: 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 PyYAML + 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/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000..0308127 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,2 @@ +shell=bash +severity=warning diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..a55472f --- /dev/null +++ b/.typos.toml @@ -0,0 +1,11 @@ +[files] +extend-exclude = [ + "test_data/" +] + +[default] +binary = false +check-filename = true +check-file = true +unicode = true +locale = "en-us" diff --git a/acstore/helpers/json_serializer.py b/acstore/helpers/json_serializer.py index 5ff8aff..2c469e5 100644 --- a/acstore/helpers/json_serializer.py +++ b/acstore/helpers/json_serializer.py @@ -12,7 +12,7 @@ class AttributeContainerJSONSerializer: @classmethod def ConvertAttributeContainerToJSON(cls, attribute_container): - """Converts an attribute container object into a JSON dictioary. + """Converts an attribute container object into a JSON dictionary. The resulting dictionary of the JSON serialized objects consists of: { diff --git a/acstore/sqlite_store.py b/acstore/sqlite_store.py index cf3cf9d..01e041e 100644 --- a/acstore/sqlite_store.py +++ b/acstore/sqlite_store.py @@ -797,7 +797,7 @@ def CheckSupportedFormat(cls, path): bool: True if the format is supported. """ # Check if the path is an existing file, to prevent sqlite3 creating - # an emtpy database file. + # an empty database file. if not os.path.isfile(path): return False diff --git a/docs/sources/user/Installation-instructions.md b/docs/sources/user/Installation-instructions.md index 8048d1d..7170827 100644 --- a/docs/sources/user/Installation-instructions.md +++ b/docs/sources/user/Installation-instructions.md @@ -14,7 +14,7 @@ cd acstore_venv source ./bin/activate ``` -Upgrade pip and install ACStore dependencies: +Upgrade pip and install ACStore: ```bash pip install --upgrade pip diff --git a/pyproject.toml b/pyproject.toml index 40349af..0564d95 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 = "acstore" -version = "20260709" +version = "20260927" description = "Attribute Container Storage (ACStore)" maintainers = [ { name = "Log2Timeline maintainers", email = "log2timeline-maintainers@googlegroups.com" }, diff --git a/tox.ini b/tox.ini index 69a8eae..c5a0e79 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,8 @@ [tox] -envlist = py3{10,11,12,13,14},black,coverage,docformatter,docs,pylint,wheel,yamllint +envlist = py3{10,11,12,13,14,15},black,coverage,docformatter,docs,pylint,wheel,yamllint [testenv] +download = True pip_pre = True passenv = CFLAGS @@ -13,10 +14,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=acstore --omit="*_test*,*__init__*,*test_lib*" run_tests.py coverage: coverage xml @@ -33,7 +34,7 @@ setenv = PYTHONPATH = {toxinidir} deps = black - setuptools >= 65 + setuptools >= 77 commands = black --version black . @@ -49,7 +50,7 @@ setenv = PYTHONPATH = {toxinidir} deps = docformatter - setuptools >= 65 + setuptools >= 77 commands = docformatter --version docformatter --in-place --recursive acstore tests @@ -88,7 +89,7 @@ passenv = setenv = PYTHONPATH = {toxinidir} deps = - setuptools >= 65 + setuptools >= 77 yamllint >= 1.26.0 commands = yamllint -v diff --git a/utils/update_release.sh b/utils/update_release.sh index 8cc5ca8..55bdf78 100755 --- a/utils/update_release.sh +++ b/utils/update_release.sh @@ -3,9 +3,6 @@ # Script that makes changes in preparation of a new release, such as updating # the version and documentation. -EXIT_FAILURE=1 -EXIT_SUCCESS=0 - VERSION=$(date -u +"%Y%m%d") # Update the Python module version. @@ -30,6 +27,3 @@ EOT # Regenerate the API documentation. tox -edocs - -exit ${EXIT_SUCCESS} -