Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/supported-python-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
["3.10", "3.11", "3.12", "3.13", "3.14"]

8 changes: 6 additions & 2 deletions .github/workflows/_run-e2e-single.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
image-name:
required: true
type: string
python-versions:
required: true
type: string
description: JSON array of Python versions

jobs:
run-e2e:
Expand All @@ -19,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
python-version: ${{ fromJson(inputs.python-versions) }}

steps:
- name: Check-out repository
Expand Down Expand Up @@ -80,4 +84,4 @@ jobs:

done
echo "Tests failed after 3 attempts"
exit 1
exit 1
14 changes: 13 additions & 1 deletion .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@ on:
- "pyproject.toml"

jobs:
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT

compatibility:
needs: read-python-versions
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}

steps:
- uses: actions/checkout@v4
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ jobs:
echo "Found tests: $test_matrix"
echo "test-files=$test_matrix" >> "$GITHUB_OUTPUT"

# Read Python versions
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT

# Pull docker image
pull-docker-image:
runs-on: ubuntu-latest
Expand All @@ -82,16 +94,16 @@ jobs:
run: |
echo "Event: $GITHUB_EVENT_NAME"
echo "Branch: $GITHUB_REF_NAME"

echo "Reading labels ..."
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then
labels=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH")
else
labels=""
fi

image=""

for label in $labels; do
echo "Found label: $label"
case "$label" in
Expand Down Expand Up @@ -147,6 +159,7 @@ jobs:
needs:
- find-tests
- pull-docker-image
- read-python-versions
strategy:
fail-fast: false
max-parallel: 16
Expand All @@ -156,4 +169,5 @@ jobs:
with:
nodeid: ${{ matrix.nodeid }}
image-name: ${{ needs.pull-docker-image.outputs.image-name }}
python-versions: ${{ needs.read-python-versions.outputs.python-versions }}
secrets: inherit
16 changes: 14 additions & 2 deletions .github/workflows/flake8-and-mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ on:
types: [opened, synchronize, reopened, edited]

jobs:
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT

linters:
needs: read-python-versions
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -47,4 +59,4 @@ jobs:
run: uv run flake8 bittensor/ --count

- name: Mypy
run: uv run mypy --ignore-missing-imports bittensor/
run: uv run mypy --ignore-missing-imports bittensor/
14 changes: 13 additions & 1 deletion .github/workflows/monitor_requirements_size_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,24 @@ permissions:
contents: read

jobs:
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT

measure-venv:
needs: read-python-versions
if: github.event_name == 'pull_request' && github.base_ref == 'master' || contains( github.event.pull_request.labels.*.name, 'show-venv-size')
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}
outputs:
py310: ${{ steps.set-output.outputs.py310 }}
py311: ${{ steps.set-output.outputs.py311 }}
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/unit-and-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,27 @@ on:
types: [opened, synchronize, reopened, edited]

jobs:
read-python-versions:
runs-on: ubuntu-latest
outputs:
python-versions: ${{ steps.read-versions.outputs.versions }}
steps:
- uses: actions/checkout@v4
- id: read-versions
run: |
versions=$(cat .github/supported-python-versions.json)
echo "versions=$versions" >> $GITHUB_OUTPUT

unit-and-integration-tests:
needs: read-python-versions
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 5
matrix:
python-version: ${{ fromJson(vars.SDK_SUPPORTED_PYTHON_VERSIONS) }}
python-version: ${{ fromJson(needs.read-python-versions.outputs.python-versions) }}

steps:
- name: Checkout repository
Expand Down Expand Up @@ -56,4 +68,4 @@ jobs:
env:
PYTHONUNBUFFERED: "1"
run: |
uv run pytest -n 2 tests/integration_tests/ --reruns 3
uv run pytest -n 2 tests/integration_tests/ --reruns 3
Loading