bashrun 0.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.
- bashrun-0.1.0/.github/workflows/ci.yml +51 -0
- bashrun-0.1.0/.gitignore +12 -0
- bashrun-0.1.0/.python-version +1 -0
- bashrun-0.1.0/AGENTS.md +42 -0
- bashrun-0.1.0/CLAUDE.md +1 -0
- bashrun-0.1.0/LICENSE +201 -0
- bashrun-0.1.0/NOTICE +1 -0
- bashrun-0.1.0/PKG-INFO +7 -0
- bashrun-0.1.0/README.md +45 -0
- bashrun-0.1.0/publish-config.json +11 -0
- bashrun-0.1.0/pyproject.toml +26 -0
- bashrun-0.1.0/ruff.toml +57 -0
- bashrun-0.1.0/src/bashrun/__init__.py +23 -0
- bashrun-0.1.0/src/bashrun/bash.py +196 -0
- bashrun-0.1.0/src/bashrun/py.typed +0 -0
- bashrun-0.1.0/tests/test_bash.py +257 -0
- bashrun-0.1.0/uv.lock +138 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
check:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v5
|
|
18
|
+
|
|
19
|
+
- uses: astral-sh/setup-uv@v7
|
|
20
|
+
with:
|
|
21
|
+
enable-cache: true
|
|
22
|
+
|
|
23
|
+
- name: Lint
|
|
24
|
+
run: uv run ruff check .
|
|
25
|
+
|
|
26
|
+
- name: Format
|
|
27
|
+
run: uv run ruff format --check .
|
|
28
|
+
|
|
29
|
+
- name: Type check
|
|
30
|
+
run: uv run basedpyright
|
|
31
|
+
|
|
32
|
+
- name: Test
|
|
33
|
+
run: uv run pytest
|
|
34
|
+
|
|
35
|
+
publish:
|
|
36
|
+
needs: check
|
|
37
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
permissions:
|
|
40
|
+
contents: write
|
|
41
|
+
id-token: write
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v5
|
|
44
|
+
|
|
45
|
+
# Workaround: fetch-tags is broken with shallow clones
|
|
46
|
+
- run: git fetch --tags origin
|
|
47
|
+
|
|
48
|
+
- uses: astral-sh/setup-uv@v7
|
|
49
|
+
|
|
50
|
+
- name: Publish
|
|
51
|
+
run: uvx --from git+https://github.com/outernet-foundation/pubpkg.git@ea2ecf35a93a3c6405b9430a651d2a7b3d2faa6c publish-packages --config publish-config.json
|
bashrun-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
bashrun-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# bashrun
|
|
2
|
+
|
|
3
|
+
## What this is
|
|
4
|
+
|
|
5
|
+
`bashrun` is a zero-dependency Python wrapper around `subprocess` that closes the sharp edges a plain `subprocess.run` leaves open: quoted arguments are `shlex`-parsed so `bash_output("echo 'hello world'")` behaves the way it reads; shell operators (`|`, `||`, `&&`, `;`, `&`, `<`, `>`, backtick) are rejected in single-command helpers so a caller can't silently rely on shell expansion that isn't happening; `KeyboardInterrupt` waits up to five seconds for the child to exit before killing it, so Ctrl+C isn't swallowed and children aren't orphaned; failure paths raise `CalledProcessError` with `stdout` and `stderr` attached rather than a bare non-zero return code; and on Windows, `PATH` resolution happens up front so a missing executable fails with `FileNotFoundError` instead of the platform's `WinError 2`.
|
|
6
|
+
|
|
7
|
+
The package is `bashrun` (src-layout under `src/bashrun/`); consumer repos declare it as a registry dependency (`bashrun>=0.1.0`) once published, and a git source pin only in scratch branches testing unreleased changes.
|
|
8
|
+
|
|
9
|
+
## Shape
|
|
10
|
+
|
|
11
|
+
- `bash.py` — all seven helpers, one file. Each is one shape of "run a command":
|
|
12
|
+
- `bash(command)` — streams stdout/stderr live; raises on non-zero. The default when the caller doesn't need the output. Accepts `log_path=` to tee both streams to a file instead of the terminal.
|
|
13
|
+
- `bash_output(command)` — captures stdout as a `str` and returns it; stderr is buffered and, on failure, printed to the parent's stderr and attached to the raised `CalledProcessError` alongside the partial stdout.
|
|
14
|
+
- `bash_check(command)` — runs silently; returns `True`/`False`. For idempotency probes ("is this already done?") where the failure mode is expected and no output should surface.
|
|
15
|
+
- `bash_check_stream(command)` — like `bash_check`, but streams output. For probes whose progress the caller *does* want to see.
|
|
16
|
+
- `bash_no_raise(command)` — streams output; never raises regardless of exit code. The rare shape for fire-and-continue.
|
|
17
|
+
- `bash_pipe(cmd1, cmd2, ...)` — runs a real shell pipeline by chaining child processes' stdio in Python; each intermediate's stderr is discarded, the final's is preserved. This is why `bash`/`bash_output` reject `|`: pipelines have their own helper.
|
|
18
|
+
- `bash_handoff(command)` — `os.execvpe`s into the child (Windows falls back to `subprocess.run` + `sys.exit`). The current process is replaced; no return.
|
|
19
|
+
- `first_stderr_line(error)` — the first non-empty stderr line of a `CalledProcessError`, falling back to `str(error)` when stderr is absent. The one-liner shape for surfacing "why did it fail" in a verdict row or problem message without dumping full stderr.
|
|
20
|
+
- `__init__.py` — re-exports the seven helper names plus `CalledProcessError` (the type `bash`/`bash_output` raise on failure), so consumers can catch the wrapper's own failure shape without importing `subprocess` themselves; the re-export is routed through `bash.py`, so the `# ruff: noqa: S404` boundary stays that one file.
|
|
21
|
+
|
|
22
|
+
## Constraints
|
|
23
|
+
|
|
24
|
+
**Zero runtime dependencies.** The whole point is that consumers can git-reference `bashrun` from any repo, sandbox, or CI job without dragging a dependency graph in behind it. Adding a runtime dependency negates the reason this package exists as its own repo. Standard-library-only is a hard rule.
|
|
25
|
+
|
|
26
|
+
**Every command goes through `_check_no_shell_operator` and `_resolve_args` (except `bash_pipe`).** `_check_no_shell_operator` strips quoted segments and rejects any remaining character in `[|;&<>\`]` — pipe, logical-OR/AND, sequence, background, redirection, and backtick command substitution. bash's helpers run without a shell, so any of those operators would be passed as a literal argument rather than interpreted; rejecting them surfaces the mismatch at the caller instead of silently doing the wrong thing. `bash_pipe` is the one sanctioned shell-pipeline surface; everything else refuses `|` and points the caller at either splitting into separate calls or using `bash_pipe`. Shell fallback patterns like `cmd || echo default` are refused by design: the caller should probe with `bash_check` and branch in Python, not lean on shell short-circuit. `_resolve_args` uses `shlex.split` with `posix=(os.name != "nt")` so quoted arguments parse the way they read, and on Windows also resolves `argv[0]` against `PATH` via `shutil.which` up front — `subprocess.Popen` on Windows won't do that for you and returns `WinError 2` when it can't find the binary. Skipping either guard defeats the reason a caller reached for this package instead of raw `subprocess`.
|
|
27
|
+
|
|
28
|
+
**`env=` overlays the inherited environment; it does not replace it.** Every helper takes an optional `env=` mapping. It is merged *onto* the process environment (`{**os.environ, **env}`) into a fresh dict, so the child sees the extra or overridden vars while everything else (`PATH`, `HOME`, …) is still inherited, and this process's `os.environ` is never mutated. This is deliberately unlike `subprocess`'s own `env=`, which replaces the environment wholesale: callers here almost always want "add a couple of vars for this one child," and the pattern this replaces — mutating the global `os.environ` so a child inherits a var — leaks that var into every later subprocess in the process. Passing `env=None` (the default) inherits unchanged.
|
|
29
|
+
|
|
30
|
+
**`KeyboardInterrupt` handling is load-bearing, not incidental.** Each helper's `except KeyboardInterrupt` waits up to five seconds for the child to exit cleanly, then kills, then re-raises. Naive `subprocess.run` doesn't propagate Ctrl+C to a long-running child in a way that lets the child clean up; the wait-then-kill dance is why callers can trust that Ctrl+C in the parent actually reaches (and eventually terminates) the child.
|
|
31
|
+
|
|
32
|
+
**Wheel must ship `py.typed`.** The package is typed and consumers expect strict-mode-friendly imports. A real hatch-built wheel omits non-Python files unless `[tool.hatch.build.targets.wheel] include` names them; drop the `py.typed` entry from `pyproject.toml` and downstream basedpyright/mypy silently treat the package as untyped.
|
|
33
|
+
|
|
34
|
+
**The module-level `# ruff: noqa: S404, S603` in `bash.py` stays.** This package *is* the subprocess wrapper — importing and calling `subprocess` unsafely is its whole job. The suppression is the wrapper boundary (case 1 in the shared "fix warnings; suppress only under a wrapped or tracked exception" rule): every `subprocess` usage lives inside this one file, and the header declares it as the sanctioned suppression site so audits don't have to reason about each call individually.
|
|
35
|
+
|
|
36
|
+
## Release flow
|
|
37
|
+
|
|
38
|
+
Publishing rides `ci.yml`'s `publish` job on every push to `main` (gated on the check job): pubpkg — invoked uvx-isolated from a pinned git ref, never a project dependency (bashrun sits inside pubpkg's own dependency graph; a project-level pubpkg edge is a resolver cycle) — computes the plan from the tag ledger and path-diff, patches the version ephemerally, and publishes to PyPI under OIDC trusted publishing (pending publisher bound to `ci.yml`, no environment). The committed `pyproject.toml` version is permanently the `0.0.0.dev0` sentinel; the `bashrun-v*` tags are the version ledger (first release `0.1.0`, patch-auto thereafter). API-breaking changes ship with a manually bumped version — patch-auto assumes additive changes.
|
|
39
|
+
|
|
40
|
+
## See also
|
|
41
|
+
|
|
42
|
+
- `README.md` — human-facing setup and usage.
|
bashrun-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
bashrun-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
bashrun-0.1.0/NOTICE
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright 2026 Tyler Hatch
|
bashrun-0.1.0/PKG-INFO
ADDED
bashrun-0.1.0/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# bashrun
|
|
2
|
+
|
|
3
|
+
Guardrailed shell-exec helpers for Python. A thin, zero-dependency layer over `subprocess` that closes the sharp edges: quoted arguments are parsed with `shlex`, shell operators like `|`, `||`, `&&`, `;`, `&`, `<`, `>`, and backtick command substitution are rejected in single-command helpers (a separate `bash_pipe()` handles real pipelines), `KeyboardInterrupt` waits for the child to exit cleanly instead of leaving it orphaned, and failure paths raise `CalledProcessError` with `stdout` and `stderr` attached rather than a bare non-zero return code. On Windows, executables are resolved against `PATH` up front so a missing binary fails with a clear `FileNotFoundError`, not `WinError 2`.
|
|
4
|
+
|
|
5
|
+
The helpers form one small vocabulary — `bash`, `bash_output`, `bash_check`, `bash_check_stream`, `bash_no_raise`, `bash_pipe`, `bash_handoff` — each covering a specific failure-and-output shape, with `CalledProcessError` re-exported for consumers that need to catch the failure type. See the module docstring conventions in [`AGENTS.md`](./AGENTS.md) for which helper to reach for.
|
|
6
|
+
|
|
7
|
+
## Setup
|
|
8
|
+
|
|
9
|
+
Requires Python 3.13+ and [uv](https://docs.astral.sh/uv/).
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
uv sync
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```python
|
|
18
|
+
from bashrun import bash, bash_check, bash_output
|
|
19
|
+
|
|
20
|
+
bash("docker compose up -d") # streams to stdout/stderr; raises on failure
|
|
21
|
+
text = bash_output("git rev-parse HEAD") # captures stdout; raises on failure
|
|
22
|
+
if bash_check("test -f .env"): # silent boolean; never raises
|
|
23
|
+
...
|
|
24
|
+
bash("make", env={"CC": "clang"}) # env overlays the inherited environment for this child only
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Consuming from another repo
|
|
28
|
+
|
|
29
|
+
Install from PyPI:
|
|
30
|
+
|
|
31
|
+
```toml
|
|
32
|
+
[project]
|
|
33
|
+
dependencies = ["bashrun>=0.1.0"]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To test an unreleased change, pin the repo at a git ref in a scratch branch instead (`bashrun = { git = "https://github.com/outernet-foundation/bashrun.git", rev = "<sha>" }` under `[tool.uv.sources]`) and drop the pin when the release lands.
|
|
37
|
+
|
|
38
|
+
## Development
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
uv run ruff check .
|
|
42
|
+
uv run ruff format --check .
|
|
43
|
+
uv run basedpyright
|
|
44
|
+
uv run pytest
|
|
45
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "bashrun"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Guardrailed shell-exec helpers for Python"
|
|
5
|
+
requires-python = ">=3.13"
|
|
6
|
+
dependencies = []
|
|
7
|
+
|
|
8
|
+
[dependency-groups]
|
|
9
|
+
dev = ["basedpyright>=1.39.10", "ruff>=0.14.11", "pytest>=8.0.0"]
|
|
10
|
+
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["hatchling"]
|
|
13
|
+
build-backend = "hatchling.build"
|
|
14
|
+
|
|
15
|
+
[tool.hatch.build.targets.wheel]
|
|
16
|
+
packages = ["src/bashrun"]
|
|
17
|
+
include = ["src/bashrun/py.typed"]
|
|
18
|
+
|
|
19
|
+
[tool.basedpyright]
|
|
20
|
+
venvPath = "."
|
|
21
|
+
venv = ".venv"
|
|
22
|
+
typeCheckingMode = "strict"
|
|
23
|
+
include = ["src", "tests"]
|
|
24
|
+
|
|
25
|
+
[tool.pytest.ini_options]
|
|
26
|
+
testpaths = ["tests"]
|
bashrun-0.1.0/ruff.toml
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
target-version = "py313"
|
|
2
|
+
line-length = 120
|
|
3
|
+
preview = true
|
|
4
|
+
|
|
5
|
+
[lint]
|
|
6
|
+
select = ["ALL"]
|
|
7
|
+
ignore = [
|
|
8
|
+
# Type annotations — basedpyright strict mode handles this
|
|
9
|
+
"ANN",
|
|
10
|
+
# No docstrings, no copyright headers
|
|
11
|
+
"D",
|
|
12
|
+
"DOC",
|
|
13
|
+
"CPY",
|
|
14
|
+
# TODO/FIXME comment formatting
|
|
15
|
+
"TD",
|
|
16
|
+
"FIX",
|
|
17
|
+
# Exception message ergonomics — literal-indirection and custom-class churn without benefit
|
|
18
|
+
"EM101",
|
|
19
|
+
"EM102",
|
|
20
|
+
"TRY003",
|
|
21
|
+
# Class attribute names never conflict with builtins via self.x
|
|
22
|
+
"A003",
|
|
23
|
+
# Function-size counters — C901 already covers structural complexity
|
|
24
|
+
"PLR0911",
|
|
25
|
+
"PLR0912",
|
|
26
|
+
"PLR0913",
|
|
27
|
+
"PLR0914",
|
|
28
|
+
"PLR0915",
|
|
29
|
+
"PLR0917",
|
|
30
|
+
# Boolean parameters read fine as keyword-only flags here
|
|
31
|
+
"FBT001",
|
|
32
|
+
"FBT002",
|
|
33
|
+
"FBT003",
|
|
34
|
+
# Relative imports are the intra-package convention
|
|
35
|
+
"TID252",
|
|
36
|
+
# Formatter-owned; enforced by `ruff format`
|
|
37
|
+
"COM812",
|
|
38
|
+
"I001",
|
|
39
|
+
# Magic values in comparisons are readable here
|
|
40
|
+
"PLR2004",
|
|
41
|
+
# The formatter owns wrapping; long string literals and URLs stay on one line
|
|
42
|
+
"E501",
|
|
43
|
+
# src-layout tests need no __init__.py
|
|
44
|
+
"INP001",
|
|
45
|
+
# Runtime-used typing imports stay at module level
|
|
46
|
+
"TC001",
|
|
47
|
+
"TC002",
|
|
48
|
+
"TC003",
|
|
49
|
+
# Small literal tuples read fine in membership tests
|
|
50
|
+
"PLR6201",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[lint.per-file-ignores]
|
|
54
|
+
"tests/**" = ["S101", "PLR6301"]
|
|
55
|
+
|
|
56
|
+
[lint.flake8-builtins]
|
|
57
|
+
ignorelist = ["id", "map"]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from .bash import (
|
|
2
|
+
CalledProcessError,
|
|
3
|
+
bash,
|
|
4
|
+
bash_check,
|
|
5
|
+
bash_check_stream,
|
|
6
|
+
bash_handoff,
|
|
7
|
+
bash_no_raise,
|
|
8
|
+
bash_output,
|
|
9
|
+
bash_pipe,
|
|
10
|
+
first_stderr_line,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
__all__ = [
|
|
14
|
+
"CalledProcessError",
|
|
15
|
+
"bash",
|
|
16
|
+
"bash_check",
|
|
17
|
+
"bash_check_stream",
|
|
18
|
+
"bash_handoff",
|
|
19
|
+
"bash_no_raise",
|
|
20
|
+
"bash_output",
|
|
21
|
+
"bash_pipe",
|
|
22
|
+
"first_stderr_line",
|
|
23
|
+
]
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# ruff: noqa: S404, S603, S606, T201, PLW0717, PLW1510 — this module is the project's subprocess wrapper
|
|
2
|
+
import os
|
|
3
|
+
import re
|
|
4
|
+
import shlex
|
|
5
|
+
import shutil
|
|
6
|
+
import subprocess
|
|
7
|
+
import sys
|
|
8
|
+
from contextlib import ExitStack
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from subprocess import CalledProcessError, Popen, TimeoutExpired
|
|
11
|
+
from typing import NoReturn
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
_SHELL_OPERATOR_PATTERN = re.compile(r"[|;&<>`]")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _check_no_shell_operator(command: str) -> None:
|
|
18
|
+
stripped = re.sub(r'"[^"]*"', "", re.sub(r"'[^']*'", "", command))
|
|
19
|
+
match = _SHELL_OPERATOR_PATTERN.search(stripped)
|
|
20
|
+
if match is not None:
|
|
21
|
+
msg = (
|
|
22
|
+
f"Command contains shell operator {match.group()!r}: {command!r}. "
|
|
23
|
+
"bash() runs without a shell, so the operator would be passed as a literal argument. "
|
|
24
|
+
"Split into separate bash() calls, or use bash_pipe() for pipelines."
|
|
25
|
+
)
|
|
26
|
+
raise ValueError(msg)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _resolve_args(command: str) -> list[str]:
|
|
30
|
+
args = shlex.split(command, posix=(os.name != "nt"))
|
|
31
|
+
if os.name == "nt" and args:
|
|
32
|
+
resolved = shutil.which(args[0])
|
|
33
|
+
if resolved is None:
|
|
34
|
+
msg = f"Executable not found on PATH: {args[0]!r}"
|
|
35
|
+
raise FileNotFoundError(msg)
|
|
36
|
+
args[0] = resolved
|
|
37
|
+
return args
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def _merge_env(env: dict[str, str] | None) -> dict[str, str] | None:
|
|
41
|
+
# env overlays the inherited process environment rather than replacing it, and is built into a
|
|
42
|
+
# fresh dict so the child sees the extra vars without mutating this process's os.environ.
|
|
43
|
+
return {**os.environ, **env} if env else None
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def bash_output(
|
|
47
|
+
command: str, *, cwd: Path | None = None, stdin_text: str | None = None, env: dict[str, str] | None = None
|
|
48
|
+
) -> str:
|
|
49
|
+
_check_no_shell_operator(command)
|
|
50
|
+
args = _resolve_args(command)
|
|
51
|
+
|
|
52
|
+
with Popen(
|
|
53
|
+
args,
|
|
54
|
+
cwd=str(cwd) if cwd else None,
|
|
55
|
+
env=_merge_env(env),
|
|
56
|
+
stdout=subprocess.PIPE,
|
|
57
|
+
stderr=subprocess.PIPE,
|
|
58
|
+
stdin=subprocess.PIPE if stdin_text else None,
|
|
59
|
+
text=True,
|
|
60
|
+
) as process:
|
|
61
|
+
try:
|
|
62
|
+
stdout, stderr = process.communicate(input=stdin_text)
|
|
63
|
+
except KeyboardInterrupt:
|
|
64
|
+
try:
|
|
65
|
+
process.wait(timeout=5)
|
|
66
|
+
except TimeoutExpired:
|
|
67
|
+
process.kill()
|
|
68
|
+
raise
|
|
69
|
+
|
|
70
|
+
if process.returncode != 0:
|
|
71
|
+
if stderr:
|
|
72
|
+
print(stderr, file=sys.stderr, end="")
|
|
73
|
+
raise CalledProcessError(process.returncode, command, output=stdout, stderr=stderr)
|
|
74
|
+
|
|
75
|
+
return stdout or ""
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def bash(
|
|
79
|
+
command: str,
|
|
80
|
+
*,
|
|
81
|
+
cwd: Path | None = None,
|
|
82
|
+
stdin_text: str | None = None,
|
|
83
|
+
log_path: Path | None = None,
|
|
84
|
+
env: dict[str, str] | None = None,
|
|
85
|
+
) -> None:
|
|
86
|
+
_check_no_shell_operator(command)
|
|
87
|
+
args = _resolve_args(command)
|
|
88
|
+
|
|
89
|
+
with ExitStack() as stack:
|
|
90
|
+
if log_path:
|
|
91
|
+
log_path.parent.mkdir(parents=True, exist_ok=True)
|
|
92
|
+
log = stack.enter_context(log_path.open("a"))
|
|
93
|
+
stdout, stderr = log, log
|
|
94
|
+
else:
|
|
95
|
+
stdout, stderr = sys.stdout, sys.stderr
|
|
96
|
+
|
|
97
|
+
process = stack.enter_context(
|
|
98
|
+
Popen(
|
|
99
|
+
args,
|
|
100
|
+
cwd=str(cwd) if cwd else None,
|
|
101
|
+
env=_merge_env(env),
|
|
102
|
+
stdout=stdout,
|
|
103
|
+
stderr=stderr,
|
|
104
|
+
stdin=subprocess.PIPE if stdin_text else None,
|
|
105
|
+
text=True,
|
|
106
|
+
)
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
try:
|
|
110
|
+
process.communicate(input=stdin_text)
|
|
111
|
+
except KeyboardInterrupt:
|
|
112
|
+
try:
|
|
113
|
+
process.wait(timeout=5)
|
|
114
|
+
except TimeoutExpired:
|
|
115
|
+
process.kill()
|
|
116
|
+
raise
|
|
117
|
+
|
|
118
|
+
if process.returncode != 0:
|
|
119
|
+
raise CalledProcessError(process.returncode, command)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def bash_pipe(*commands: str, cwd: Path | None = None, env: dict[str, str] | None = None) -> None:
|
|
123
|
+
if len(commands) < 2:
|
|
124
|
+
msg = "bash_pipe requires at least 2 commands"
|
|
125
|
+
raise ValueError(msg)
|
|
126
|
+
|
|
127
|
+
merged_env = _merge_env(env)
|
|
128
|
+
processes: list[Popen[bytes]] = []
|
|
129
|
+
try:
|
|
130
|
+
for i, command in enumerate(commands):
|
|
131
|
+
args = _resolve_args(command)
|
|
132
|
+
stdin = processes[-1].stdout if i > 0 else None
|
|
133
|
+
stdout = subprocess.PIPE if i < len(commands) - 1 else sys.stdout
|
|
134
|
+
stderr = sys.stderr if i == len(commands) - 1 else subprocess.DEVNULL
|
|
135
|
+
processes.append(
|
|
136
|
+
Popen(args, stdin=stdin, stdout=stdout, stderr=stderr, cwd=str(cwd) if cwd else None, env=merged_env)
|
|
137
|
+
)
|
|
138
|
+
if i > 0 and processes[-2].stdout:
|
|
139
|
+
processes[-2].stdout.close()
|
|
140
|
+
|
|
141
|
+
for process in processes:
|
|
142
|
+
process.wait()
|
|
143
|
+
except KeyboardInterrupt:
|
|
144
|
+
for process in processes:
|
|
145
|
+
try:
|
|
146
|
+
process.wait(timeout=5)
|
|
147
|
+
except TimeoutExpired:
|
|
148
|
+
process.kill()
|
|
149
|
+
raise
|
|
150
|
+
|
|
151
|
+
for process in processes:
|
|
152
|
+
if process.returncode != 0:
|
|
153
|
+
raise CalledProcessError(process.returncode, process.args)
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def bash_check(command: str, *, cwd: Path | None = None, env: dict[str, str] | None = None) -> bool:
|
|
157
|
+
_check_no_shell_operator(command)
|
|
158
|
+
args = _resolve_args(command)
|
|
159
|
+
result = subprocess.run(args, cwd=str(cwd) if cwd else None, env=_merge_env(env), capture_output=True)
|
|
160
|
+
return result.returncode == 0
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
def bash_check_stream(command: str, *, cwd: Path | None = None, env: dict[str, str] | None = None) -> bool:
|
|
164
|
+
_check_no_shell_operator(command)
|
|
165
|
+
args = _resolve_args(command)
|
|
166
|
+
result = subprocess.run(args, cwd=str(cwd) if cwd else None, env=_merge_env(env))
|
|
167
|
+
return result.returncode == 0
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def bash_no_raise(command: str, *, cwd: Path | None = None, env: dict[str, str] | None = None) -> None:
|
|
171
|
+
_check_no_shell_operator(command)
|
|
172
|
+
args = _resolve_args(command)
|
|
173
|
+
subprocess.run(args, cwd=str(cwd) if cwd else None, env=_merge_env(env))
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def bash_handoff(command: str, *, cwd: Path | None = None, env: dict[str, str] | None = None) -> NoReturn:
|
|
177
|
+
_check_no_shell_operator(command)
|
|
178
|
+
args = _resolve_args(command)
|
|
179
|
+
|
|
180
|
+
if cwd:
|
|
181
|
+
os.chdir(cwd)
|
|
182
|
+
|
|
183
|
+
merged_env = _merge_env(env)
|
|
184
|
+
|
|
185
|
+
if sys.platform != "win32":
|
|
186
|
+
os.execvpe(args[0], args, merged_env if merged_env is not None else os.environ)
|
|
187
|
+
else:
|
|
188
|
+
try:
|
|
189
|
+
subprocess.run(args, check=True, env=merged_env)
|
|
190
|
+
except subprocess.CalledProcessError as error:
|
|
191
|
+
sys.exit(error.returncode)
|
|
192
|
+
sys.exit(0)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def first_stderr_line(error: CalledProcessError) -> str:
|
|
196
|
+
return next((line.strip() for line in (error.stderr or "").splitlines() if line.strip()), str(error))
|
|
File without changes
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# ruff: noqa: S404, S603, PLW1510, PLC1901 — tests for the subprocess wrapper
|
|
2
|
+
import os
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
import tempfile
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
import pytest
|
|
9
|
+
from bashrun import (
|
|
10
|
+
CalledProcessError,
|
|
11
|
+
bash,
|
|
12
|
+
bash_check,
|
|
13
|
+
bash_check_stream,
|
|
14
|
+
bash_no_raise,
|
|
15
|
+
bash_output,
|
|
16
|
+
first_stderr_line,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class TestBashOutput:
|
|
21
|
+
def test_captures_stdout(self):
|
|
22
|
+
assert bash_output("echo hello") == "hello\n"
|
|
23
|
+
|
|
24
|
+
def test_returns_empty_string_on_no_output(self):
|
|
25
|
+
assert bash_output("true") == ""
|
|
26
|
+
|
|
27
|
+
def test_raises_on_failure(self):
|
|
28
|
+
with pytest.raises(subprocess.CalledProcessError):
|
|
29
|
+
bash_output("false")
|
|
30
|
+
|
|
31
|
+
def test_attaches_stderr_to_exception(self):
|
|
32
|
+
with pytest.raises(subprocess.CalledProcessError) as exc_info:
|
|
33
|
+
bash_output("sh -c 'echo oops >&2; exit 1'")
|
|
34
|
+
assert "oops" in (exc_info.value.stderr or "")
|
|
35
|
+
|
|
36
|
+
def test_attaches_stdout_to_exception(self):
|
|
37
|
+
with pytest.raises(subprocess.CalledProcessError) as exc_info:
|
|
38
|
+
bash_output("sh -c 'echo partial; exit 1'")
|
|
39
|
+
assert "partial" in (exc_info.value.stdout or "")
|
|
40
|
+
|
|
41
|
+
def test_respects_cwd(self):
|
|
42
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
43
|
+
result = bash_output("pwd", cwd=Path(tmpdir))
|
|
44
|
+
assert result.strip() == tmpdir
|
|
45
|
+
|
|
46
|
+
def test_passes_stdin_text(self):
|
|
47
|
+
assert bash_output("cat", stdin_text="hello world") == "hello world"
|
|
48
|
+
|
|
49
|
+
def test_handles_quoted_arguments(self):
|
|
50
|
+
assert bash_output("echo 'hello world'") == "hello world\n"
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class TestBash:
|
|
54
|
+
def test_no_raise_on_success(self):
|
|
55
|
+
bash("true")
|
|
56
|
+
|
|
57
|
+
def test_raises_on_failure(self):
|
|
58
|
+
with pytest.raises(subprocess.CalledProcessError):
|
|
59
|
+
bash("false")
|
|
60
|
+
|
|
61
|
+
def test_returns_none(self):
|
|
62
|
+
assert bash("true") is None
|
|
63
|
+
|
|
64
|
+
def test_respects_cwd(self):
|
|
65
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
66
|
+
result = subprocess.run(
|
|
67
|
+
[
|
|
68
|
+
sys.executable,
|
|
69
|
+
"-c",
|
|
70
|
+
f"from pathlib import Path; from bashrun import bash; bash('pwd', cwd=Path('{tmpdir}'))",
|
|
71
|
+
],
|
|
72
|
+
capture_output=True,
|
|
73
|
+
text=True,
|
|
74
|
+
)
|
|
75
|
+
assert tmpdir in result.stdout
|
|
76
|
+
|
|
77
|
+
def test_passes_stdin_text(self):
|
|
78
|
+
result = subprocess.run(
|
|
79
|
+
[sys.executable, "-c", "from bashrun import bash; bash('cat', stdin_text='streamed input')"],
|
|
80
|
+
capture_output=True,
|
|
81
|
+
text=True,
|
|
82
|
+
)
|
|
83
|
+
assert "streamed input" in result.stdout
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class TestBashCheck:
|
|
87
|
+
def test_returns_true_on_success(self):
|
|
88
|
+
assert bash_check("true") is True
|
|
89
|
+
|
|
90
|
+
def test_returns_false_on_failure(self):
|
|
91
|
+
assert bash_check("false") is False
|
|
92
|
+
|
|
93
|
+
def test_no_raise_on_failure(self):
|
|
94
|
+
bash_check("false")
|
|
95
|
+
|
|
96
|
+
def test_respects_cwd(self):
|
|
97
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
98
|
+
assert bash_check(f"test -d {tmpdir}") is True
|
|
99
|
+
|
|
100
|
+
def test_suppresses_all_output(self, capsys: pytest.CaptureFixture[str]):
|
|
101
|
+
bash_check("echo should_not_appear")
|
|
102
|
+
captured = capsys.readouterr()
|
|
103
|
+
assert "should_not_appear" not in captured.out
|
|
104
|
+
assert "should_not_appear" not in captured.err
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
class TestBashCheckStream:
|
|
108
|
+
def test_returns_true_on_success(self):
|
|
109
|
+
assert bash_check_stream("true") is True
|
|
110
|
+
|
|
111
|
+
def test_returns_false_on_failure(self):
|
|
112
|
+
assert bash_check_stream("false") is False
|
|
113
|
+
|
|
114
|
+
def test_no_raise_on_failure(self):
|
|
115
|
+
bash_check_stream("false")
|
|
116
|
+
|
|
117
|
+
def test_respects_cwd(self):
|
|
118
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
119
|
+
assert bash_check_stream(f"test -d {tmpdir}") is True
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
class TestBashNoRaise:
|
|
123
|
+
def test_no_raise_on_success(self):
|
|
124
|
+
bash_no_raise("true")
|
|
125
|
+
|
|
126
|
+
def test_no_raise_on_failure(self):
|
|
127
|
+
bash_no_raise("false")
|
|
128
|
+
|
|
129
|
+
def test_returns_none(self):
|
|
130
|
+
assert bash_no_raise("true") is None
|
|
131
|
+
|
|
132
|
+
def test_respects_cwd(self):
|
|
133
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
134
|
+
bash_no_raise(f"test -d {tmpdir}")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class TestBashHandoff:
|
|
138
|
+
def test_stdout_contains_output(self):
|
|
139
|
+
result = subprocess.run(
|
|
140
|
+
[sys.executable, "-c", "from bashrun import bash_handoff; bash_handoff('echo handoff_test')"],
|
|
141
|
+
capture_output=True,
|
|
142
|
+
text=True,
|
|
143
|
+
)
|
|
144
|
+
assert "handoff_test" in result.stdout
|
|
145
|
+
|
|
146
|
+
def test_exit_code_matches(self):
|
|
147
|
+
result = subprocess.run(
|
|
148
|
+
[sys.executable, "-c", "from bashrun import bash_handoff; bash_handoff('sh -c \"exit 42\"')"],
|
|
149
|
+
capture_output=True,
|
|
150
|
+
text=True,
|
|
151
|
+
)
|
|
152
|
+
assert result.returncode == 42
|
|
153
|
+
|
|
154
|
+
def test_respects_cwd(self):
|
|
155
|
+
with tempfile.TemporaryDirectory() as tmpdir:
|
|
156
|
+
result = subprocess.run(
|
|
157
|
+
[
|
|
158
|
+
sys.executable,
|
|
159
|
+
"-c",
|
|
160
|
+
f"from pathlib import Path; from bashrun import bash_handoff; bash_handoff('pwd', cwd=Path('{tmpdir}'))",
|
|
161
|
+
],
|
|
162
|
+
capture_output=True,
|
|
163
|
+
text=True,
|
|
164
|
+
)
|
|
165
|
+
assert tmpdir in result.stdout
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class TestEnv:
|
|
169
|
+
def test_env_var_reaches_child(self):
|
|
170
|
+
assert bash_output("printenv OVERLAY_VAR", env={"OVERLAY_VAR": "hello"}) == "hello\n"
|
|
171
|
+
|
|
172
|
+
def test_env_overlays_rather_than_replaces(self, monkeypatch: pytest.MonkeyPatch):
|
|
173
|
+
# an inherited var stays visible alongside the caller's overlay
|
|
174
|
+
monkeypatch.setenv("INHERITED_VAR", "base")
|
|
175
|
+
assert bash_output("printenv INHERITED_VAR", env={"OTHER_VAR": "x"}) == "base\n"
|
|
176
|
+
|
|
177
|
+
def test_env_does_not_mutate_parent_environ(self):
|
|
178
|
+
bash_output("true", env={"SHOULD_NOT_LEAK": "1"})
|
|
179
|
+
assert "SHOULD_NOT_LEAK" not in os.environ
|
|
180
|
+
|
|
181
|
+
def test_env_overrides_inherited_value(self, monkeypatch: pytest.MonkeyPatch):
|
|
182
|
+
monkeypatch.setenv("COLLIDE_VAR", "old")
|
|
183
|
+
assert bash_output("printenv COLLIDE_VAR", env={"COLLIDE_VAR": "new"}) == "new\n"
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
class TestShellOperatorRejection:
|
|
187
|
+
def test_accepts_plain_command(self):
|
|
188
|
+
assert bash_check("true")
|
|
189
|
+
|
|
190
|
+
def test_rejects_logical_and(self):
|
|
191
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
192
|
+
bash_check("true && false")
|
|
193
|
+
|
|
194
|
+
def test_rejects_logical_or(self):
|
|
195
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
196
|
+
bash_check("false || true")
|
|
197
|
+
|
|
198
|
+
def test_rejects_pipe(self):
|
|
199
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
200
|
+
bash_check("true | false")
|
|
201
|
+
|
|
202
|
+
def test_rejects_sequence(self):
|
|
203
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
204
|
+
bash_check("true ; false")
|
|
205
|
+
|
|
206
|
+
def test_rejects_background_ampersand(self):
|
|
207
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
208
|
+
bash_check("true &")
|
|
209
|
+
|
|
210
|
+
def test_rejects_input_redirection(self):
|
|
211
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
212
|
+
bash_check("true < /dev/null")
|
|
213
|
+
|
|
214
|
+
def test_rejects_output_redirection(self):
|
|
215
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
216
|
+
bash_check("true > /dev/null")
|
|
217
|
+
|
|
218
|
+
def test_rejects_backtick_substitution(self):
|
|
219
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
220
|
+
bash_check("true `echo arg`")
|
|
221
|
+
|
|
222
|
+
def test_ignores_operator_inside_single_quotes(self):
|
|
223
|
+
assert bash_check("true 'a && b'")
|
|
224
|
+
|
|
225
|
+
def test_ignores_operator_inside_double_quotes(self):
|
|
226
|
+
assert bash_check('true "a && b"')
|
|
227
|
+
|
|
228
|
+
def test_rejects_operator_outside_quotes_when_quotes_also_present(self):
|
|
229
|
+
with pytest.raises(ValueError, match="shell operator"):
|
|
230
|
+
bash_check('true "safe" && rm -rf /')
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class TestReExports:
|
|
234
|
+
def test_called_process_error_is_the_subprocess_exception(self):
|
|
235
|
+
assert CalledProcessError is subprocess.CalledProcessError
|
|
236
|
+
|
|
237
|
+
def test_raised_errors_are_catchable_via_the_re_export(self):
|
|
238
|
+
with pytest.raises(CalledProcessError):
|
|
239
|
+
bash_output("false")
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
class TestFirstStderrLine:
|
|
243
|
+
def test_returns_first_non_empty_line(self):
|
|
244
|
+
error = CalledProcessError(1, "git fetch", stderr="hint: update your remote\nfatal: not found\n")
|
|
245
|
+
assert first_stderr_line(error) == "hint: update your remote"
|
|
246
|
+
|
|
247
|
+
def test_strips_surrounding_whitespace(self):
|
|
248
|
+
error = CalledProcessError(1, "git fetch", stderr=" fatal: boom \n")
|
|
249
|
+
assert first_stderr_line(error) == "fatal: boom"
|
|
250
|
+
|
|
251
|
+
def test_falls_back_to_exception_text_without_stderr(self):
|
|
252
|
+
error = CalledProcessError(1, "git fetch")
|
|
253
|
+
assert first_stderr_line(error) == str(error)
|
|
254
|
+
|
|
255
|
+
def test_falls_back_when_stderr_is_whitespace_only(self):
|
|
256
|
+
error = CalledProcessError(1, "git fetch", stderr=" \n \n")
|
|
257
|
+
assert first_stderr_line(error) == str(error)
|
bashrun-0.1.0/uv.lock
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
version = 1
|
|
2
|
+
revision = 3
|
|
3
|
+
requires-python = ">=3.13"
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "basedpyright"
|
|
7
|
+
version = "1.39.10"
|
|
8
|
+
source = { registry = "https://pypi.org/simple" }
|
|
9
|
+
dependencies = [
|
|
10
|
+
{ name = "nodejs-wheel-binaries" },
|
|
11
|
+
]
|
|
12
|
+
sdist = { url = "https://files.pythonhosted.org/packages/68/43/ad2999f3b09eb2b1e59931d88fac0f7bcc9c17fc18c903268779bd10cc97/basedpyright-1.39.10.tar.gz", hash = "sha256:c8eaf5302f3265e275c7df4fba194d7afa7c1cb53fbfd448e90098360aca2c2e", size = 24740347, upload-time = "2026-08-13T17:09:02.51Z" }
|
|
13
|
+
wheels = [
|
|
14
|
+
{ url = "https://files.pythonhosted.org/packages/be/2a/a224054d75a58786c482f63b8ff2a09fc3362268bd1ebd0a61fb3f982153/basedpyright-1.39.10-py3-none-any.whl", hash = "sha256:cbd75d83c0be841329bcfef2d2f1182f152a6d975b8eb199e75cf5b8e9a3de78", size = 13482322, upload-time = "2026-08-13T17:08:59.074Z" },
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "bashrun"
|
|
19
|
+
version = "0.0.0.dev0"
|
|
20
|
+
source = { editable = "." }
|
|
21
|
+
|
|
22
|
+
[package.dev-dependencies]
|
|
23
|
+
dev = [
|
|
24
|
+
{ name = "basedpyright" },
|
|
25
|
+
{ name = "pytest" },
|
|
26
|
+
{ name = "ruff" },
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[package.metadata]
|
|
30
|
+
|
|
31
|
+
[package.metadata.requires-dev]
|
|
32
|
+
dev = [
|
|
33
|
+
{ name = "basedpyright", specifier = ">=1.39.10" },
|
|
34
|
+
{ name = "pytest", specifier = ">=8.0.0" },
|
|
35
|
+
{ name = "ruff", specifier = ">=0.14.11" },
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[[package]]
|
|
39
|
+
name = "colorama"
|
|
40
|
+
version = "0.4.6"
|
|
41
|
+
source = { registry = "https://pypi.org/simple" }
|
|
42
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
|
|
43
|
+
wheels = [
|
|
44
|
+
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[[package]]
|
|
48
|
+
name = "iniconfig"
|
|
49
|
+
version = "2.3.0"
|
|
50
|
+
source = { registry = "https://pypi.org/simple" }
|
|
51
|
+
sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" }
|
|
52
|
+
wheels = [
|
|
53
|
+
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
[[package]]
|
|
57
|
+
name = "nodejs-wheel-binaries"
|
|
58
|
+
version = "24.16.0"
|
|
59
|
+
source = { registry = "https://pypi.org/simple" }
|
|
60
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a3/22/2a5beb4e21417c73233d9f65cf6f3e96e891b80d2f550a8f630ebc6b88c6/nodejs_wheel_binaries-24.16.0.tar.gz", hash = "sha256:c973cb69dc5fd16e6f6dc6e579e2c3d5534e2a1f57619dddf5ba070efa7dde37", size = 8056, upload-time = "2026-05-30T16:52:09.807Z" }
|
|
61
|
+
wheels = [
|
|
62
|
+
{ url = "https://files.pythonhosted.org/packages/83/d1/68b43b53cd0fa83ae6fd406705023ca988d9e0ca41c724d82e66fbeb2ef6/nodejs_wheel_binaries-24.16.0-py2.py3-none-macosx_13_0_arm64.whl", hash = "sha256:d9f8f677dcf30e37ac244f07869726abe043f01eb0f45722b1df31cc2af7093c", size = 55666374, upload-time = "2026-05-30T16:51:39.588Z" },
|
|
63
|
+
{ url = "https://files.pythonhosted.org/packages/e9/b2/40a989159599080da485de966c4c2d207e852ac7aa7864702626d96c8bf5/nodejs_wheel_binaries-24.16.0-py2.py3-none-macosx_13_0_x86_64.whl", hash = "sha256:3d0370fe7120ce9697a4f60d40480d2bd8808d9f30131458d5afc0040d4e5a51", size = 55838487, upload-time = "2026-05-30T16:51:43.383Z" },
|
|
64
|
+
{ url = "https://files.pythonhosted.org/packages/d7/a7/cd42174fb5ff6faff7fa8d326a18914d8f232098ab5de055b57c16fa13ca/nodejs_wheel_binaries-24.16.0-py2.py3-none-manylinux_2_28_aarch64.whl", hash = "sha256:85dc92bbb79c851569c5925dcc2a4c915a034efab375f99e4e7e6bbe9cca8342", size = 60179540, upload-time = "2026-05-30T16:51:47.036Z" },
|
|
65
|
+
{ url = "https://files.pythonhosted.org/packages/2b/95/c8a1f9ae140aa28df8744d984d01d4b3af7cdd6555af12127f40ceb45a7d/nodejs_wheel_binaries-24.16.0-py2.py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:2f3036292811514ba847b3708492644764f88a833ac425c5f55007014308ddfd", size = 60716262, upload-time = "2026-05-30T16:51:50.711Z" },
|
|
66
|
+
{ url = "https://files.pythonhosted.org/packages/64/c9/7c35b3737f59e36d0249c265397b7bff570519b95301d6e16ea361e904ad/nodejs_wheel_binaries-24.16.0-py2.py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:db8a8a76ebd2b28ecbfc9ad464baa3707241b9e050a30e2efdf6f60c0f886502", size = 62230592, upload-time = "2026-05-30T16:51:55Z" },
|
|
67
|
+
{ url = "https://files.pythonhosted.org/packages/04/96/d931255cf9d11a84d6b54d882dba7434646467d568ccf070ea3418638df3/nodejs_wheel_binaries-24.16.0-py2.py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:f1a3d8f7b4491cbbd023ba3fc4e901fcca2d9fb80d57f24ba3890de8b1dbac03", size = 62841759, upload-time = "2026-05-30T16:51:59.407Z" },
|
|
68
|
+
{ url = "https://files.pythonhosted.org/packages/a2/7b/8b7a3f41bc255411be30b6d7d288aab8ffd9ea2055db8555ced3548007b9/nodejs_wheel_binaries-24.16.0-py2.py3-none-win_amd64.whl", hash = "sha256:bb136be9944f0662dcf1120f45193a6b75b13fac378971a95cc42c9f879a81aa", size = 42027734, upload-time = "2026-05-30T16:52:03.348Z" },
|
|
69
|
+
{ url = "https://files.pythonhosted.org/packages/17/66/1ed71f1f529b8ca727d42c7ceb9db0bef145ce4a13dfc86fb50aa44f3be6/nodejs_wheel_binaries-24.16.0-py2.py3-none-win_arm64.whl", hash = "sha256:8308940b5edd0a50dc5267ea36ba21c9f668e83fe0d9f293937174d3a7e31c36", size = 39714528, upload-time = "2026-05-30T16:52:06.421Z" },
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
[[package]]
|
|
73
|
+
name = "packaging"
|
|
74
|
+
version = "26.2"
|
|
75
|
+
source = { registry = "https://pypi.org/simple" }
|
|
76
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" }
|
|
77
|
+
wheels = [
|
|
78
|
+
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
[[package]]
|
|
82
|
+
name = "pluggy"
|
|
83
|
+
version = "1.6.0"
|
|
84
|
+
source = { registry = "https://pypi.org/simple" }
|
|
85
|
+
sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
|
|
86
|
+
wheels = [
|
|
87
|
+
{ url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
[[package]]
|
|
91
|
+
name = "pygments"
|
|
92
|
+
version = "2.20.0"
|
|
93
|
+
source = { registry = "https://pypi.org/simple" }
|
|
94
|
+
sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" }
|
|
95
|
+
wheels = [
|
|
96
|
+
{ url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" },
|
|
97
|
+
]
|
|
98
|
+
|
|
99
|
+
[[package]]
|
|
100
|
+
name = "pytest"
|
|
101
|
+
version = "9.1.1"
|
|
102
|
+
source = { registry = "https://pypi.org/simple" }
|
|
103
|
+
dependencies = [
|
|
104
|
+
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
|
105
|
+
{ name = "iniconfig" },
|
|
106
|
+
{ name = "packaging" },
|
|
107
|
+
{ name = "pluggy" },
|
|
108
|
+
{ name = "pygments" },
|
|
109
|
+
]
|
|
110
|
+
sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" }
|
|
111
|
+
wheels = [
|
|
112
|
+
{ url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" },
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[[package]]
|
|
116
|
+
name = "ruff"
|
|
117
|
+
version = "0.15.21"
|
|
118
|
+
source = { registry = "https://pypi.org/simple" }
|
|
119
|
+
sdist = { url = "https://files.pythonhosted.org/packages/0f/36/6f65aa9989acdec45d417192d8f4e7921931d8a6cf87ac74bce3eed98a8e/ruff-0.15.21.tar.gz", hash = "sha256:d0cfc841c572283c36548f82664a54ce6565567f1b0d5b4cf2caac693d8b7500", size = 4769401, upload-time = "2026-07-09T20:01:34.005Z" }
|
|
120
|
+
wheels = [
|
|
121
|
+
{ url = "https://files.pythonhosted.org/packages/d0/c6/ede15cac6839f3dbce52565c8f5164a8210e669c7bc4decb03e5bdf47d0d/ruff-0.15.21-py3-none-linux_armv6l.whl", hash = "sha256:63ea0e965e5d73c90e95b2434beeafc70820536717f561b32ab6e777cb9bdf5d", size = 10854342, upload-time = "2026-07-09T20:00:53.998Z" },
|
|
122
|
+
{ url = "https://files.pythonhosted.org/packages/28/9d/d825b07ee7ea9e2d61df92a860033c94e06e7300d50a1c2653aac27d24fe/ruff-0.15.21-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:0f212c5d7d54c01bbfe6dcab02b724a39300f3e34ed7acbe995ccb320a2c58bd", size = 11139539, upload-time = "2026-07-09T20:00:57.809Z" },
|
|
123
|
+
{ url = "https://files.pythonhosted.org/packages/f5/de/3b107712e642f063c7a9e0887c427b22cb44097de5aab36c05f2e280670c/ruff-0.15.21-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e6312e41bc96791299614995ea3a977c5857c3b5662b1ecef6755b02b87cb646", size = 10595437, upload-time = "2026-07-09T20:01:00.006Z" },
|
|
124
|
+
{ url = "https://files.pythonhosted.org/packages/9a/6f/b4523cc90ba239ede441447a19d0c968846a3012e5a0b0c5b62831a3d5e3/ruff-0.15.21-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:01d65b4831c6b2a4ba8ee6faa84049d44d982b7a706e622c4094c509e51673be", size = 10990053, upload-time = "2026-07-09T20:01:02.187Z" },
|
|
125
|
+
{ url = "https://files.pythonhosted.org/packages/92/cc/c6a9872a5375f0628875481cf2f66b13d7d865bf3ca2e57f91c7e762d976/ruff-0.15.21-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:2c5a913a589120ce67933d5d05fd6ddbcc2481c6a054980ee767f7414c72b4fd", size = 10666096, upload-time = "2026-07-09T20:01:04.299Z" },
|
|
126
|
+
{ url = "https://files.pythonhosted.org/packages/ab/97/c621f7a17e097f1790fa3af6374138823b330b2d03fc38337945daca212c/ruff-0.15.21-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5ef04b681d02ad4dc9620f00f83ac5c22f652d0e9a9cfe431d219b16ad5ccc41", size = 11537011, upload-time = "2026-07-09T20:01:06.771Z" },
|
|
127
|
+
{ url = "https://files.pythonhosted.org/packages/ea/51/d928727e476e25ccc57c6f449ffd80241a651a973ad949d39cfb2a771d28/ruff-0.15.21-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:16d090c0740916594157e75b80d666eab8e78083b39b3b0e1d698f4670a17b86", size = 12347101, upload-time = "2026-07-09T20:01:08.859Z" },
|
|
128
|
+
{ url = "https://files.pythonhosted.org/packages/1e/88/8cd62026802b16018ad06931d87997cf795ba2a6239ab659606c87d96bf0/ruff-0.15.21-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3a10e74757dd65004d779b73e2f3c5210156d9980b41224d50d2ebcf1db51e67", size = 11572001, upload-time = "2026-07-09T20:01:11.092Z" },
|
|
129
|
+
{ url = "https://files.pythonhosted.org/packages/b2/97/f63084cf55444fc110e8cb985ebfcc592af47f597d44453d778cb81bc156/ruff-0.15.21-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bab0905d2f29e0d9fbc3c373ed23db0095edaa3f71f1f4f519ec15134d9e85c8", size = 11549239, upload-time = "2026-07-09T20:01:13.27Z" },
|
|
130
|
+
{ url = "https://files.pythonhosted.org/packages/9d/77/f107da4a2874b7715914b03f09ba9c54424de3ff8a1cc5d015d3ee2ce0ac/ruff-0.15.21-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:00eca240af5789fec6fe7df74c088cc1f9644ed83027113468efba7c92b94075", size = 11535340, upload-time = "2026-07-09T20:01:15.206Z" },
|
|
131
|
+
{ url = "https://files.pythonhosted.org/packages/d5/e9/601deb322d3303a7bf212b0100ead6f2ee3f6a044d89c30f2f92bf83c731/ruff-0.15.21-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:262ab31557a75141325e32d3357f3597645a7f084e732b6b054dde428ecd9341", size = 10964048, upload-time = "2026-07-09T20:01:17.723Z" },
|
|
132
|
+
{ url = "https://files.pythonhosted.org/packages/ea/2e/0f2176d1e99c15192caea19c8c3a0a955246b4cb4de795042eeb616345cd/ruff-0.15.21-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:659c4e7a4212f83306045ec7c5e5a356d16d9a6ef4ae0c7a4d872914fc655d9d", size = 10667055, upload-time = "2026-07-09T20:01:19.73Z" },
|
|
133
|
+
{ url = "https://files.pythonhosted.org/packages/48/60/abd74a02e0c4214f12a68becfd30af7165cfdcb0e661ecdc60bbb949c09a/ruff-0.15.21-py3-none-musllinux_1_2_i686.whl", hash = "sha256:9e866eab611a5f959d36df2d10e446973a3610bc42b0c15b31dc27977d59c233", size = 11242043, upload-time = "2026-07-09T20:01:21.947Z" },
|
|
134
|
+
{ url = "https://files.pythonhosted.org/packages/b2/c6/583075d8ccabb4b229345edcaf1545eb3d8d6be90f686a479d7e94088bbf/ruff-0.15.21-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:e89bc93c0d3803ba870b55c29671bad9dc6d94bb1eb181b056b52eb05b52854f", size = 11648064, upload-time = "2026-07-09T20:01:24.023Z" },
|
|
135
|
+
{ url = "https://files.pythonhosted.org/packages/3a/3c/37d0ecb729a7cc2d393ea7dce316fc585680f35d93b8d62139d7d0a3700c/ruff-0.15.21-py3-none-win32.whl", hash = "sha256:01f8d5be84823c172b389e123174f781f9daf86d6c58719d603f941932195cdd", size = 10896555, upload-time = "2026-07-09T20:01:26.941Z" },
|
|
136
|
+
{ url = "https://files.pythonhosted.org/packages/c0/b8/e43466b2a6067ce91e669068f6e28d6c719a920f014b070d5c8731725de3/ruff-0.15.21-py3-none-win_amd64.whl", hash = "sha256:d4b8d9a2f0f12b816b50447f6eccb9f4bb01a6b82c86b50fb3b5354b458dc6d3", size = 12038772, upload-time = "2026-07-09T20:01:29.497Z" },
|
|
137
|
+
{ url = "https://files.pythonhosted.org/packages/dd/75/e90ab9aeece218a9fc5a5bc3ec97d0ee6bb3c4ff95869463c1de58e29a1c/ruff-0.15.21-py3-none-win_arm64.whl", hash = "sha256:6e83115d4b9377c1cbc13abf0e051f069fab0ef815ea0504a8a008cee24dd0a8", size = 11375265, upload-time = "2026-07-09T20:01:31.772Z" },
|
|
138
|
+
]
|