gate-cache 0.2.0__tar.gz → 0.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,275 @@
1
+ Metadata-Version: 2.3
2
+ Name: gate-cache
3
+ Version: 0.4.0
4
+ Summary: Skip lint and test gates that already passed on the exact same git tree.
5
+ Author: Nate Landau
6
+ Author-email: Nate Landau <github@natenate.org>
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 Nate Landau
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ Classifier: Programming Language :: Python :: 3.11
29
+ Classifier: Programming Language :: Python :: 3.12
30
+ Classifier: Programming Language :: Python :: 3.13
31
+ Classifier: Programming Language :: Python :: 3.14
32
+ Requires-Dist: cyclopts>=5.2.0,<6.0.0
33
+ Requires-Dist: nclutils>=3.4.4,<4.0.0
34
+ Requires-Dist: platformdirs>=4.13.0,<5.0.0
35
+ Requires-Python: >=3.11
36
+ Description-Content-Type: text/markdown
37
+
38
+ # gate-cache
39
+
40
+ Skip a command that already passed on the same code.
41
+
42
+ A lint or test command often runs many times on code that did not change. It runs when you finish the work, in a pre-commit hook, after a rebase that changed nothing, and in a pre-push hook. When an agent works in the repository, it runs the same command again. If the command takes minutes, the repeat runs take most of the time between finished code and a pushed branch.
43
+
44
+ gate-cache remembers which commands passed on which code. It wraps a command and gives it a name. When the command passes, gate-cache writes a marker for that name and for the exact content of the files in the working copy that git does not ignore. The next time the same name runs on the same content, gate-cache finds the marker, skips the command, and exits 0 at once.
45
+
46
+ ```console
47
+ $ gate-cache --name pytest -- uv run pytest
48
+ ============================= 412 passed in 94.20s =============================
49
+
50
+ $ gate-cache --name pytest -- uv run pytest
51
+ gate-cache: pytest already passed on tree aaff74984ccc, skipping
52
+ ```
53
+
54
+ A change to any file that git does not ignore changes the content, so no marker matches and the command runs again. A CI runner that starts from a fresh clone has no markers, so it runs every command.
55
+
56
+ ## Install
57
+
58
+ gate-cache requires Python 3.11 or later, on macOS or Linux.
59
+
60
+ ```sh
61
+ uv tool install gate-cache
62
+ ```
63
+
64
+ The prek and pre-commit hooks install gate-cache themselves, so the hooks work without this step.
65
+
66
+ ## Run a command through gate-cache
67
+
68
+ The name goes after `--name`, and the command goes after `--`:
69
+
70
+ ```sh
71
+ gate-cache --name pytest -- uv run pytest
72
+ gate-cache --name ruff -- uv run ruff check .
73
+ ```
74
+
75
+ Each name has its own markers. A command run under one name never skips because of a marker for another name.
76
+
77
+ gate-cache exits with the exit code of the command, or with 0 when it skips the command. It writes a marker only when the command passes, so a command that failed runs again the next time.
78
+
79
+ The tree includes uncommitted edits and untracked files that git does not ignore. A gate that passes on uncommitted work therefore skips in the commit hook when you commit the same content. gate-cache computes the tree from a private copy of the index, so it never stages files or changes your index.
80
+
81
+ ## Run it as a hook
82
+
83
+ gate-cache works with [prek](https://github.com/j178/prek) and with [pre-commit](https://pre-commit.com) 3.2 or later. Each `gate-cache` hook takes the same arguments as the command line:
84
+
85
+ ```yaml
86
+ repos:
87
+ - repo: https://github.com/natelandau/gate-cache
88
+ rev: v0.1.0
89
+ hooks:
90
+ - id: gate-cache
91
+ name: pytest
92
+ args: [--name, pytest, --, uv, run, pytest]
93
+ files: ^(src/|tests/)
94
+ - id: gate-cache
95
+ name: ruff
96
+ args: [--name, ruff, --, uv, run, ruff, check, .]
97
+ ```
98
+
99
+ The hook runs at commit time and at push time. At commit time, gate-cache matches the content that you commit.
100
+
101
+ The hook runs in its own virtual environment, and the wrapped command inherits that environment. A command started with `uv run`, or a project command such as `just test`, runs in the project environment. `uv run` prints a warning that `VIRTUAL_ENV` does not match the project. The warning has no effect on the run.
102
+
103
+ Hooks, agents, and your terminal all read and write the same markers. When one of them runs `gate-cache --name pytest -- uv run pytest` and it passes, the others skip that name on the same content.
104
+
105
+ ## Examples
106
+
107
+ These examples show gate-cache inside the task runner of a project. When a recipe holds the wrapped command, everything that runs the recipe uses the same name and the same markers.
108
+
109
+ ### justfile
110
+
111
+ ```just
112
+ test:
113
+ gate-cache --name test -- uv run pytest
114
+
115
+ lint:
116
+ gate-cache --name lint -- uv run ruff check .
117
+ ```
118
+
119
+ After `just test` passes, the next `just test` on the same content skips pytest.
120
+
121
+ ### Recipes with arguments
122
+
123
+ gate-cache identifies a command by its name alone, not by its arguments. If `just test -k unit` and `just test` ran under the same name, a pass of the unit tests would also skip the full suite. To keep them apart, put the arguments in the name:
124
+
125
+ ```just
126
+ test *args:
127
+ gate-cache --name "{{ trim('test ' + args) }}" -- uv run pytest {{ args }}
128
+ ```
129
+
130
+ `just test` runs under the name `test`, and `just test -k unit` runs under the name `test -k unit`. Each set of arguments has its own markers. `trim` removes the trailing space when there are no arguments, so `gate-cache status --name test` finds the bare form.
131
+
132
+ ### Inputs that git does not track
133
+
134
+ A marker does not cover ignored files, environment variables, or tool versions. To make a gate depend on one of these inputs, put its value in the name. When the value changes, the name changes, so no marker matches and the command runs again:
135
+
136
+ ```just
137
+ # Run again when the uv version changes
138
+ test:
139
+ gate-cache --name "test-uv$(uv --version | cut -d' ' -f2)" -- uv run pytest
140
+
141
+ # Run again when the ignored .env file changes
142
+ integration:
143
+ gate-cache --name "integration-$(git hash-object .env)" -- uv run pytest tests/integration
144
+ ```
145
+
146
+ `git hash-object` prints a hash of the file, so the name does not hold the secrets in `.env`. Do not put a secret value in a name, because the marker and `gate-cache status` record the name as plain text.
147
+
148
+ The shell of the recipe expands `$(...)` before gate-cache starts. A hook `entry` or `args` list does not go through a shell, so put the command in a recipe and call the recipe from the hook. To look up the gate with `gate-cache status --name`, give the expanded name, such as `test-uv0.13.0`.
149
+
150
+ ### Makefile
151
+
152
+ ```make
153
+ test:
154
+ gate-cache --name test -- uv run pytest
155
+
156
+ lint:
157
+ gate-cache --name lint -- uv run ruff check .
158
+ ```
159
+
160
+ ### A hook that calls the recipe
161
+
162
+ A local hook can run the recipe instead of the gate-cache hook repository:
163
+
164
+ ```yaml
165
+ repos:
166
+ - repo: local
167
+ hooks:
168
+ - id: test
169
+ name: test
170
+ entry: just test
171
+ language: system
172
+ pass_filenames: false
173
+ stages: [pre-commit, pre-push]
174
+ ```
175
+
176
+ With this hook, a commit, a push, an agent, and your terminal all run `just test` and share its markers. The recipe runs in the project environment, so `uv run` prints no `VIRTUAL_ENV` warning. This form needs `gate-cache` and `just` on the `PATH`.
177
+
178
+ ### CI
179
+
180
+ gate-cache turns off caching when the `CI` variable is on. A variable is on when its value is not empty, `0`, or `false`. Case and spaces around the value do not matter. Many CI systems set `CI=true` in every job, for example GitHub Actions and GitLab CI/CD. Jenkins does not set `CI`.
181
+
182
+ When caching is off, gate-cache runs the command each time and writes no marker.
183
+
184
+ `GATE_CACHE_DISABLE` overrides `CI`. To keep caching on when `CI` is on, set `GATE_CACHE_DISABLE` to `0` or `false`:
185
+
186
+ ```sh
187
+ GATE_CACHE_DISABLE=0 just test
188
+ ```
189
+
190
+ To turn off caching when `CI` is not set, set `GATE_CACHE_DISABLE` to `1`:
191
+
192
+ ```sh
193
+ GATE_CACHE_DISABLE=1 just test
194
+ ```
195
+
196
+ ## See what already passed
197
+
198
+ `gate-cache status` lists the names that passed on the current content, and the names that ran on it without a pass:
199
+
200
+ ```console
201
+ $ gate-cache status
202
+ tree: aaff74984cccd156a469afa7d9ab10e4777beb24
203
+ passed: pytest
204
+ missed: ruff (exit code 1)
205
+ ```
206
+
207
+ A name is missed when its command failed, or when it exited 0 but changed the files. A later pass of the same name removes it from the `missed` line.
208
+
209
+ With `--name`, it reports on one name:
210
+
211
+ ```console
212
+ $ gate-cache status --name ruff
213
+ name: ruff
214
+ tree: aaff74984cccd156a469afa7d9ab10e4777beb24
215
+ marker: /path/to/repo/.git/gate-cache/7d94ca2f57ec0a77f60d328fb405d339fb0c2a645991b97c042ac54403104e9e
216
+ result: miss
217
+ last run: exit code 1
218
+ ```
219
+
220
+ The `last run` line shows only when the name ran on this content without a pass.
221
+
222
+ `status` runs nothing. With `--name`, it exits 0 when a marker matches and 1 when none does. Without `--name`, it exits 0 when at least one name passed. When gate-cache cannot match the content, for example during a merge conflict, the `tree` line gives the reason.
223
+
224
+ With `--json`, `status` writes one JSON object to stdout instead of text. The exit codes do not change:
225
+
226
+ ```console
227
+ $ gate-cache status --json
228
+ {
229
+ "enabled": true,
230
+ "tree": "aaff74984cccd156a469afa7d9ab10e4777beb24",
231
+ "reason": null,
232
+ "passed": ["pytest"],
233
+ "missed": [
234
+ {"name": "ruff", "exit_code": 1, "reason": "exit code 1", "timestamp": "2026-10-12T12:31:55Z"}
235
+ ]
236
+ }
237
+ ```
238
+
239
+ `reason` tells why gate-cache cannot match the content, and is `null` when it can. When caching is off, `enabled` is `false`, `reason` names the variable, and the other keys are empty or `null`. With `--name`, the object has the `name`, `marker`, `result`, and `last_run` keys in place of `passed` and `missed`.
240
+
241
+ ## Start fresh
242
+
243
+ A marker records only the content of the files that git does not ignore. A new tool version, a changed environment variable, or a change to a service does not change that content, so the old markers still match. To make a gate run again when one of these inputs changes, put the input in the name, as [Inputs that git does not track](#inputs-that-git-does-not-track) shows.
244
+
245
+ `gate-cache clear` deletes every marker for the repository, and the records of missed runs:
246
+
247
+ ```console
248
+ $ gate-cache clear
249
+ gate-cache: removed 3 markers
250
+ ```
251
+
252
+ `GATE_CACHE_DISABLE=1` runs every command without the cache, for one command or for a whole session:
253
+
254
+ ```sh
255
+ GATE_CACHE_DISABLE=1 git push
256
+ ```
257
+
258
+ ## Settings
259
+
260
+ Three environment variables control gate-cache.
261
+
262
+ | Variable | Effect | Default |
263
+ | ------------------------- | ------------------------------------------------------------------------------ | ------- |
264
+ | `GATE_CACHE_DISABLE` | If on, turns off caching. If `0` or `false`, keeps caching on when `CI` is on. | not set |
265
+ | `CI` | If on, turns off caching. A value in `GATE_CACHE_DISABLE` overrides it. | not set |
266
+ | `GATE_CACHE_MAX_AGE_DAYS` | gate-cache deletes markers older than this number of days. | `30` |
267
+
268
+ A variable is on when its value is not empty, `0`, or `false`. Case and spaces around the value do not matter.
269
+
270
+ Each marker is one small file in the `.git` directory of the repository, so all worktrees of the repository share the markers.
271
+
272
+ ## Learn more
273
+
274
+ - [How gate-cache works](docs/how-it-works.md) describes the exact rules for a skip, what a marker covers, and the marker format for tools that read markers directly.
275
+ - `gate-cache --help` gives the full command reference.
@@ -0,0 +1,238 @@
1
+ # gate-cache
2
+
3
+ Skip a command that already passed on the same code.
4
+
5
+ A lint or test command often runs many times on code that did not change. It runs when you finish the work, in a pre-commit hook, after a rebase that changed nothing, and in a pre-push hook. When an agent works in the repository, it runs the same command again. If the command takes minutes, the repeat runs take most of the time between finished code and a pushed branch.
6
+
7
+ gate-cache remembers which commands passed on which code. It wraps a command and gives it a name. When the command passes, gate-cache writes a marker for that name and for the exact content of the files in the working copy that git does not ignore. The next time the same name runs on the same content, gate-cache finds the marker, skips the command, and exits 0 at once.
8
+
9
+ ```console
10
+ $ gate-cache --name pytest -- uv run pytest
11
+ ============================= 412 passed in 94.20s =============================
12
+
13
+ $ gate-cache --name pytest -- uv run pytest
14
+ gate-cache: pytest already passed on tree aaff74984ccc, skipping
15
+ ```
16
+
17
+ A change to any file that git does not ignore changes the content, so no marker matches and the command runs again. A CI runner that starts from a fresh clone has no markers, so it runs every command.
18
+
19
+ ## Install
20
+
21
+ gate-cache requires Python 3.11 or later, on macOS or Linux.
22
+
23
+ ```sh
24
+ uv tool install gate-cache
25
+ ```
26
+
27
+ The prek and pre-commit hooks install gate-cache themselves, so the hooks work without this step.
28
+
29
+ ## Run a command through gate-cache
30
+
31
+ The name goes after `--name`, and the command goes after `--`:
32
+
33
+ ```sh
34
+ gate-cache --name pytest -- uv run pytest
35
+ gate-cache --name ruff -- uv run ruff check .
36
+ ```
37
+
38
+ Each name has its own markers. A command run under one name never skips because of a marker for another name.
39
+
40
+ gate-cache exits with the exit code of the command, or with 0 when it skips the command. It writes a marker only when the command passes, so a command that failed runs again the next time.
41
+
42
+ The tree includes uncommitted edits and untracked files that git does not ignore. A gate that passes on uncommitted work therefore skips in the commit hook when you commit the same content. gate-cache computes the tree from a private copy of the index, so it never stages files or changes your index.
43
+
44
+ ## Run it as a hook
45
+
46
+ gate-cache works with [prek](https://github.com/j178/prek) and with [pre-commit](https://pre-commit.com) 3.2 or later. Each `gate-cache` hook takes the same arguments as the command line:
47
+
48
+ ```yaml
49
+ repos:
50
+ - repo: https://github.com/natelandau/gate-cache
51
+ rev: v0.1.0
52
+ hooks:
53
+ - id: gate-cache
54
+ name: pytest
55
+ args: [--name, pytest, --, uv, run, pytest]
56
+ files: ^(src/|tests/)
57
+ - id: gate-cache
58
+ name: ruff
59
+ args: [--name, ruff, --, uv, run, ruff, check, .]
60
+ ```
61
+
62
+ The hook runs at commit time and at push time. At commit time, gate-cache matches the content that you commit.
63
+
64
+ The hook runs in its own virtual environment, and the wrapped command inherits that environment. A command started with `uv run`, or a project command such as `just test`, runs in the project environment. `uv run` prints a warning that `VIRTUAL_ENV` does not match the project. The warning has no effect on the run.
65
+
66
+ Hooks, agents, and your terminal all read and write the same markers. When one of them runs `gate-cache --name pytest -- uv run pytest` and it passes, the others skip that name on the same content.
67
+
68
+ ## Examples
69
+
70
+ These examples show gate-cache inside the task runner of a project. When a recipe holds the wrapped command, everything that runs the recipe uses the same name and the same markers.
71
+
72
+ ### justfile
73
+
74
+ ```just
75
+ test:
76
+ gate-cache --name test -- uv run pytest
77
+
78
+ lint:
79
+ gate-cache --name lint -- uv run ruff check .
80
+ ```
81
+
82
+ After `just test` passes, the next `just test` on the same content skips pytest.
83
+
84
+ ### Recipes with arguments
85
+
86
+ gate-cache identifies a command by its name alone, not by its arguments. If `just test -k unit` and `just test` ran under the same name, a pass of the unit tests would also skip the full suite. To keep them apart, put the arguments in the name:
87
+
88
+ ```just
89
+ test *args:
90
+ gate-cache --name "{{ trim('test ' + args) }}" -- uv run pytest {{ args }}
91
+ ```
92
+
93
+ `just test` runs under the name `test`, and `just test -k unit` runs under the name `test -k unit`. Each set of arguments has its own markers. `trim` removes the trailing space when there are no arguments, so `gate-cache status --name test` finds the bare form.
94
+
95
+ ### Inputs that git does not track
96
+
97
+ A marker does not cover ignored files, environment variables, or tool versions. To make a gate depend on one of these inputs, put its value in the name. When the value changes, the name changes, so no marker matches and the command runs again:
98
+
99
+ ```just
100
+ # Run again when the uv version changes
101
+ test:
102
+ gate-cache --name "test-uv$(uv --version | cut -d' ' -f2)" -- uv run pytest
103
+
104
+ # Run again when the ignored .env file changes
105
+ integration:
106
+ gate-cache --name "integration-$(git hash-object .env)" -- uv run pytest tests/integration
107
+ ```
108
+
109
+ `git hash-object` prints a hash of the file, so the name does not hold the secrets in `.env`. Do not put a secret value in a name, because the marker and `gate-cache status` record the name as plain text.
110
+
111
+ The shell of the recipe expands `$(...)` before gate-cache starts. A hook `entry` or `args` list does not go through a shell, so put the command in a recipe and call the recipe from the hook. To look up the gate with `gate-cache status --name`, give the expanded name, such as `test-uv0.13.0`.
112
+
113
+ ### Makefile
114
+
115
+ ```make
116
+ test:
117
+ gate-cache --name test -- uv run pytest
118
+
119
+ lint:
120
+ gate-cache --name lint -- uv run ruff check .
121
+ ```
122
+
123
+ ### A hook that calls the recipe
124
+
125
+ A local hook can run the recipe instead of the gate-cache hook repository:
126
+
127
+ ```yaml
128
+ repos:
129
+ - repo: local
130
+ hooks:
131
+ - id: test
132
+ name: test
133
+ entry: just test
134
+ language: system
135
+ pass_filenames: false
136
+ stages: [pre-commit, pre-push]
137
+ ```
138
+
139
+ With this hook, a commit, a push, an agent, and your terminal all run `just test` and share its markers. The recipe runs in the project environment, so `uv run` prints no `VIRTUAL_ENV` warning. This form needs `gate-cache` and `just` on the `PATH`.
140
+
141
+ ### CI
142
+
143
+ gate-cache turns off caching when the `CI` variable is on. A variable is on when its value is not empty, `0`, or `false`. Case and spaces around the value do not matter. Many CI systems set `CI=true` in every job, for example GitHub Actions and GitLab CI/CD. Jenkins does not set `CI`.
144
+
145
+ When caching is off, gate-cache runs the command each time and writes no marker.
146
+
147
+ `GATE_CACHE_DISABLE` overrides `CI`. To keep caching on when `CI` is on, set `GATE_CACHE_DISABLE` to `0` or `false`:
148
+
149
+ ```sh
150
+ GATE_CACHE_DISABLE=0 just test
151
+ ```
152
+
153
+ To turn off caching when `CI` is not set, set `GATE_CACHE_DISABLE` to `1`:
154
+
155
+ ```sh
156
+ GATE_CACHE_DISABLE=1 just test
157
+ ```
158
+
159
+ ## See what already passed
160
+
161
+ `gate-cache status` lists the names that passed on the current content, and the names that ran on it without a pass:
162
+
163
+ ```console
164
+ $ gate-cache status
165
+ tree: aaff74984cccd156a469afa7d9ab10e4777beb24
166
+ passed: pytest
167
+ missed: ruff (exit code 1)
168
+ ```
169
+
170
+ A name is missed when its command failed, or when it exited 0 but changed the files. A later pass of the same name removes it from the `missed` line.
171
+
172
+ With `--name`, it reports on one name:
173
+
174
+ ```console
175
+ $ gate-cache status --name ruff
176
+ name: ruff
177
+ tree: aaff74984cccd156a469afa7d9ab10e4777beb24
178
+ marker: /path/to/repo/.git/gate-cache/7d94ca2f57ec0a77f60d328fb405d339fb0c2a645991b97c042ac54403104e9e
179
+ result: miss
180
+ last run: exit code 1
181
+ ```
182
+
183
+ The `last run` line shows only when the name ran on this content without a pass.
184
+
185
+ `status` runs nothing. With `--name`, it exits 0 when a marker matches and 1 when none does. Without `--name`, it exits 0 when at least one name passed. When gate-cache cannot match the content, for example during a merge conflict, the `tree` line gives the reason.
186
+
187
+ With `--json`, `status` writes one JSON object to stdout instead of text. The exit codes do not change:
188
+
189
+ ```console
190
+ $ gate-cache status --json
191
+ {
192
+ "enabled": true,
193
+ "tree": "aaff74984cccd156a469afa7d9ab10e4777beb24",
194
+ "reason": null,
195
+ "passed": ["pytest"],
196
+ "missed": [
197
+ {"name": "ruff", "exit_code": 1, "reason": "exit code 1", "timestamp": "2026-10-12T12:31:55Z"}
198
+ ]
199
+ }
200
+ ```
201
+
202
+ `reason` tells why gate-cache cannot match the content, and is `null` when it can. When caching is off, `enabled` is `false`, `reason` names the variable, and the other keys are empty or `null`. With `--name`, the object has the `name`, `marker`, `result`, and `last_run` keys in place of `passed` and `missed`.
203
+
204
+ ## Start fresh
205
+
206
+ A marker records only the content of the files that git does not ignore. A new tool version, a changed environment variable, or a change to a service does not change that content, so the old markers still match. To make a gate run again when one of these inputs changes, put the input in the name, as [Inputs that git does not track](#inputs-that-git-does-not-track) shows.
207
+
208
+ `gate-cache clear` deletes every marker for the repository, and the records of missed runs:
209
+
210
+ ```console
211
+ $ gate-cache clear
212
+ gate-cache: removed 3 markers
213
+ ```
214
+
215
+ `GATE_CACHE_DISABLE=1` runs every command without the cache, for one command or for a whole session:
216
+
217
+ ```sh
218
+ GATE_CACHE_DISABLE=1 git push
219
+ ```
220
+
221
+ ## Settings
222
+
223
+ Three environment variables control gate-cache.
224
+
225
+ | Variable | Effect | Default |
226
+ | ------------------------- | ------------------------------------------------------------------------------ | ------- |
227
+ | `GATE_CACHE_DISABLE` | If on, turns off caching. If `0` or `false`, keeps caching on when `CI` is on. | not set |
228
+ | `CI` | If on, turns off caching. A value in `GATE_CACHE_DISABLE` overrides it. | not set |
229
+ | `GATE_CACHE_MAX_AGE_DAYS` | gate-cache deletes markers older than this number of days. | `30` |
230
+
231
+ A variable is on when its value is not empty, `0`, or `false`. Case and spaces around the value do not matter.
232
+
233
+ Each marker is one small file in the `.git` directory of the repository, so all worktrees of the repository share the markers.
234
+
235
+ ## Learn more
236
+
237
+ - [How gate-cache works](docs/how-it-works.md) describes the exact rules for a skip, what a marker covers, and the marker format for tools that read markers directly.
238
+ - `gate-cache --help` gives the full command reference.
@@ -8,12 +8,13 @@ classifiers = [
8
8
  dependencies = [
9
9
  "cyclopts>=5.2.0,<6.0.0",
10
10
  "nclutils>=3.4.4,<4.0.0",
11
+ "platformdirs>=4.13.0,<5.0.0",
11
12
  ]
12
13
  description = "Skip lint and test gates that already passed on the exact same git tree."
13
14
  name = "gate-cache"
14
15
  readme = "README.md"
15
16
  requires-python = ">=3.11"
16
- version = "0.2.0"
17
+ version = "0.4.0"
17
18
 
18
19
  [[project.authors]]
19
20
  name = "Nate Landau"
@@ -36,6 +37,7 @@ module-name = "gate_cache"
36
37
  annotated_tag = true
37
38
  bump_message = "bump(release): v$current_version → v$new_version"
38
39
  changelog_merge_prerelease = true
40
+ major_version_zero = true
39
41
  tag_format = "v$version"
40
42
  update_changelog_on_bump = true
41
43
  version_files = ["src/gate_cache/__init__.py:__version__"]
@@ -6,13 +6,17 @@
6
6
  "Programming Language :: Python :: 3.13",
7
7
  "Programming Language :: Python :: 3.14",
8
8
  ]
9
- dependencies = ["cyclopts>=5.2.0,<6.0.0", "nclutils>=3.4.4,<4.0.0"]
9
+ dependencies = [
10
+ "cyclopts>=5.2.0,<6.0.0",
11
+ "nclutils>=3.4.4,<4.0.0",
12
+ "platformdirs>=4.13.0,<5.0.0",
13
+ ]
10
14
  description = "Skip lint and test gates that already passed on the exact same git tree."
11
15
  license = { file = "LICENSE" }
12
16
  name = "gate-cache"
13
17
  readme = "README.md"
14
18
  requires-python = ">=3.11"
15
- version = "0.2.0"
19
+ version = "0.4.0"
16
20
 
17
21
  [project.scripts]
18
22
  gate-cache = "gate_cache.cli:main"
@@ -51,6 +55,7 @@
51
55
  annotated_tag = true
52
56
  bump_message = "bump(release): v$current_version → v$new_version"
53
57
  changelog_merge_prerelease = true
58
+ major_version_zero = true
54
59
  tag_format = "v$version"
55
60
  update_changelog_on_bump = true
56
61
  version_files = ["src/gate_cache/__init__.py:__version__"]
@@ -1,3 +1,3 @@
1
1
  """Skip lint and test gates that already passed on the exact same git tree."""
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.4.0"