Skip to content

Commit c2bbef9

Browse files
committed
Merge branch 'staging' into feat/thewhaleking/json-output
# Conflicts: # bittensor_cli/cli.py # bittensor_cli/src/commands/stake/add.py # bittensor_cli/src/commands/stake/remove.py
2 parents fb22b42 + e4651ad commit c2bbef9

20 files changed

+1339
-127
lines changed

.github/workflows/e2e-subtensor-tests.yml

Lines changed: 65 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,81 @@ env:
2424
VERBOSE: ${{ github.event.inputs.verbose }}
2525

2626
jobs:
27-
run-tests:
28-
runs-on: SubtensorCI
29-
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
30-
timeout-minutes: 180
31-
env:
32-
RELEASE_NAME: development
33-
RUSTV: stable
34-
RUST_BACKTRACE: full
35-
RUST_BIN_DIR: target/x86_64-unknown-linux-gnu
36-
TARGET: x86_64-unknown-linux-gnu
3727

28+
find-tests:
29+
runs-on: ubuntu-latest
30+
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
31+
outputs:
32+
test-files: ${{ steps.get-tests.outputs.test-files }}
3833
steps:
3934
- name: Check-out repository under $GITHUB_WORKSPACE
40-
uses: actions/checkout@v2
35+
uses: actions/checkout@v4
4136

42-
- name: Install dependencies
37+
- name: Find test files
38+
id: get-tests
4339
run: |
44-
sudo apt-get update &&
45-
sudo apt-get install -y clang curl libssl-dev llvm libudev-dev protobuf-compiler
40+
test_files=$(find tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
41+
echo "::set-output name=test-files::$test_files"
42+
shell: bash
43+
44+
pull-docker-image:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Log in to GitHub Container Registry
48+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
49+
50+
- name: Pull Docker Image
51+
run: docker pull ghcr.io/opentensor/subtensor-localnet:devnet-ready
52+
53+
- name: Save Docker Image to Cache
54+
run: docker save -o subtensor-localnet.tar ghcr.io/opentensor/subtensor-localnet:devnet-ready
4655

47-
- name: Install Rust ${{ env.RUSTV }}
48-
uses: actions-rs/[email protected]
56+
- name: Upload Docker Image as Artifact
57+
uses: actions/upload-artifact@v4
4958
with:
50-
toolchain: ${{ env.RUSTV }}
51-
components: rustfmt
52-
profile: minimal
59+
name: subtensor-localnet
60+
path: subtensor-localnet.tar
5361

54-
- name: Add wasm32-unknown-unknown target
55-
run: |
56-
rustup target add wasm32-unknown-unknown --toolchain stable-x86_64-unknown-linux-gnu
57-
rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
62+
run-e2e-tests:
63+
name: ${{ matrix.test-file }} / Python ${{ matrix.python-version }}
64+
needs:
65+
- find-tests
66+
- pull-docker-image
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 45
69+
strategy:
70+
fail-fast: false # Allow other matrix jobs to run even if this job fails
71+
max-parallel: 32 # Set the maximum number of parallel jobs (same as we have cores in SubtensorCI runner)
72+
matrix:
73+
os:
74+
- ubuntu-latest
75+
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
76+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
77+
steps:
78+
- name: Check-out repository
79+
uses: actions/checkout@v4
80+
81+
- name: Install uv
82+
uses: astral-sh/setup-uv@v4
83+
with:
84+
python-version: 3.13
5885

59-
- name: Clone subtensor repo
60-
run: git clone https://github.com/opentensor/subtensor.git
86+
- name: install dependencies
87+
run: |
88+
uv venv .venv
89+
source .venv/bin/activate
90+
uv pip install .[dev]
91+
uv pip install pytest
6192
62-
- name: Setup subtensor repo
63-
working-directory: ${{ github.workspace }}/subtensor
64-
run: git checkout testnet
93+
- name: Download Cached Docker Image
94+
uses: actions/download-artifact@v4
95+
with:
96+
name: subtensor-localnet
6597

66-
- name: Install Python dependencies
67-
run: python3 -m pip install -e . pytest
98+
- name: Load Docker Image
99+
run: docker load -i subtensor-localnet.tar
68100

69-
- name: Run all tests
101+
- name: Run tests
70102
run: |
71-
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest tests/e2e_tests -s
103+
source .venv/bin/activate
104+
uv run pytest ${{ matrix.test-file }} -s

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## 9.2.0 /2025-03-18
4+
5+
## What's Changed
6+
* Improve e2e tests' workflow by @roman-opentensor in https://github.com/opentensor/btcli/pull/393
7+
* Updates to E2E suubtensor tests to devnet ready by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/390
8+
* Allow Py 3.13 install by @thewhaleking in https://github.com/opentensor/btcli/pull/392
9+
* pip install readme by @thewhaleking in https://github.com/opentensor/btcli/pull/391
10+
* Feat/dynamic staking fee by @ibraheem-opentensor in https://github.com/opentensor/btcli/pull/389
11+
12+
**Full Changelog**: https://github.com/opentensor/btcli/compare/v9.1.4...v9.2.0
13+
314
## 9.1.4 /2025-03-13
415

516
## What's Changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,20 @@ Installation steps are described below. For a full documentation on how to use `
3939

4040
## Install on macOS and Linux
4141

42-
You can install `btcli` on your local machine directly from source. **Make sure you verify your installation after you install**:
42+
You can install `btcli` on your local machine directly from source, or from from PyPI. **Make sure you verify your installation after you install**:
43+
44+
45+
### Install from PyPI
46+
47+
Run
48+
```
49+
pip install -U bittensor-cli
50+
```
51+
52+
Alternatively, if you prefer to use [uv](https://pypi.org/project/uv/):
53+
```
54+
uv pip install bittensor-cli
55+
```
4356

4457
### Install from source
4558

@@ -69,6 +82,14 @@ cd btcli
6982
pip3 install .
7083
```
7184

85+
### Also install bittensor (SDK)
86+
87+
If you prefer to install the btcli alongside the bittensor SDK, you can do this in a single command with
88+
89+
```
90+
pip install -U bittensor[cli]
91+
```
92+
7293
---
7394

7495
## Install on Windows

0 commit comments

Comments
 (0)