Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/7.3.0 #2122

Merged
merged 17 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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
26 changes: 26 additions & 0 deletions .circleci/check_pr_status.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Extract the repository owner
REPO_OWNER=$(echo $CIRCLE_PULL_REQUEST | awk -F'/' '{print $(NF-3)}')

# Extract the repository name
REPO_NAME=$(echo $CIRCLE_PULL_REQUEST | awk -F'/' '{print $(NF-2)}')

# Extract the pull request number
PR_NUMBER=$(echo $CIRCLE_PULL_REQUEST | awk -F'/' '{print $NF}')


PR_DETAILS=$(curl -s \
"https://github.com/gitapi/repos/$REPO_OWNER/$REPO_NAME/pulls/$PR_NUMBER")


IS_DRAFT=$(echo "$PR_DETAILS" | jq -r .draft)
echo $IS_DRAFT

if [ "$IS_DRAFT" == "true" ]; then
echo "This PR is a draft. Skipping the workflow."
exit 1
else
echo "This PR is not a draft. Proceeding with the workflow."
exit 0
fi
23 changes: 20 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,20 @@ version: 2.1
orbs:
python: circleci/python@2.1.1
python-lib: dialogue/python-lib@0.1.55
# coveralls: coveralls/coveralls@1.0.6

jobs:
check-if-pr-is-draft:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Install jq
command: sudo apt-get update && sudo apt-get install -y jq
- run:
name: Check if PR is a draft
command: .circleci/check_pr_status.sh

ruff:
resource_class: small
parameters:
Expand Down Expand Up @@ -137,6 +148,7 @@ jobs:
- store_artifacts:
path: test-results


#- when:
#condition:
#equal: ["3.10.5", << parameters.python-version >> ]
Expand All @@ -153,6 +165,7 @@ jobs:
#CI_JOB_ID: $CIRCLE_NODE_INDEX
#COVERALLS_PARALLEL: true


lint-and-type-check:
resource_class: medium
parallelism: 2
Expand Down Expand Up @@ -275,7 +288,6 @@ jobs:
command: |
./scripts/release/release.sh --github-token ${GH_API_ACCESS_TOKEN}


workflows:
compatibility_checks:
jobs:
Expand All @@ -291,12 +303,17 @@ workflows:

pr-requirements:
jobs:
- check-if-pr-is-draft
- ruff:
python-version: "3.9.13"
requires:
- check-if-pr-is-draft
- build-and-test:
matrix:
parameters:
python-version: ["3.9.13", "3.10.6", "3.11.4"]
requires:
- check-if-pr-is-draft
- unit-tests-all-python-versions:
requires:
- build-and-test
Expand All @@ -305,7 +322,7 @@ workflows:
parameters:
python-version: ["3.9.13", "3.10.6", "3.11.4"]
requires:
- build-and-test
- check-if-pr-is-draft
#- coveralls:
#requires:
#- build-and-test
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/e2e-subtensor-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@ concurrency:
cancel-in-progress: true

on:
## Run automatically for all PRs against main, regardless of what the changes are
## to be safe and so we can more easily force re-run the CI when github is being
## weird by using a blank commit
push:
branches: [main, development, staging]

##
# Run automatically for PRs against default/main branch if Rust files change
pull_request:
branches: [main, development, staging]
types: [ opened, synchronize, reopened, ready_for_review ]

## Allow running workflow manually from the Actions tab
workflow_dispatch:
inputs:
verbose:
Expand All @@ -26,24 +21,42 @@ on:

env:
CARGO_TERM_COLOR: always
VERBOSE: ${{ github.events.input.verbose }}
VERBOSE: ${{ github.event.inputs.verbose }}

# job to run tests in parallel
jobs:
# Job to find all test files
find-tests:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
outputs:
test-files: ${{ steps.get-tests.outputs.test-files }}
steps:
- name: Check-out repository under $GITHUB_WORKSPACE
uses: actions/checkout@v2

