Skip to content

Commit f5de391

Browse files
authored
Ban bandersnatch git dependency (#8136)
Changes: - **Ban bandersnatch crate git dep** - **Updated Mermaid with patch glueball/simple-mermaid#2 - **inherit workspace dep** - **Ban mermaid git dep** - **Script nits** --------- Signed-off-by: Oliver Tale-Yazdi <[email protected]>
1 parent 3b4c48e commit f5de391

File tree

8 files changed

+14
-21
lines changed

8 files changed

+14
-21
lines changed

.github/scripts/check-workspace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_members(workspace_dir, exclude):
6363
def get_crates(workspace_dir, exclude_crates) -> dict:
6464
crates = {}
6565

66-
for root, dirs, files in os.walk(workspace_dir):
66+
for root, _dirs, files in os.walk(workspace_dir):
6767
if "target" in root:
6868
continue
6969
for file in files:
@@ -125,7 +125,7 @@ def check_links(all_crates):
125125
links = []
126126
broken = []
127127

128-
for name, (path, manifest) in all_crates.items():
128+
for name, (_path, manifest) in all_crates.items():
129129
def check_deps(deps):
130130
for dep in deps:
131131
# Could be renamed:

.github/scripts/deny-git-deps.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
from cargo_workspace import Workspace, DependencyLocation
1313

14-
KNOWN_BAD_GIT_DEPS = {
15-
'simple-mermaid': ['xcm-docs'],
16-
# Fix in <https://github.com/paritytech/polkadot-sdk/issues/2922>
17-
'bandersnatch_vrfs': ['sp-core'],
14+
# Some crates are allowed to have git dependencies until we fix them.
15+
ALLOWED_GIT_DEPS = {
1816
'subwasmlib': ['polkadot-zombienet-sdk-tests'],
1917
}
2018

@@ -26,7 +24,7 @@ def check_dep(dep, used_by):
2624
if dep.location != DependencyLocation.GIT:
2725
return
2826

29-
if used_by in KNOWN_BAD_GIT_DEPS.get(dep.name, []):
27+
if used_by in ALLOWED_GIT_DEPS.get(dep.name, []):
3028
print(f'🤨 Ignoring git dependency {dep.name} in {used_by}')
3129
else:
3230
errors.append(f'🚫 Found git dependency {dep.name} in {used_by}')

.github/scripts/generate-prdoc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import os
1515
import re
1616
import sys
17-
import subprocess
1817
import toml
1918
import yaml
2019
import requests

Cargo.lock

Lines changed: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,6 +1238,7 @@ sha1 = { version = "0.10.6" }
12381238
sha2 = { version = "0.10.7", default-features = false }
12391239
sha3 = { version = "0.10.0", default-features = false }
12401240
shlex = { version = "1.3.0" }
1241+
simple-mermaid = { version = "0.1.1" }
12411242
slot-range-helper = { path = "polkadot/runtime/common/slot_range_helper", default-features = false }
12421243
slotmap = { version = "1.0" }
12431244
smallvec = { version = "1.11.0", default-features = false }

docs/sdk/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ scale-info = { workspace = true }
2929
# How we build docs in rust-docs
3030
docify = { workspace = true }
3131
serde_json = { workspace = true }
32-
simple-mermaid = "0.1.1"
32+
simple-mermaid = { workspace = true }
3333

3434
# Polkadot SDK deps, typically all should only be in scope such that we can link to their doc item.
3535
chain-spec-builder = { workspace = true, default-features = true }

polkadot/xcm/docs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pallet-message-queue = { workspace = true, default-features = true }
3030

3131
# For building docs
3232
docify = { workspace = true }
33-
simple-mermaid = { git = "https://github.com/kianenigma/simple-mermaid.git", branch = "main" }
33+
simple-mermaid = { workspace = true }
3434

3535
[dev-dependencies]
3636
test-log = { workspace = true }

substrate/primitives/runtime/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ sp-trie = { workspace = true }
3838
sp-weights = { workspace = true }
3939
tracing = { workspace = true, features = ["log"], default-features = false }
4040

41-
simple-mermaid = { version = "0.1.1", optional = true }
41+
simple-mermaid = { workspace = true, optional = true }
4242
tuplex = { version = "0.1.2", default-features = false }
4343

4444
[dev-dependencies]

0 commit comments

Comments
 (0)