From 7b5160df7decbf55ae573f3d3feb9d5e0ca9ea21 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Wed, 9 Oct 2024 22:49:57 +0100 Subject: [PATCH 1/7] Add Windows as a supported platform --- .gitattributes | 1 + .github/workflows/lint.yml | 7 +++++-- pyproject.toml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 00a7b00c9..ee0f759ba 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ .git_archival.txt export-subst +* text=auto eol=lf diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1d7e3e744..a24292376 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,13 +16,16 @@ on: jobs: build: - runs-on: ubuntu-latest - strategy: matrix: python-version: ['3.12'] + platform: [ubuntu-latest, windows-latest] + + runs-on: ${{ matrix.platform }} + steps: - uses: actions/checkout@v4 + - name: Install uv uses: astral-sh/setup-uv@v3 diff --git a/pyproject.toml b/pyproject.toml index 1ee0a0786..6cad37348 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,7 @@ classifiers = [ "Environment :: Web Environment", "Framework :: Pytest", "License :: OSI Approved :: MIT License", + "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.12", From a3e9d39571927d9e51cc43db54adcaa20fb650c2 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 08:31:54 +0100 Subject: [PATCH 2/7] Try removing $ --- docs/source/docker.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/source/docker.rst b/docs/source/docker.rst index e46c5d146..af2fe58e8 100644 --- a/docs/source/docker.rst +++ b/docs/source/docker.rst @@ -20,22 +20,25 @@ The VWS and VWQ containers must point to the target manager container using the Creating containers ^^^^^^^^^^^^^^^^^^^ -.. code-block:: console +.. code-block:: shell + + docker network create -d bridge vws-bridge-network - $ docker network create -d bridge vws-bridge-network - $ docker run \ + docker run \ --detach \ --publish 5005:5000 \ --name vuforia-target-manager-mock \ --network vws-bridge-network \ adamtheturtle/vuforia-target-manager-mock - $ docker run \ + + docker run \ --detach \ --publish 5006:5000 \ -e TARGET_MANAGER_BACKEND=vuforia-target-manager-mock:5000 \ --network vws-bridge-network \ adamtheturtle/vuforia-vws-mock - $ docker run \ + + docker run \ --detach \ --publish 5007:5000 \ -e TARGET_MANAGER_BACKEND=vuforia-target-manager-mock:5000 \ From a001ff646278f5c71ac0df99b329d9d6e062ecda Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 08:43:40 +0100 Subject: [PATCH 3/7] For now, ignore false positive error --- .pre-commit-config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 665b95adc..a44cb7e05 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,8 +70,9 @@ repos: - id: shellcheck-docs name: shellcheck-docs + # We exclude SC2215 as it is a false positive for an unknown reason on Windows. entry: uv run --extra=dev doccmd --language=shell --language=console --command="shellcheck - --shell=bash --exclude=SC1017" + --shell=bash --exclude=SC1017 --exclude=SC2215" language: python types_or: [markdown, rst] additional_dependencies: [uv] From 452060f61f6c5b1259f7b6c6825d85eb444da899 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 08:56:49 +0100 Subject: [PATCH 4/7] Try using hadolint official pre-commit hook --- .pre-commit-config.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a44cb7e05..f306789da 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,11 @@ repos: - id: text-unicode-replacement-char - id: rst-backticks + - repo: https://github.com/hadolint/hadolint + rev: v2.10.0 + hooks: + - id: hadolint + - repo: local hooks: - id: custom-linters @@ -187,17 +192,6 @@ repos: stages: [manual] types_or: [markdown, rst, python, toml] - - id: hadolint-docker - name: Lint Dockerfiles - description: Runs hadolint Docker image to lint Dockerfiles - language: docker_image - types_or: [dockerfile] - stages: [manual] # Requires Docker to be running - # We choose not to use a Python wrapper or alternative to hadolint as none - # appear to be well maintained, and they require more setup than we would - # want. - entry: ghcr.io/hadolint/hadolint hadolint - - id: ruff-check-fix name: Ruff check fix entry: uv run --extra=dev -m ruff check --fix From f9f745c7f62d85780cae64bed2b7d92c739b39d1 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 08:57:26 +0100 Subject: [PATCH 5/7] Bump hadolint --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f306789da..c9c080917 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - id: rst-backticks - repo: https://github.com/hadolint/hadolint - rev: v2.10.0 + rev: v2.12.0 hooks: - id: hadolint From abecc86e4b778be22d5ea266ffe87a1eeb21587a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 09:01:28 +0100 Subject: [PATCH 6/7] Try a hadolint pre-commit hook which downloads the binary --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c9c080917..0968c0ee4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,8 +35,8 @@ repos: - id: text-unicode-replacement-char - id: rst-backticks - - repo: https://github.com/hadolint/hadolint - rev: v2.12.0 + - repo: https://github.com/AleksaC/hadolint-py + rev: v2.12.1b3 hooks: - id: hadolint From 28495fd848f13512e3e9389201fb3faaf6080bb5 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Thu, 10 Oct 2024 09:04:19 +0100 Subject: [PATCH 7/7] Revert bad attempt at fixing shellcheck issue --- docs/source/docker.rst | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/docs/source/docker.rst b/docs/source/docker.rst index af2fe58e8..e46c5d146 100644 --- a/docs/source/docker.rst +++ b/docs/source/docker.rst @@ -20,25 +20,22 @@ The VWS and VWQ containers must point to the target manager container using the Creating containers ^^^^^^^^^^^^^^^^^^^ -.. code-block:: shell - - docker network create -d bridge vws-bridge-network +.. code-block:: console - docker run \ + $ docker network create -d bridge vws-bridge-network + $ docker run \ --detach \ --publish 5005:5000 \ --name vuforia-target-manager-mock \ --network vws-bridge-network \ adamtheturtle/vuforia-target-manager-mock - - docker run \ + $ docker run \ --detach \ --publish 5006:5000 \ -e TARGET_MANAGER_BACKEND=vuforia-target-manager-mock:5000 \ --network vws-bridge-network \ adamtheturtle/vuforia-vws-mock - - docker run \ + $ docker run \ --detach \ --publish 5007:5000 \ -e TARGET_MANAGER_BACKEND=vuforia-target-manager-mock:5000 \