lirk 1.1.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.
- lirk-1.1.0/LICENSE +21 -0
- lirk-1.1.0/PKG-INFO +132 -0
- lirk-1.1.0/README.md +105 -0
- lirk-1.1.0/lirk/__init__.py +0 -0
- lirk-1.1.0/lirk/__main__.py +4 -0
- lirk-1.1.0/lirk/actions.py +660 -0
- lirk-1.1.0/lirk/cache.py +229 -0
- lirk-1.1.0/lirk/cli.py +981 -0
- lirk-1.1.0/lirk/fix.py +266 -0
- lirk-1.1.0/lirk/graph.py +216 -0
- lirk-1.1.0/lirk/mutate.py +124 -0
- lirk-1.1.0/lirk/scaffold.py +188 -0
- lirk-1.1.0/lirk/targets.py +284 -0
- lirk-1.1.0/lirk.egg-info/PKG-INFO +132 -0
- lirk-1.1.0/lirk.egg-info/SOURCES.txt +27 -0
- lirk-1.1.0/lirk.egg-info/dependency_links.txt +1 -0
- lirk-1.1.0/lirk.egg-info/entry_points.txt +2 -0
- lirk-1.1.0/lirk.egg-info/top_level.txt +1 -0
- lirk-1.1.0/pyproject.toml +40 -0
- lirk-1.1.0/setup.cfg +4 -0
- lirk-1.1.0/tests/test_actions.py +733 -0
- lirk-1.1.0/tests/test_bench.py +52 -0
- lirk-1.1.0/tests/test_cache.py +326 -0
- lirk-1.1.0/tests/test_cli.py +1240 -0
- lirk-1.1.0/tests/test_fix.py +235 -0
- lirk-1.1.0/tests/test_graph.py +235 -0
- lirk-1.1.0/tests/test_mutate.py +175 -0
- lirk-1.1.0/tests/test_scaffold.py +202 -0
- lirk-1.1.0/tests/test_targets.py +395 -0
lirk-1.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Shawn Faulkingham Jr
|
|
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.
|
lirk-1.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: lirk
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: A minimal, Bazel/Please-inspired build tool for Python monorepos.
|
|
5
|
+
Author: Shawn Faulkingham Jr
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/socitt/lirk
|
|
8
|
+
Project-URL: Documentation, https://socitt.github.io/lirk/
|
|
9
|
+
Project-URL: Issues, https://github.com/socitt/lirk/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/socitt/lirk/releases
|
|
11
|
+
Keywords: build,build-tool,monorepo,bazel,testing,incremental
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
22
|
+
Classifier: Topic :: Software Development :: Testing
|
|
23
|
+
Requires-Python: >=3.11
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Dynamic: license-file
|
|
27
|
+
|
|
28
|
+
# lirk
|
|
29
|
+
|
|
30
|
+
[](https://github.com/socitt/lirk/actions/workflows/ci.yml)
|
|
31
|
+
|
|
32
|
+
**A small build and test tool for Python monorepos.** It reruns only
|
|
33
|
+
what your change affected, and it's built so that a green result is
|
|
34
|
+
never a stale one.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
pip install lirk
|
|
38
|
+
cd your-repo
|
|
39
|
+
lirk init # draft BUILD files from your code's real imports
|
|
40
|
+
lirk test //... # run everything; next time, only what changed
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**[Documentation →](https://socitt.github.io/lirk/)**
|
|
44
|
+
|
|
45
|
+
## Why lirk
|
|
46
|
+
|
|
47
|
+
- **Only reruns what changed.** Targets are fingerprinted by content.
|
|
48
|
+
Edit one module and only the tests that depend on it run again.
|
|
49
|
+
- **Green means green.** Imports are checked against declared deps, so
|
|
50
|
+
the dependency graph can't silently drift. Your Python version,
|
|
51
|
+
installed packages and pytest config are part of every fingerprint.
|
|
52
|
+
`lirk verify` audits cached results against fresh runs.
|
|
53
|
+
- **Minutes to adopt.** `lirk init` writes your BUILD files, and
|
|
54
|
+
`lirk fix` keeps their deps correct as the code changes.
|
|
55
|
+
- **Your tests, unchanged.** Plain `unittest` or `pytest`, with output
|
|
56
|
+
passed through exactly as your runner printed it.
|
|
57
|
+
- **Runs anywhere Python 3.11 does.** No dependencies, no daemon, no
|
|
58
|
+
JVM. Tested on Linux and macOS, and built to run on an iPhone under
|
|
59
|
+
iSH.
|
|
60
|
+
|
|
61
|
+
## What it looks like
|
|
62
|
+
|
|
63
|
+
One `BUILD.lirk` per package directory, in plain TOML:
|
|
64
|
+
|
|
65
|
+
```toml
|
|
66
|
+
[[target]]
|
|
67
|
+
name = "physics"
|
|
68
|
+
type = "library"
|
|
69
|
+
srcs = ["gravity.py", "integrators.py"]
|
|
70
|
+
deps = ["//vecmath:vecmath"]
|
|
71
|
+
|
|
72
|
+
[[target]]
|
|
73
|
+
name = "physics_test"
|
|
74
|
+
type = "test"
|
|
75
|
+
runner = "pytest"
|
|
76
|
+
srcs = ["test_gravity.py", "test_integrators.py"]
|
|
77
|
+
deps = [":physics"]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
$ lirk test //...
|
|
82
|
+
cached //vecmath:vecmath
|
|
83
|
+
built //physics:physics
|
|
84
|
+
PASS //physics:physics_test (3.1s)
|
|
85
|
+
cached //render:render_test
|
|
86
|
+
lirk: 2/2 tests passed
|
|
87
|
+
lirk: OK
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Commands
|
|
91
|
+
|
|
92
|
+
| | |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `lirk test <label>...` | Run tests, and check what they depend on |
|
|
95
|
+
| `lirk build <label>...` | Check targets without running tests |
|
|
96
|
+
| `lirk init` | Draft BUILD files for an existing repo |
|
|
97
|
+
| `lirk fix` | Add missing deps from your imports |
|
|
98
|
+
| `lirk verify` | Recheck cached results against fresh runs |
|
|
99
|
+
| `lirk clean` | Delete the cache |
|
|
100
|
+
|
|
101
|
+
Labels: `//...` (everything), `//app/...` (a directory and below),
|
|
102
|
+
`//app:all` (one directory), `//app:app_test` (one target).
|
|
103
|
+
|
|
104
|
+
## Documentation
|
|
105
|
+
|
|
106
|
+
- [Getting started](https://socitt.github.io/lirk/getting-started.html):
|
|
107
|
+
a new repo in five minutes
|
|
108
|
+
- [Existing repos](https://socitt.github.io/lirk/adopting.html):
|
|
109
|
+
`lirk init` and what to review
|
|
110
|
+
- [BUILD files](https://socitt.github.io/lirk/build-format.html) and
|
|
111
|
+
[Commands](https://socitt.github.io/lirk/commands.html): reference
|
|
112
|
+
- [How it works](https://socitt.github.io/lirk/how-it-works.html):
|
|
113
|
+
why a cached result can be trusted
|
|
114
|
+
- [Troubleshooting](https://socitt.github.io/lirk/troubleshooting.html)
|
|
115
|
+
|
|
116
|
+
## Background
|
|
117
|
+
|
|
118
|
+
lirk was written after a Bazel-style build tool kept failing
|
|
119
|
+
intermittently on iSH (a Linux environment for iPhone), in a way traced
|
|
120
|
+
to how it managed processes. So lirk does the opposite: each test file
|
|
121
|
+
is one plain, direct subprocess, run one at a time, with no daemon,
|
|
122
|
+
sandbox or process groups. It has since been used across several real
|
|
123
|
+
repos, including itself, without that class of failure. The original
|
|
124
|
+
write-up lives in [`docs/archive/`](docs/archive/).
|
|
125
|
+
|
|
126
|
+
## Contributing
|
|
127
|
+
|
|
128
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
129
|
+
|
|
130
|
+
## License
|
|
131
|
+
|
|
132
|
+
MIT. See [LICENSE](LICENSE).
|
lirk-1.1.0/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# lirk
|
|
2
|
+
|
|
3
|
+
[](https://github.com/socitt/lirk/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
**A small build and test tool for Python monorepos.** It reruns only
|
|
6
|
+
what your change affected, and it's built so that a green result is
|
|
7
|
+
never a stale one.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
pip install lirk
|
|
11
|
+
cd your-repo
|
|
12
|
+
lirk init # draft BUILD files from your code's real imports
|
|
13
|
+
lirk test //... # run everything; next time, only what changed
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**[Documentation →](https://socitt.github.io/lirk/)**
|
|
17
|
+
|
|
18
|
+
## Why lirk
|
|
19
|
+
|
|
20
|
+
- **Only reruns what changed.** Targets are fingerprinted by content.
|
|
21
|
+
Edit one module and only the tests that depend on it run again.
|
|
22
|
+
- **Green means green.** Imports are checked against declared deps, so
|
|
23
|
+
the dependency graph can't silently drift. Your Python version,
|
|
24
|
+
installed packages and pytest config are part of every fingerprint.
|
|
25
|
+
`lirk verify` audits cached results against fresh runs.
|
|
26
|
+
- **Minutes to adopt.** `lirk init` writes your BUILD files, and
|
|
27
|
+
`lirk fix` keeps their deps correct as the code changes.
|
|
28
|
+
- **Your tests, unchanged.** Plain `unittest` or `pytest`, with output
|
|
29
|
+
passed through exactly as your runner printed it.
|
|
30
|
+
- **Runs anywhere Python 3.11 does.** No dependencies, no daemon, no
|
|
31
|
+
JVM. Tested on Linux and macOS, and built to run on an iPhone under
|
|
32
|
+
iSH.
|
|
33
|
+
|
|
34
|
+
## What it looks like
|
|
35
|
+
|
|
36
|
+
One `BUILD.lirk` per package directory, in plain TOML:
|
|
37
|
+
|
|
38
|
+
```toml
|
|
39
|
+
[[target]]
|
|
40
|
+
name = "physics"
|
|
41
|
+
type = "library"
|
|
42
|
+
srcs = ["gravity.py", "integrators.py"]
|
|
43
|
+
deps = ["//vecmath:vecmath"]
|
|
44
|
+
|
|
45
|
+
[[target]]
|
|
46
|
+
name = "physics_test"
|
|
47
|
+
type = "test"
|
|
48
|
+
runner = "pytest"
|
|
49
|
+
srcs = ["test_gravity.py", "test_integrators.py"]
|
|
50
|
+
deps = [":physics"]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
$ lirk test //...
|
|
55
|
+
cached //vecmath:vecmath
|
|
56
|
+
built //physics:physics
|
|
57
|
+
PASS //physics:physics_test (3.1s)
|
|
58
|
+
cached //render:render_test
|
|
59
|
+
lirk: 2/2 tests passed
|
|
60
|
+
lirk: OK
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
|
|
65
|
+
| | |
|
|
66
|
+
|---|---|
|
|
67
|
+
| `lirk test <label>...` | Run tests, and check what they depend on |
|
|
68
|
+
| `lirk build <label>...` | Check targets without running tests |
|
|
69
|
+
| `lirk init` | Draft BUILD files for an existing repo |
|
|
70
|
+
| `lirk fix` | Add missing deps from your imports |
|
|
71
|
+
| `lirk verify` | Recheck cached results against fresh runs |
|
|
72
|
+
| `lirk clean` | Delete the cache |
|
|
73
|
+
|
|
74
|
+
Labels: `//...` (everything), `//app/...` (a directory and below),
|
|
75
|
+
`//app:all` (one directory), `//app:app_test` (one target).
|
|
76
|
+
|
|
77
|
+
## Documentation
|
|
78
|
+
|
|
79
|
+
- [Getting started](https://socitt.github.io/lirk/getting-started.html):
|
|
80
|
+
a new repo in five minutes
|
|
81
|
+
- [Existing repos](https://socitt.github.io/lirk/adopting.html):
|
|
82
|
+
`lirk init` and what to review
|
|
83
|
+
- [BUILD files](https://socitt.github.io/lirk/build-format.html) and
|
|
84
|
+
[Commands](https://socitt.github.io/lirk/commands.html): reference
|
|
85
|
+
- [How it works](https://socitt.github.io/lirk/how-it-works.html):
|
|
86
|
+
why a cached result can be trusted
|
|
87
|
+
- [Troubleshooting](https://socitt.github.io/lirk/troubleshooting.html)
|
|
88
|
+
|
|
89
|
+
## Background
|
|
90
|
+
|
|
91
|
+
lirk was written after a Bazel-style build tool kept failing
|
|
92
|
+
intermittently on iSH (a Linux environment for iPhone), in a way traced
|
|
93
|
+
to how it managed processes. So lirk does the opposite: each test file
|
|
94
|
+
is one plain, direct subprocess, run one at a time, with no daemon,
|
|
95
|
+
sandbox or process groups. It has since been used across several real
|
|
96
|
+
repos, including itself, without that class of failure. The original
|
|
97
|
+
write-up lives in [`docs/archive/`](docs/archive/).
|
|
98
|
+
|
|
99
|
+
## Contributing
|
|
100
|
+
|
|
101
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
102
|
+
|
|
103
|
+
## License
|
|
104
|
+
|
|
105
|
+
MIT. See [LICENSE](LICENSE).
|
|
File without changes
|