From 30ba1374b8e2a1472d00dab9d82b4777e8fba429 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 22:19:05 +0000 Subject: [PATCH 1/6] Remove Makefile and replace make commands with direct equivalents --- Makefile | 14 -------------- admin/create_secrets_files.py | 3 +++ docs/source/ci-setup.rst | 3 ++- docs/source/contributing.rst | 4 ++-- 4 files changed, 7 insertions(+), 17 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index e6ee537af..000000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -SHELL := /bin/bash -euxo pipefail -.PHONY: update-secrets -update-secrets: - # After updating secrets, commit the new secrets.tar.gpg file. - tar cvf secrets.tar ci_secrets/ - gpg --yes --batch --passphrase=${PASSPHRASE_FOR_VUFORIA_SECRETS} --symmetric --cipher-algo AES256 secrets.tar - -.PHONY: docs -docs: - uv run --extra=dev sphinx-build -M html docs/source docs/build -W - -.PHONY: open-docs -open-docs: - python -c 'import os, webbrowser; webbrowser.open("file://" + os.path.abspath("docs/build/html/index.html"))' diff --git a/admin/create_secrets_files.py b/admin/create_secrets_files.py index 702091c87..3b1e4244f 100644 --- a/admin/create_secrets_files.py +++ b/admin/create_secrets_files.py @@ -10,6 +10,9 @@ $ export EXISTING_SECRETS_FILE=/existing/file/with/inactive/db/creds # You may have to run this a few times, but it is idempotent. $ python admin/create_secrets_files.py + # After creating the secrets, update the encrypted archive: + $ tar cvf secrets.tar ci_secrets/ + $ gpg --yes --batch --passphrase=${PASSPHRASE_FOR_VUFORIA_SECRETS} --symmetric --cipher-algo AES256 secrets.tar """ import datetime diff --git a/docs/source/ci-setup.rst b/docs/source/ci-setup.rst index 0c46b4d0b..3e8c4bfd9 100644 --- a/docs/source/ci-setup.rst +++ b/docs/source/ci-setup.rst @@ -35,7 +35,8 @@ Add the encrypted secrets files to the repository: .. code-block:: console - $ PASSPHRASE_FOR_VUFORIA_SECRETS="" make update-secrets + $ tar cvf secrets.tar ci_secrets/ + $ gpg --yes --batch --passphrase=${PASSPHRASE_FOR_VUFORIA_SECRETS} --symmetric --cipher-algo AES256 secrets.tar $ git add secrets.tar.gpg $ git commit -m "Update secret archive" $ git push diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index daa07ba76..e507386e4 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -120,8 +120,8 @@ Run the following commands to build and view documentation locally: .. code-block:: console - $ make docs - $ make open-docs + $ uv run --extra=dev sphinx-build -M html docs/source docs/build -W + $ python -c 'import os, webbrowser; webbrowser.open("file://" + os.path.abspath("docs/build/html/index.html"))' Continuous Integration ---------------------- From ae9f6b1fe93b998387d667e17fd751b771fb2b0b Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 22:26:53 +0000 Subject: [PATCH 2/6] Quote an environment variable --- admin/create_secrets_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/create_secrets_files.py b/admin/create_secrets_files.py index 3b1e4244f..d226395d9 100644 --- a/admin/create_secrets_files.py +++ b/admin/create_secrets_files.py @@ -12,7 +12,7 @@ $ python admin/create_secrets_files.py # After creating the secrets, update the encrypted archive: $ tar cvf secrets.tar ci_secrets/ - $ gpg --yes --batch --passphrase=${PASSPHRASE_FOR_VUFORIA_SECRETS} --symmetric --cipher-algo AES256 secrets.tar + $ gpg --yes --batch --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" --symmetric --cipher-algo AES256 secrets.tar """ import datetime From 188a51d9c2bd970bf65e92d84024936358bb685b Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 22:27:23 +0000 Subject: [PATCH 3/6] Fix ruff --- admin/create_secrets_files.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/admin/create_secrets_files.py b/admin/create_secrets_files.py index d226395d9..19c971199 100644 --- a/admin/create_secrets_files.py +++ b/admin/create_secrets_files.py @@ -12,7 +12,13 @@ $ python admin/create_secrets_files.py # After creating the secrets, update the encrypted archive: $ tar cvf secrets.tar ci_secrets/ - $ gpg --yes --batch --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" --symmetric --cipher-algo AES256 secrets.tar + $ gpg \ + --yes \ + --batch \ + --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" \ + --symmetric \ + --cipher-algo AES256 \ + secrets.tar """ import datetime From 0850aa718e416cd9d1a993302606ae3ce34af42a Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Mon, 27 Oct 2025 22:29:07 +0000 Subject: [PATCH 4/6] Improve docstring --- admin/create_secrets_files.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/admin/create_secrets_files.py b/admin/create_secrets_files.py index 19c971199..0f0a45146 100644 --- a/admin/create_secrets_files.py +++ b/admin/create_secrets_files.py @@ -4,14 +4,12 @@ $ export VWS_EMAIL_ADDRESS=... $ export VWS_PASSWORD=... - # For ``make update-secrets`` to work, this has to be ``./ci_secrets``, or - # you have to copy the secrets there later. $ export NEW_SECRETS_DIR=... $ export EXISTING_SECRETS_FILE=/existing/file/with/inactive/db/creds # You may have to run this a few times, but it is idempotent. $ python admin/create_secrets_files.py # After creating the secrets, update the encrypted archive: - $ tar cvf secrets.tar ci_secrets/ + $ tar cvf secrets.tar "${NEW_SECRETS_DIR}" $ gpg \ --yes \ --batch \ From 283379de6b357804204c883a2195beed4f4ed229 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 28 Oct 2025 10:39:15 +0000 Subject: [PATCH 5/6] Fix quoting in GPG command for secrets archive --- docs/source/ci-setup.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/ci-setup.rst b/docs/source/ci-setup.rst index 3e8c4bfd9..dbe735882 100644 --- a/docs/source/ci-setup.rst +++ b/docs/source/ci-setup.rst @@ -36,7 +36,7 @@ Add the encrypted secrets files to the repository: .. code-block:: console $ tar cvf secrets.tar ci_secrets/ - $ gpg --yes --batch --passphrase=${PASSPHRASE_FOR_VUFORIA_SECRETS} --symmetric --cipher-algo AES256 secrets.tar + $ gpg --yes --batch --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" --symmetric --cipher-algo AES256 secrets.tar $ git add secrets.tar.gpg $ git commit -m "Update secret archive" $ git push From 60c30dfacbfeb0eaa0244461549f33e110b365fd Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Tue, 28 Oct 2025 11:45:24 +0000 Subject: [PATCH 6/6] Move instructions to contributing docs --- admin/create_secrets_files.py | 18 +----------------- docs/source/contributing.rst | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/admin/create_secrets_files.py b/admin/create_secrets_files.py index 0f0a45146..4a6dd7449 100644 --- a/admin/create_secrets_files.py +++ b/admin/create_secrets_files.py @@ -1,22 +1,6 @@ """Create licenses and target databases for the tests to run against. -Usage: - - $ export VWS_EMAIL_ADDRESS=... - $ export VWS_PASSWORD=... - $ export NEW_SECRETS_DIR=... - $ export EXISTING_SECRETS_FILE=/existing/file/with/inactive/db/creds - # You may have to run this a few times, but it is idempotent. - $ python admin/create_secrets_files.py - # After creating the secrets, update the encrypted archive: - $ tar cvf secrets.tar "${NEW_SECRETS_DIR}" - $ gpg \ - --yes \ - --batch \ - --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" \ - --symmetric \ - --cipher-algo AES256 \ - secrets.tar +See the instructions in the contributing guide in the documentation. """ import datetime diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index e507386e4..6d7d40a7a 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -91,8 +91,25 @@ To create an inactive project, delete the license key associated with a database Targets sometimes get stuck at the "Processing" stage meaning that they cannot be deleted. When this happens, create a new target database to use for testing. -To create databases without using the browser, use :file:`admin/create_secrets_files.py`. -See instructions in that file. +To create databases without using the browser, use :file:`admin/create_secrets_files.py`: + +.. code-block:: bash + + $ export VWS_EMAIL_ADDRESS=... + $ export VWS_PASSWORD=... + $ export NEW_SECRETS_DIR=... + $ export EXISTING_SECRETS_FILE=/existing/file/with/inactive/db/creds + # You may have to run this a few times, but it is idempotent. + $ python admin/create_secrets_files.py + # After creating the secrets, update the encrypted archive: + $ tar cvf secrets.tar "${NEW_SECRETS_DIR}" + $ gpg \ + --yes \ + --batch \ + --passphrase="${PASSPHRASE_FOR_VUFORIA_SECRETS}" \ + --symmetric \ + --cipher-algo AES256 \ + secrets.tar .. _Vuforia License Manager: https://developer.vuforia.com/vui/develop/licenses .. _Vuforia Target Manager: https://developer.vuforia.com/vui/develop/databases