Skip to content

Commit 1d6b9db

Browse files
authored
Merge branch 'staging' into hpp1
2 parents 3d17182 + 0e55d3a commit 1d6b9db

File tree

88 files changed

+4698
-2204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+4698
-2204
lines changed

.github/workflows/docker_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
steps:
2020
- name: Check out code
21-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2222

2323
- name: Install cosign
2424
uses: sigstore/cosign-installer@v3
@@ -48,4 +48,4 @@ jobs:
4848
DIGEST: ${{ steps.build.outputs.digest }}
4949
TAGS: ${{ steps.build.outputs.tags }}
5050
run: |
51-
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
51+
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
branches: [master, development, staging]
1313
types: [ opened, synchronize, reopened, ready_for_review ]
1414

15+
schedule:
16+
- cron: '0 9 * * *' # Run every night at 2:00 PST
17+
1518
workflow_dispatch:
1619
inputs:
1720
verbose:
@@ -107,7 +110,7 @@ jobs:
107110
- name: Run tests with retry
108111
run: |
109112
set +e
110-
for i in 1 2; do
113+
for i in 1 2 3; do
111114
echo "🔁 Attempt $i: Running tests"
112115
uv run pytest ${{ matrix.test-file }} -s
113116
status=$?
@@ -116,8 +119,8 @@ jobs:
116119
break
117120
else
118121
echo "❌ Tests failed on attempt $i"
119-
if [ $i -eq 2 ]; then
120-
echo "Tests failed after 2 attempts"
122+
if [ $i -eq 3 ]; then
123+
echo "Tests failed after 3 attempts"
121124
exit 1
122125
fi
123126
echo "Retrying..."
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This workflow measures the disk size of a virtual environment
2+
# after installing the Bittensor SDK across multiple Python versions.
3+
# It runs only when a new pull request targets the master branch,
4+
# and posts a comment with the results.
5+
name: Monitor SDK Requirements Size
6+
7+
on:
8+
pull_request:
9+
types: [opened]
10+
branches: [master]
11+
12+
permissions:
13+
pull-requests: write
14+
contents: read
15+
16+
jobs:
17+
measure-venv:
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
22+
outputs:
23+
py39: ${{ steps.set-output.outputs.py39 }}
24+
py310: ${{ steps.set-output.outputs.py310 }}
25+
py311: ${{ steps.set-output.outputs.py311 }}
26+
py312: ${{ steps.set-output.outputs.py312 }}
27+
py313: ${{ steps.set-output.outputs.py313 }}
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
35+
- name: Create virtualenv and install
36+
run: |
37+
python -m venv venv
38+
source venv/bin/activate
39+
pip install --upgrade pip
40+
pip install .
41+
42+
- name: Measure venv size
43+
id: set-output
44+
run: |
45+
SIZE=$(du -sm venv | cut -f1)
46+
VERSION=${{ matrix.python-version }}
47+
echo "Detected size: $SIZE MB for Python $VERSION"
48+
case "$VERSION" in
49+
3.9) echo "py39=$SIZE" >> $GITHUB_OUTPUT ;;
50+
3.10) echo "py310=$SIZE" >> $GITHUB_OUTPUT ;;
51+
3.11) echo "py311=$SIZE" >> $GITHUB_OUTPUT ;;
52+
3.12) echo "py312=$SIZE" >> $GITHUB_OUTPUT ;;
53+
3.13) echo "py313=$SIZE" >> $GITHUB_OUTPUT ;;
54+
esac
55+
56+
comment-on-pr:
57+
if: github.event_name == 'pull_request' && github.base_ref == 'master'
58+
needs: measure-venv
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Post venv size summary to PR
62+
uses: actions/github-script@v7
63+
with:
64+
github-token: ${{ secrets.GITHUB_TOKEN }}
65+
script: |
66+
const sizes = {
67+
"3.9": "${{ needs.measure-venv.outputs.py39 || 'N/A' }}",
68+
"3.10": "${{ needs.measure-venv.outputs.py310 || 'N/A' }}",
69+
"3.11": "${{ needs.measure-venv.outputs.py311 || 'N/A' }}",
70+
"3.12": "${{ needs.measure-venv.outputs.py312 || 'N/A' }}",
71+
"3.13": "${{ needs.measure-venv.outputs.py313 || 'N/A' }}",
72+
};
73+
74+
const body = [
75+
'**Bittensor SDK virtual environment sizes by Python version:**',
76+
'',
77+
'```'
78+
]
79+
.concat(Object.entries(sizes).map(([v, s]) => `Python ${v}: ${s} MB`))
80+
.concat(['```'])
81+
.join('\n');
82+
83+
github.rest.issues.createComment({
84+
issue_number: context.issue.number,
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
body
88+
});

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
name: Build Python distribution
1414
runs-on: ubuntu-latest
1515
steps:
16-
- uses: actions/checkout@v3
16+
- uses: actions/checkout@v4
1717

1818
- name: Set up Python
1919
uses: actions/setup-python@v4
@@ -69,4 +69,4 @@ jobs:
6969
uses: pypa/gh-action-pypi-publish@release/v1
7070
with:
7171
verbose: true
72-
print-hash: true
72+
print-hash: true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,18 +239,18 @@ pytest tests/unit_tests
239239
- are executed very quickly
240240
- require docker installed in OS
241241

242-
Ho to use:
242+
How to use:
243243
```bash
244244
pytest tests/e2e_tests
245245
```
246246

247-
#### TUsing `legacy runner`:
247+
#### Using `legacy runner`:
248248
- Will start compilation of the collected code in your subtensor repository
249249
- you must provide the `LOCALNET_SH_PATH` variable in the local environment with the path to the file `/scripts/localnet.sh` in the cloned repository within your OS
250250
- you can use the `BUILD_BINARY=0` variable, this will skip the copy step for each test.
251251
- you can use the `USE_DOCKER=0` variable, this will run tests using the "legacy runner", even if docker is installed in your OS
252252

253-
#### Ho to use:
253+
#### How to use:
254254
Regular e2e tests run
255255
```bash
256256
LOCALNET_SH_PATH=/path/to/your/localnet.sh pytest tests/e2e_tests

0 commit comments

Comments
 (0)