Skip to content

Commit 53c2f12

Browse files
authored
Merge branch 'staging' into feat/roman/add-pr-merge-checkers
2 parents 212b41f + a38ff17 commit 53c2f12

File tree

6 files changed

+48
-17
lines changed

6 files changed

+48
-17
lines changed

.github/workflows/check-rust.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cargo-fmt:
2525
name: cargo fmt
2626
runs-on: SubtensorCI
27-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
27+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
2828
env:
2929
RUST_BACKTRACE: full
3030
steps:
@@ -48,7 +48,7 @@ jobs:
4848
cargo-clippy-default-features:
4949
name: cargo clippy
5050
runs-on: SubtensorCI
51-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
51+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
5252
env:
5353
RUST_BACKTRACE: full
5454
SKIP_WASM_BUILD: 1
@@ -70,7 +70,7 @@ jobs:
7070
cargo-check-lints:
7171
name: check custom lints
7272
runs-on: SubtensorCI
73-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
73+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
7474
env:
7575
RUSTFLAGS: -D warnings
7676
RUST_BACKTRACE: full
@@ -93,10 +93,11 @@ jobs:
9393
cargo check 2>&1 | sed -r "s/\x1B\[[0-9;]*[mK]//g" | grep "warning:" && exit 1
9494
echo "No warnings found."
9595
96+
9697
cargo-clippy-all-features:
9798
name: cargo clippy --all-features
9899
runs-on: SubtensorCI
99-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
100+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
100101
env:
101102
RUST_BACKTRACE: full
102103
SKIP_WASM_BUILD: 1
@@ -119,7 +120,7 @@ jobs:
119120
cargo-test:
120121
name: cargo test
121122
runs-on: SubtensorCI
122-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
123+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
123124
env:
124125
RUST_BACKTRACE: full
125126
SKIP_WASM_BUILD: 1
@@ -142,7 +143,7 @@ jobs:
142143
cargo-fix:
143144
name: cargo fix
144145
runs-on: SubtensorCI
145-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
146+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
146147
env:
147148
RUST_BACKTRACE: full
148149
SKIP_WASM_BUILD: 1
@@ -174,7 +175,7 @@ jobs:
174175
check-feature-propagation:
175176
name: zepter run check
176177
runs-on: SubtensorCI
177-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-cargo-audit') }}
178+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-check-rust') }}
178179
steps:
179180
- name: Checkout
180181
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@ jobs:
3939
- uses: actions/checkout@v4
4040
- uses: actions/setup-python@v5
4141
with:
42-
python-version: 3.x
42+
python-version: "3.10"
43+
4344
- name: Build wheels
4445
uses: PyO3/maturin-action@v1.44.0
4546
with:
4647
target: ${{ matrix.platform.target }}
47-
args: --release --out dist --find-interpreter
48+
args: --release --out dist
4849
sccache: 'true'
4950
manylinux: auto
50-
before-script-linux: (apt-get update && apt-get install -y apt-utils && apt-get install -y pkg-config libssl-dev) || (yum install openssl openssl-devel -y)
51+
before-script-linux: (apt-get update && apt-get install -y apt-utils && apt-get install -y pkg-config libssl-dev) || (yum install openssl openssl-devel -y)
52+
5153
- name: Upload wheels
5254
uses: actions/upload-artifact@v4
5355
with:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dev = [
7171
"ruff==0.4.7",
7272
"aioresponses==0.7.6",
7373
"factory-boy==3.3.0",
74-
"maturin==1.7.0",
74+
"maturin==1.8.3",
7575
"py-bip39-bindings==0.1.11",
7676
"ansible_vault~=2.1",
7777
"bittensor>=9.0.1",

src/python_bindings.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ except argparse.ArgumentError:
11011101
}
11021102

11031103
#[pyo3(
1104-
signature = (uri, use_password=None, overwrite=None, suppress=None, save_coldkey_to_env=None, coldkey_password=None)
1104+
signature = (uri, use_password=false, overwrite=false, suppress=true, save_coldkey_to_env=false, coldkey_password=None)
11051105
)]
11061106
fn create_coldkey_from_uri(
11071107
&mut self,
@@ -1131,7 +1131,7 @@ except argparse.ArgumentError:
11311131
}
11321132

11331133
#[pyo3(
1134-
signature = (uri, use_password=None, overwrite=None, suppress=None, save_hotkey_to_env=None, hotkey_password=None)
1134+
signature = (uri, use_password=false, overwrite=false, suppress=true, save_hotkey_to_env=false, hotkey_password=None)
11351135
)]
11361136
fn create_hotkey_from_uri(
11371137
&mut self,

src/wallet.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,6 @@ impl Wallet {
463463
if !suppress {
464464
if let Some(m) = keypair.mnemonic() {
465465
display_mnemonic_msg(m, "coldkey");
466-
} else {
467-
return Err(KeyFileError::Generic("Failed to get mnemonic".to_string()));
468466
}
469467
}
470468

@@ -495,8 +493,6 @@ impl Wallet {
495493
if !suppress {
496494
if let Some(m) = keypair.mnemonic() {
497495
display_mnemonic_msg(m, "hotkey");
498-
} else {
499-
return Err(KeyFileError::Generic("Failed to get mnemonic".to_string()));
500496
}
501497
}
502498

tests/test_wallet.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,35 @@ def test_wallet_string_representation_with_custom_arguments():
195195
assert w.name == wallet_name
196196
assert w.hotkey_str == wallet_hotkey
197197
assert w.path == wallet_path
198+
199+
200+
def test_create_coldkey_from_uri():
201+
"""Tests create_coldkey_from_uri method."""
202+
# Preps
203+
wallet_name = "test_wallet"
204+
wallet_hotkey = "test_hotkey"
205+
wallet_path = "/tmp/tests_wallets/"
206+
207+
# Call
208+
w = Wallet(name=wallet_name, hotkey=wallet_hotkey, path=wallet_path)
209+
w.create_coldkey_from_uri("//test", use_password=False, overwrite=True)
210+
211+
# Asserts
212+
assert w.coldkey.ss58_address is not None
213+
assert w.coldkeypub.ss58_address is not None
214+
215+
216+
def test_hotkey_coldkey_from_uri():
217+
"""Tests create_coldkey_from_uri method."""
218+
# Preps
219+
wallet_name = "test_wallet"
220+
wallet_hotkey = "test_hotkey"
221+
wallet_path = "/tmp/tests_wallets/"
222+
223+
# Call
224+
w = Wallet(name=wallet_name, hotkey=wallet_hotkey, path=wallet_path)
225+
w.create_hotkey_from_uri("//test", use_password=False, overwrite=True)
226+
227+
# Asserts
228+
assert w.coldkey.ss58_address is not None
229+
assert w.coldkeypub.ss58_address is not None

0 commit comments

Comments
 (0)