diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..11d6100724 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,96 @@ +[build-system] +requires = ["setuptools~=70.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "bittensor" +version = "9.0.3" +description = "Bittensor" +readme = "README.md" +authors = [ + {name = "bittensor.com"} +] +license = { file = "LICENSE" } +requires-python = ">=3.9,<3.13" +dependencies = [ + "wheel", + "setuptools~=70.0.0", + "aiohttp~=3.9", + "asyncstdlib~=3.13.0", + "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", + "uvicorn", + "websockets>=14.1", + "bittensor-commit-reveal>=0.2.0", + "bittensor-wallet>=3.0.4", + "async-substrate-interface>=1.0.4" +] + +[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", + "httpx==0.27.0", + "ruff==0.4.7", + "aioresponses==0.7.6", + "factory-boy==3.3.0", + "types-requests", + "torch>=1.13.1,<2.6.0" +] +torch = [ + "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 :: 5 - Production/Stable", + "Intended Audience :: Developers", + "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" +] + +[tool.setuptools] +package-dir = {"bittensor" = "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", - ], -)