- name: Find test files
id: get-tests
run: |
test_files=$(find tests/e2e_tests -name "test*.py" | jq -R -s -c 'split("\n") | map(select(. != ""))')
echo "::set-output name=test-files::$test_files"
shell: bash

# Job to run tests in parallel
run:
needs: find-tests
runs-on: SubtensorCI
strategy:
fail-fast: false # Allow other matrix jobs to run even if this job fails
max-parallel: 8 # Set the maximum number of parallel jobs
matrix:
rust-branch:
- nightly-2024-03-05
rust-target:
- x86_64-unknown-linux-gnu
# - x86_64-apple-darwin
os:
- ubuntu-latest
# - macos-latest
include:
- os: ubuntu-latest
# - os: macos-latest
test-file: ${{ fromJson(needs.find-tests.outputs.test-files) }}
env:
RELEASE_NAME: development
RUSTV: ${{ matrix.rust-branch }}
Expand Down Expand Up @@ -81,4 +94,11 @@ jobs:
- name: Run tests
run: |
python3 -m pip install -e .[dev] pytest
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest tests/e2e_tests/ -s
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest ${{ matrix.test-file }} -s

- name: Retry failed tests
if: failure()
run: |
sleep 10
python3 -m pip install -e .[dev] pytest
LOCALNET_SH_PATH="${{ github.workspace }}/subtensor/scripts/localnet.sh" pytest ${{ matrix.test-file }} -s
72 changes: 72 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build and Publish Python Package

on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
type: string

jobs:
build:
name: Build Python distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel twine

- name: Build package
run: python setup.py sdist bdist_wheel

- name: Check if package version already exists
run: |
PACKAGE_NAME=$(python setup.py --name)
PACKAGE_VERSION=${{ github.event.inputs.version }}
if twine check dist/*; then
if pip install $PACKAGE_NAME==$PACKAGE_VERSION; then
echo "Error: Version $PACKAGE_VERSION of $PACKAGE_NAME already exists on PyPI"
exit 1
else
echo "Version $PACKAGE_VERSION of $PACKAGE_NAME does not exist on PyPI. Proceeding with upload."
fi
else
echo "Error: Twine check failed."
exit 1
fi

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/

approve-and-publish:
needs: build
runs-on: ubuntu-latest
environment: release
permissions:
contents: read
id-token: write

steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
print-hash: true
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 7.3.0 / 2024-07-12

## What's Changed
* Liquid Alpha by @opendansor & @gus-opentensor in https://github.com/opentensor/bittensor/pull/2012
* check_coldkey_swap by @ibraheem-opentensor in https://github.com/opentensor/bittensor/pull/2126

**Full Changelog**: https://github.com/opentensor/bittensor/compare/v7.2.0...v7.3.0


## 7.2.0 / 2024-06-12

## What's Changed
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.2.0
7.3.0
33 changes: 32 additions & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@


# Bittensor code and protocol version.
__version__ = "7.2.0"
__version__ = "7.3.0"

_version_split = __version__.split(".")
__version_info__ = tuple(int(part) for part in _version_split)
Expand Down Expand Up @@ -229,6 +229,37 @@ def debug(on: bool = True):
"SubnetRegistrationRuntimeApi": {
"methods": {"get_network_registration_cost": {"params": [], "type": "u64"}}
},
"ColdkeySwapRuntimeApi": {
"methods": {
"get_scheduled_coldkey_swap": {
"params": [
{
"name": "coldkey_account_vec",
"type": "Vec<u8>",
},
],
"type": "Vec<u8>",
},
"get_remaining_arbitration_period": {
"params": [
{
"name": "coldkey_account_vec",
"type": "Vec<u8>",
},
],
"type": "Vec<u8>",
},
"get_coldkey_swap_destinations": {
"params": [
{
"name": "coldkey_account_vec",
"type": "Vec<u8>",
},
],
"type": "Vec<u8>",
},
}
},
},
}

Expand Down
Loading