livery-extensions-lfs 0.0.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Willem Kokke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ Metadata-Version: 2.4
2
+ Name: livery-extensions-lfs
3
+ Version: 0.0.0
4
+ Summary: Git LFS for the livery workshop: the git-lfs tool locked, its hooks installed by every sync, and the LFS objects fetched by the rendered CI checkout.
5
+ Author: Willem Kokke
6
+ Author-email: Willem Kokke <mail@willem.net>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Typing :: Typed
13
+ Requires-Dist: livery-footman>=0.61.0
14
+ Requires-Dist: livery-toolroom>=0.12.0
15
+ Requires-Dist: livery-workshop>=0.11.0
16
+ Requires-Python: >=3.11
17
+ Project-URL: Repository, https://github.com/willemkokke/livery
18
+ Description-Content-Type: text/markdown
19
+
20
+ # livery-extensions-lfs
21
+
22
+ Git LFS for the livery workshop. Listed as `lfs` in a workspace's
23
+ `[workspace] extensions`, it pins git-lfs in the lock, installs LFS's
24
+ hooks and filter in the checkout on every `fm sync`, and makes the
25
+ rendered CI checkout fetch the LFS objects.
@@ -0,0 +1,6 @@
1
+ # livery-extensions-lfs
2
+
3
+ Git LFS for the livery workshop. Listed as `lfs` in a workspace's
4
+ `[workspace] extensions`, it pins git-lfs in the lock, installs LFS's
5
+ hooks and filter in the checkout on every `fm sync`, and makes the
6
+ rendered CI checkout fetch the LFS objects.
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.11,<0.13"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "livery-extensions-lfs"
7
+ version = "0.0.0"
8
+ description = "Git LFS for the livery workshop: the git-lfs tool locked, its hooks installed by every sync, and the LFS objects fetched by the rendered CI checkout."
9
+ readme = "README.md"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.11"
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3 :: Only",
17
+ "Typing :: Typed",
18
+ ]
19
+ dependencies = [
20
+ "livery-footman>=0.61.0",
21
+ "livery-toolroom>=0.12.0",
22
+ "livery-workshop>=0.11.0",
23
+ ]
24
+
25
+ [[project.authors]]
26
+ name = "Willem Kokke"
27
+ email = "mail@willem.net"
28
+
29
+ [project.urls]
30
+ Repository = "https://github.com/willemkokke/livery"
31
+
32
+ [project.entry-points."workshop.extensions"]
33
+ lfs = "livery.extensions.lfs"
34
+
35
+ [tool.uv.build-backend]
36
+ module-name = "livery.extensions.lfs"
37
+ namespace = true
@@ -0,0 +1,41 @@
1
+ # The package's own: edit it directly, nothing rewrites it.
2
+ [build-system]
3
+ requires = ["uv_build>=0.11,<0.13"]
4
+ build-backend = "uv_build"
5
+
6
+ [project]
7
+ name = "livery-extensions-lfs"
8
+ version = "0.0.0"
9
+ description = "Git LFS for the livery workshop: the git-lfs tool locked, its hooks installed by every sync, and the LFS objects fetched by the rendered CI checkout."
10
+ readme = "README.md"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ requires-python = ">=3.11"
14
+ authors = [{ name = "Willem Kokke", email = "mail@willem.net" }]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Programming Language :: Python :: 3",
18
+ "Programming Language :: Python :: 3 :: Only",
19
+ "Typing :: Typed",
20
+ ]
21
+ dependencies = [
22
+ "livery-footman>=0.61.0",
23
+ "livery-toolroom>=0.12.0",
24
+ "livery-workshop>=0.11.0",
25
+ ]
26
+
27
+ [project.urls]
28
+ Repository = "https://github.com/willemkokke/livery"
29
+
30
+ # The name a workspace lists in [workspace] extensions, and the package
31
+ # whose extension.toml the workshop mounts it from. Nothing else: the
32
+ # extension adds no verb of its own, and nothing activates by being
33
+ # installed.
34
+ [project.entry-points."workshop.extensions"]
35
+ lfs = "livery.extensions.lfs"
36
+
37
+ [tool.uv.build-backend]
38
+ # PEP 420 namespace: the importable package is livery.extensions.lfs and
39
+ # there is no livery/__init__.py anywhere in this repository.
40
+ module-name = "livery.extensions.lfs"
41
+ namespace = true
@@ -0,0 +1,50 @@
1
+ # livery-extensions-lfs
2
+
3
+ Git LFS for the workshop. A workspace turns it on by listing the
4
+ extension:
5
+
6
+ ```toml
7
+ [workspace]
8
+ extensions = ["lfs"]
9
+ ```
10
+
11
+ Listed, it does three things:
12
+
13
+ - The lock pins `git_lfs`, the git-lfs tool, so every machine and every
14
+ CI job runs the same release of it.
15
+ - Every `fm sync` runs `git lfs install --local` once over the
16
+ workspace, after it installs the tools. That writes LFS's hooks and
17
+ the checkout's filter configuration where they are missing, so a sync
18
+ that finds them in place changes nothing. A failure stops the sync
19
+ with git-lfs's own words. A workspace that is not a git checkout gets
20
+ nothing.
21
+ - The checkout step of the rendered GitHub and Gitea workflows sets
22
+ `lfs: true`, so a job reads the files and not their pointers. GitLab's
23
+ runner fetches the LFS objects by itself where its image has git-lfs.
24
+
25
+ A workspace that does not list the extension gets none of the three.
26
+
27
+ ## Attribute lines
28
+
29
+ The extension ships no attribute line of its own: the extension that
30
+ ships a kind of file says which of them go through LFS. It ships the
31
+ lines in `content/for/lfs/root/.gitattributes`, beside its
32
+ `extension.toml`, and declares a `[for.lfs]` table there:
33
+
34
+ ```toml
35
+ [for.lfs]
36
+ ```
37
+
38
+ ```text
39
+ *.png filter=lfs diff=lfs merge=lfs -text
40
+ ```
41
+
42
+ `fm sync` composes those lines into the root `.gitattributes` while the
43
+ workspace lists `lfs`, and removes them when it stops listing it. A root
44
+ entry's `without` keeps one extension's lines out while `lfs` stays
45
+ listed:
46
+
47
+ ```toml
48
+ [workspace]
49
+ extensions = [{ name = "assets", without = ["lfs"] }, "lfs"]
50
+ ```
@@ -0,0 +1,12 @@
1
+ # This package's section of the workspace site, hand-authored.
2
+ # Labels map to pages relative to this docs/ tree, or to nested
3
+ # lists. Every authored page must appear here, and every entry must
4
+ # name a real page. A generator owns a block between `# nav:begin
5
+ # <name>` and `# nav:end <name>` markers (tasks, tools); the emitter's
6
+ # own sections, changelog, coverage and api, are blocks too: place a
7
+ # pair where one belongs, and a section without one lands after the
8
+ # authored entries, changelog and coverage ahead of the tasks block,
9
+ # api last.
10
+ nav = [
11
+ { "Index" = "index.md" },
12
+ ]
@@ -0,0 +1,33 @@
1
+ """Install Git LFS's hooks and filter configuration in the checkout: the sync step."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import TYPE_CHECKING
6
+
7
+ from livery.footman import fail
8
+
9
+ if TYPE_CHECKING:
10
+ from livery.workshop import PhaseContext
11
+
12
+
13
+ def install(ctx: PhaseContext) -> None:
14
+ """Install LFS's hooks and filter configuration in the checkout at the root.
15
+
16
+ ``git lfs install --local`` writes the hooks and the checkout's
17
+ filter configuration only where they are missing, so a sync that
18
+ finds them in place changes nothing. A workspace that is not a git
19
+ checkout gets nothing.
20
+
21
+ Raises:
22
+ Failed: when ``git lfs install --local`` exits non-zero, with
23
+ git-lfs's own words.
24
+ """
25
+ import livery.toolroom.tools as tools
26
+
27
+ if not (ctx.root / ".git").exists():
28
+ return
29
+ result = tools.git_lfs.opts(cwd=ctx.root, nofail=True, recorded=False)(
30
+ "install", "--local"
31
+ )
32
+ if result.code != 0:
33
+ fail(f"git lfs install --local failed: {result.stderr.strip()}")
@@ -0,0 +1,23 @@
1
+ # The lfs extension: Git LFS for the workspace. Read at every mount; the
2
+ # sync step's code is imported when it runs. An extension that ships an
3
+ # LFS attribute line ships it under content/for/lfs/ with a [for.lfs]
4
+ # table, so the line applies while this extension is listed.
5
+
6
+ [extension]
7
+ description = "Git LFS for the workspace: the lock pins git-lfs, every fm sync installs LFS's hooks and filter in the checkout, and the rendered CI checkout fetches the LFS objects."
8
+ api-version = 1
9
+
10
+ # git-lfs runs the hooks and the filter the sync step installs, so the
11
+ # lock pins it while the workspace lists this extension.
12
+ [toolroom]
13
+ requires = ["git_lfs"]
14
+
15
+ # Once over the workspace on every fm sync, after the tools are
16
+ # installed: LFS's hooks and the checkout's filter configuration.
17
+ [phases.sync.lfs]
18
+ main = "livery.extensions.lfs._hooks:install"
19
+
20
+ # The rendered CI checkout fetches the LFS objects, or the gate reads
21
+ # the pointer files where the files should be.
22
+ [queries.checkout-inputs]
23
+ value = { lfs = "true" }