Skip to content

Commit 4a6f8d6

Browse files
committed
Update README to use BCR
1 parent 0dd4154 commit 4a6f8d6

File tree

2 files changed

+7
-28
lines changed

2 files changed

+7
-28
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,8 @@ for the `ruff` executable.
99
```bzl
1010
bazel_dep(
1111
name = "ruff_prebuilt",
12+
version = "0.14.1.3",
1213
dev_dependency = True,
1314
repo_name = "ruff",
1415
)
15-
archive_override(
16-
module_name = "ruff_prebuilt",
17-
integrity = "sha256-kcMC2H4YXB4D3z0hWkuCD0J+q1PSskKbVDLJtK07UJ0=",
18-
strip_prefix = "ruff_prebuilt-0.14.1.3",
19-
url = "https://github.com/RobotLocomotion/ruff_prebuilt/releases/download/0.14.1.3/ruff_prebuilt-0.14.1.3.tar.gz",
20-
)
2116
```

workflows/release.py

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"""Automates the release process."""
33

44
import argparse
5-
import base64
6-
import hashlib
75
import json
86
from pathlib import Path
97
import re
@@ -64,8 +62,8 @@ def _reset_module_version() -> None:
6462
_set_module_version(module_version="0.0.0.0")
6563

6664

67-
def _make_source_tarball(*, module_version) -> str:
68-
"""Creates a source tarball on disk, and returns its `integrity` value."""
65+
def _make_source_tarball(*, module_version) -> None:
66+
"""Creates a source tarball on disk."""
6967
# Create the archive.
7068
subprocess.check_call(
7169
[
@@ -93,35 +91,21 @@ def _make_source_tarball(*, module_version) -> str:
9391
buried_output_path = _source_tree() / Path(output_path_str.strip())
9492
output_path = _source_tree() / buried_output_path.name
9593
shutil.copyfile(buried_output_path, output_path)
96-
# Compute its checksum.
97-
hasher = hashlib.sha256()
98-
hasher.update(output_path.read_bytes())
99-
digest = base64.b64encode(hasher.digest()).decode("utf-8")
100-
return f"sha256-{digest}"
10194

10295

103-
def _update_readme_example(*, module_version, integrity) -> None:
96+
def _update_readme_example(*, module_version) -> None:
10497
"""Updates README.md stanze for example downstream use."""
10598
path = _readme_path()
10699
lines = path.read_text(encoding="utf-8").splitlines()
107100

108-
# Replace `integrity`.
109-
num_matches = 0
110-
for i, line in enumerate(lines):
111-
if line.startswith(" integrity = "):
112-
num_matches += 1
113-
new_line = f' integrity = "{integrity}",'
114-
lines[i] = new_line
115-
assert num_matches == 1, num_matches
116-
117101
# Replace raw version numbers.
118102
num_matches = 0
119103
for i, line in enumerate(lines):
120104
new_line = re.sub(r"(\d+\.\d+\.\d+.\d+)", module_version, line)
121105
if new_line != line:
122106
num_matches += 1
123107
lines[i] = new_line
124-
assert num_matches == 2, num_matches
108+
assert num_matches == 1, num_matches
125109

126110
# Write back to the file.
127111
new_content = "\n".join(lines) + "\n"
@@ -147,8 +131,8 @@ def main():
147131
)
148132
_ = parser.parse_args()
149133
module_version = _sync_module_version()
150-
integrity = _make_source_tarball(module_version=module_version)
151-
_update_readme_example(module_version=module_version, integrity=integrity)
134+
_make_source_tarball(module_version=module_version)
135+
_update_readme_example(module_version=module_version)
152136
_commit(message=f"Release {module_version}")
153137
_reset_module_version()
154138
_commit(message="Revert back to main branch version numbering")

0 commit comments

Comments
 (0)