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.1.2 #2173

Closed
wants to merge 4 commits into from
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
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.1
7.1.2
2 changes: 1 addition & 1 deletion bittensor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
nest_asyncio.apply()

# Bittensor code and protocol version.
__version__ = "7.1.1"
__version__ = "7.1.2"

version_split = __version__.split(".")
__version_as_int__: int = (
Expand Down
22 changes: 4 additions & 18 deletions bittensor/subtensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
The ``bittensor.subtensor`` module in Bittensor serves as a crucial interface for interacting with the Bittensor
blockchain, facilitating a range of operations essential for the decentralized machine learning network.
"""

import argparse
import copy
import functools
import socket
import time
from typing import List, Dict, Union, Optional, Tuple, TypedDict, Any, TypeVar
Expand Down Expand Up @@ -111,19 +111,6 @@

T = TypeVar("T")

#######
# Monkey patch in caching the convert_type_string method
#######
if hasattr(RuntimeConfiguration, "convert_type_string"):
original_convert_type_string = RuntimeConfiguration.convert_type_string

@functools.lru_cache(maxsize=None)
def convert_type_string(cls, name):
return original_convert_type_string(name)

RuntimeConfiguration.convert_type_string = convert_type_string
#######


class ParamWithTypes(TypedDict):
name: str # Name of the parameter.
Expand Down Expand Up @@ -3099,9 +3086,7 @@ def query_runtime_api(
"""
call_definition = bittensor.__type_registry__["runtime_api"][runtime_api][ # type: ignore
"methods" # type: ignore
][
method
] # type: ignore
][method] # type: ignore

json_result = self.state_call(
method=f"{runtime_api}_{method}",
Expand Down Expand Up @@ -4489,7 +4474,8 @@ def make_substrate_call_with_retry():
if block_hash:
params = params + [block_hash]
return self.substrate.rpc_request(
method="neuronInfo_getNeuron", params=params # custom rpc method
method="neuronInfo_getNeuron",
params=params, # custom rpc method
)

json_body = make_substrate_call_with_retry()
Expand Down
6 changes: 3 additions & 3 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ pytest
retry
requests
rich
scalecodec==1.2.7 # scalecodec should not be changed unless first verifying compatibility with the subtensor's monkeypatching of scalecodec.RuntimeConfiguration.get_decoder_class
shtab==1.6.5
substrate-interface==1.7.5
scalecodec==1.2.11
shtab~=1.6.5
substrate-interface~=1.7.9
termcolor
tqdm
uvicorn==0.22.0
Expand Down
4 changes: 2 additions & 2 deletions scripts/environments/apple_m1_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ dependencies:
- retry==0.9.2
- rich==12.5.1
- rsa==4.9
- scalecodec==1.2.7 # scalecodec should not be changed unless first verifying compatibility with the subtensor's monkeypatching of scalecodec.RuntimeConfiguration.get_decoder_class
- scalecodec==1.2.11
- scikit-learn==1.2.2
- scipy==1.10.1
- sentencepiece==0.1.99
Expand All @@ -243,7 +243,7 @@ dependencies:
- sqlalchemy==2.0.19
- starlette==0.37.2
- streamlit==1.22.0
- substrate-interface==1.5.2
- substrate-interface==1.7.9
- tenacity==8.2.2
- termcolor==2.1.1
- threadpoolctl==3.1.0
Expand Down
Loading