From f977d5834eb23f413e04665bdb6b839585b0329e Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Mon, 2 Dec 2024 12:59:12 +0200 Subject: [PATCH 1/6] Change to pyproject.toml --- pyproject.toml | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..e82f3df205 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,93 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "bittensor" +version = "0.1.0" +description = "Bittensor" +readme = "README.md" +authors = [ + {email = "", name = "bittensor.com"} +] +license = "MIT" +requires-python = ">=3.9,<3.13" +dependencies = [ + "wheel", + "setuptools~=70.0.0", + "aiohttp~=3.9", + "async-property==0.2.2", + "bittensor-cli", + "bt-decode==0.2.0a0", + "colorama~=0.4.6", + "fastapi~=0.110.1", + "munch~=2.5.0", + "numpy~=2.0.1", + "msgpack-numpy-opentensor~=0.5.0", + "nest_asyncio", + "netaddr", + "packaging", + "python-statemachine~=2.1", + "pycryptodome>=3.18.0,<4.0.0", + "pyyaml", + "retry", + "requests", + "rich", + "pydantic>=2.3, <3", + "python-Levenshtein", + "scalecodec==1.2.11", + "substrate-interface~=1.7.9", + "uvicorn", + "websockets>=14.1", + "bittensor-wallet>=2.1.3" +] +scripts = ["bittensor/utils/certifi.sh"] + +[project.optional-dependencies] +dev = [ + "pytest==7.2.0", + "pytest-asyncio==0.23.7", + "pytest-mock==3.12.0", + "pytest-split==0.8.0", + "pytest-xdist==3.0.2", + "pytest-rerunfailures==10.2", + "coveralls==3.3.1", + "pytest-cov==4.0.0", + "ddt==1.6.0", + "hypothesis==6.81.1", + "flake8==7.0.0", + "mypy==1.8.0", + "types-retry==0.9.9.4", + "freezegun==1.5.0", + "torch>=1.13.1", + "httpx==0.27.0", + "ruff==0.4.7", + "aioresponses==0.7.6", + "factory-boy==3.3.0", +] +torch = [ + "torch>=1.13.1" +] + +[project.urls] +# more details can be found here +homepage = "https://github.com/opentensor/bittensor" + +[tool.flit.metadata] +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Mathematics", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + "Topic :: Software Development", + "Topic :: Software Development :: Libraries", + "Topic :: Software Development :: Libraries :: Python Modules" +] \ No newline at end of file From ae293de4fa1b9f5a7335419d535fabf94dc7d5f7 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 22:07:52 +0200 Subject: [PATCH 2/6] Updated pyproject to work correctly now. --- pyproject.toml | 32 ++++++++++--------- setup.py | 85 -------------------------------------------------- 2 files changed, 17 insertions(+), 100 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index e82f3df205..3a7d40d56f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,24 +1,22 @@ [build-system] -requires = ["setuptools>=42", "wheel"] +requires = ["setuptools~=70.0.0", "wheel"] build-backend = "setuptools.build_meta" [project] name = "bittensor" -version = "0.1.0" +version = "9.0.3" description = "Bittensor" readme = "README.md" authors = [ - {email = "", name = "bittensor.com"} + {name = "bittensor.com"} ] -license = "MIT" +license = { file = "LICENSE" } requires-python = ">=3.9,<3.13" dependencies = [ "wheel", "setuptools~=70.0.0", "aiohttp~=3.9", - "async-property==0.2.2", - "bittensor-cli", - "bt-decode==0.2.0a0", + "asyncstdlib~=3.13.0", "colorama~=0.4.6", "fastapi~=0.110.1", "munch~=2.5.0", @@ -36,12 +34,12 @@ dependencies = [ "pydantic>=2.3, <3", "python-Levenshtein", "scalecodec==1.2.11", - "substrate-interface~=1.7.9", "uvicorn", "websockets>=14.1", - "bittensor-wallet>=2.1.3" + "bittensor-commit-reveal>=0.2.0", + "bittensor-wallet>=3.0.4", + "async-substrate-interface>=1.0.3" ] -scripts = ["bittensor/utils/certifi.sh"] [project.optional-dependencies] dev = [ @@ -59,25 +57,25 @@ dev = [ "mypy==1.8.0", "types-retry==0.9.9.4", "freezegun==1.5.0", - "torch>=1.13.1", "httpx==0.27.0", "ruff==0.4.7", "aioresponses==0.7.6", "factory-boy==3.3.0", + "types-requests" ] torch = [ - "torch>=1.13.1" + "torch>=1.13.1,<2.6.0" ] [project.urls] # more details can be found here homepage = "https://github.com/opentensor/bittensor" +Repository = "https://github.com/opentensor/bittensor" [tool.flit.metadata] classifiers = [ - "Development Status :: 3 - Alpha", + "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", @@ -90,4 +88,8 @@ classifiers = [ "Topic :: Software Development", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" -] \ No newline at end of file +] + +[tool.setuptools] +package-dir = {"" = "bittensor"} +script-files = ["bittensor/utils/certifi.sh"] \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 480a3f66bd..0000000000 --- a/setup.py +++ /dev/null @@ -1,85 +0,0 @@ -import codecs -import os -import pathlib -import re -from io import open -from os import path - -from setuptools import setup, find_packages - - -def read_requirements(path_): - requirements_ = [] - - with pathlib.Path(path_).open() as requirements_txt: - for line in requirements_txt: - if line.startswith("git+"): - pkg_name = re.search(r"egg=([a-zA-Z0-9_-]+)", line.strip()).group(1) - requirements_.append(pkg_name + " @ " + line.strip()) - else: - requirements_.append(line.strip()) - - return requirements_ - - -requirements = read_requirements("requirements/prod.txt") -extra_requirements_dev = read_requirements("requirements/dev.txt") -extra_requirements_cubit = read_requirements("requirements/cubit.txt") -extra_requirements_torch = read_requirements("requirements/torch.txt") -extra_requirements_cli = read_requirements("requirements/cli.txt") - -here = path.abspath(path.dirname(__file__)) - -with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - - -# loading version from setup.py -with codecs.open( - os.path.join(here, "bittensor/core/settings.py"), encoding="utf-8" -) as init_file: - version_match = re.search( - r"^__version__ = ['\"]([^'\"]*)['\"]", init_file.read(), re.M - ) - version_string = version_match.group(1) - -setup( - name="bittensor", - version=version_string, - description="bittensor", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/opentensor/bittensor", - author="bittensor.com", - packages=find_packages(exclude=["tests", "tests.*"]), - include_package_data=True, - package_data={ - "bittensor": ["utils/certifi.sh"], - }, - author_email="", - license="MIT", - python_requires=">=3.9", - install_requires=requirements, - extras_require={ - "dev": extra_requirements_dev + extra_requirements_torch, - "torch": extra_requirements_torch, - "cli": extra_requirements_cli, - }, - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Developers", - "Topic :: Software Development :: Build Tools", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Mathematics", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development", - "Topic :: Software Development :: Libraries", - "Topic :: Software Development :: Libraries :: Python Modules", - ], -) From 4511cd2d08db914f6ba68f536f4e5adc940356f0 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 22:30:39 +0200 Subject: [PATCH 3/6] Update async-substrate-interface requirement --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3a7d40d56f..c04df651b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "websockets>=14.1", "bittensor-commit-reveal>=0.2.0", "bittensor-wallet>=3.0.4", - "async-substrate-interface>=1.0.3" + "async-substrate-interface>=1.0.4" ] [project.optional-dependencies] From 9fcc90e81e58b773b4dff62cd77516a9f690d68f Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 22:53:13 +0200 Subject: [PATCH 4/6] Trigger no-op From 5951f87c314e56f5dcc3d6465496a20f797a58ef Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 23:29:00 +0200 Subject: [PATCH 5/6] Naming --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c04df651b3..5657e2d222 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,5 +91,5 @@ classifiers = [ ] [tool.setuptools] -package-dir = {"" = "bittensor"} +package-dir = {"bittensor" = "bittensor"} script-files = ["bittensor/utils/certifi.sh"] \ No newline at end of file From 44760b1b2ad306c282b9e4d81f080da1f9c20338 Mon Sep 17 00:00:00 2001 From: Benjamin Himes Date: Wed, 5 Mar 2025 23:34:26 +0200 Subject: [PATCH 6/6] Include torch in dev requirements. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5657e2d222..11d6100724 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,7 +61,8 @@ dev = [ "ruff==0.4.7", "aioresponses==0.7.6", "factory-boy==3.3.0", - "types-requests" + "types-requests", + "torch>=1.13.1,<2.6.0" ] torch = [ "torch>=1.13.1,<2.6.0"