tenseleyflow/sway / 00a638d

Browse files

.pre-commit-hooks: isolated variant → dlm-sway[hf]==0.1.0 + add docker_image variant

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
00a638da14d5fdc6a591f7c31875888d8d89bcfc
Parents
4355f24
Tree
0161ad0

1 changed file

StatusFile+-
M .pre-commit-hooks.yaml 31 7
.pre-commit-hooks.yamlmodified
@@ -1,8 +1,8 @@
1
 # sway pre-commit hooks (S19).
1
 # sway pre-commit hooks (S19).
2
 #
2
 #
3
-# Two variants — pick the one that matches your install posture. Both
3
+# Three variants — pick the one that matches your install posture.
4
-# run ``sway gate`` under the hood and differ only in how sway itself
4
+# All three run ``sway gate`` under the hood and differ only in how
5
-# is resolved on the runner.
5
+# sway itself is resolved on the runner.
6
 #
6
 #
7
 # Variant 1: ``sway-gate`` (RECOMMENDED) — ``language: system``.
7
 # Variant 1: ``sway-gate`` (RECOMMENDED) — ``language: system``.
8
 #   Uses the sway binary already on your ``PATH``. Fast, no extra
8
 #   Uses the sway binary already on your ``PATH``. Fast, no extra
@@ -16,7 +16,14 @@
16
 #   takes ~2 minutes; subsequent runs reuse the cached venv. Right
16
 #   takes ~2 minutes; subsequent runs reuse the cached venv. Right
17
 #   choice for users without a pre-existing sway install.
17
 #   choice for users without a pre-existing sway install.
18
 #
18
 #
19
-# Both variants set ``pass_filenames: false`` — ``sway gate`` takes
19
+# Variant 3: ``sway-gate-docker`` — ``language: docker_image``.
20
+#   Pulls the pre-built ``ghcr.io/tenseleyflow/sway-gate`` image
21
+#   (torch wheels baked in, MiniLM weights pre-cached). First run is
22
+#   ~1 minute to pull + warm; subsequent runs reuse the local image.
23
+#   Right choice for zero-install CI / ephemeral runners with docker
24
+#   available. Requires docker on the host.
25
+#
26
+# All variants set ``pass_filenames: false`` — ``sway gate`` takes
20
 # exactly one spec path via ``args:``, not a list of matched files.
27
 # exactly one spec path via ``args:``, not a list of matched files.
21
 # The ``files:`` regex only decides WHEN the hook fires; the ``args:``
28
 # The ``files:`` regex only decides WHEN the hook fires; the ``args:``
22
 # in your ``.pre-commit-config.yaml`` decides WHAT spec it gates.
29
 # in your ``.pre-commit-config.yaml`` decides WHAT spec it gates.
@@ -47,9 +54,26 @@
47
     use this variant when you can't rely on a host-level sway install.
54
     use this variant when you can't rely on a host-level sway install.
48
   entry: sway gate
55
   entry: sway gate
49
   language: python
56
   language: python
50
-  # Pinned to a specific commit — sway hasn't tagged a release yet.
57
+  # v0.1.0 on PyPI — consumer ``rev:`` in .pre-commit-config.yaml
51
-  # When v0.1.0 ships, we'll switch to tag-based pinning.
58
+  # tracks the sway release tag ("v0.1.0", "v0.2.0", ...). Closes
59
+  # audit-03 F05.
52
   additional_dependencies:
60
   additional_dependencies:
53
-    - "dlm-sway[hf] @ git+https://github.com/tenseleyFlow/sway.git@2ecd9a0c9d65a9b9576a185597c88f41444f9646"
61
+    - "dlm-sway[hf]==0.1.0"
62
+  files: '(?:(^|/)sway\.ya?ml|\.dlm$|(^|/)adapter.*(adapter_config\.json|adapter_model\.safetensors)$)'
63
+  pass_filenames: false
64
+
65
+- id: sway-gate-docker
66
+  name: sway gate (docker image) — differential testing for fine-tuned LMs
67
+  description: |
68
+    Same as sway-gate, but pre-commit pulls the pre-built sway-gate
69
+    Docker image and runs sway inside it. Torch wheels are baked in;
70
+    MiniLM weights are pre-cached. Fastest first-run path when you
71
+    already have docker on the host.
72
+  # For ``language: docker_image`` pre-commit treats the first token
73
+  # of ``entry:`` as the image to pull and the rest as the command to
74
+  # run inside it. Tag tracks the sway release; the image is built by
75
+  # .github/workflows/docker.yml on ``v*`` tag push.
76
+  entry: ghcr.io/tenseleyflow/sway-gate:v0.1.0 sway gate
77
+  language: docker_image
54
   files: '(?:(^|/)sway\.ya?ml|\.dlm$|(^|/)adapter.*(adapter_config\.json|adapter_model\.safetensors)$)'
78
   files: '(?:(^|/)sway\.ya?ml|\.dlm$|(^|/)adapter.*(adapter_config\.json|adapter_model\.safetensors)$)'
55
   pass_filenames: false
79
   pass_filenames: false