[tool.poetry]
name = "chia-blockchain"
# see [tool.poetry-dynamic-versioning]
version = "0.0.0"
description = "Chia blockchain full node, farmer, timelord, and wallet."
authors = ["Mariano Sorgente <mariano@chia.net>"]
license = "Apache License"
readme = "README.md"
keywords= ["chia", "blockchain", "node"]
homepage = "https://chia.net/"
packages = [{ include = "chia"}, { include = "mozilla-ca/cacert.pem" }]

[tool.poetry.scripts]
chia = "chia.cmds.chia:main"
chia_daemon = "chia.daemon.server:main"
chia_wallet = "chia.server.start_wallet:main"
chia_full_node = "chia.server.start_full_node:main"
chia_harvester = "chia.server.start_harvester:main"
chia_farmer = "chia.server.start_farmer:main"
chia_introducer = "chia.server.start_introducer:main"
chia_crawler = "chia.seeder.start_crawler:main"
chia_seeder = "chia.seeder.dns_server:main"
chia_timelord = "chia.server.start_timelord:main"
chia_timelord_launcher = "chia.timelord.timelord_launcher:main"
chia_full_node_simulator = "chia.simulator.start_simulator:main"
chia_data_layer = "chia.server.start_data_layer:main"
chia_data_layer_http = "chia.data_layer.data_layer_server:main"
chia_data_layer_s3_plugin = "chia.data_layer.s3_plugin_service:run_server"

[[tool.poetry.source]]
name = "chia"
url = "https://pypi.chia.net/simple/"
priority = "supplemental"

[tool.poetry.urls]
"Source" = "https://github.com/Chia-Network/chia-blockchain/"
"Changelog" = "https://github.com/Chia-Network/chia-blockchain/blob/main/CHANGELOG.md"

[tool.poetry.dependencies]
python = ">=3.8.10, <3.13"
aiofiles = "23.2.1"  # Async IO for files
aiohttp = "3.9.5"  # HTTP server for full node rpc
aiosqlite = "0.20.0"  # asyncio wrapper for sqlite, to store blocks
anyio = "4.3.0"
bitstring = "4.1.4"  # Binary data management library
boto3 = "1.34.143"  # AWS S3 for Data Layer S3 plugin
chiabip158 = "1.5.1"  # bip158-style wallet filters
chiapos = "2.0.4"  # proof of space
chia_rs = "0.10.0"
chiavdf = "1.1.4"  # timelord and vdf verification
click = "8.1.7"  # For the CLI
clvm = "0.9.10"
clvm_tools = "0.4.9"  # Currying Program.to other conveniences
clvm_tools_rs = "0.1.43"  # Rust implementation of clvm_tools' compiler
colorama = "0.4.6"  # Colorizes terminal output
colorlog = "6.8.2"  # Adds color to logs
concurrent_log_handler = "0.9.25"  # Concurrently log and rotate logs
cryptography = "42.0.8"  # Python cryptography library for TLS - keyring conflict
dnslib = "0.9.24"  # dns lib
dnspython = "2.6.1"  # Query DNS seeds
filelock = "3.15.4"  # For reading and writing config multiprocess and multithread safely  (non-reentrant locks)
keyring = "25.1.0"  # Store keys in MacOS Keychain, Windows Credential Locker
packaging = "24.0"
pip = "24.0"
psutil = [
    {version="5.9.4", markers="platform_machine!='aarch64'"},
    {version="5.9.4", markers="platform_machine=='aarch64'", source="chia"},
]
pyyaml = "6.0.1"  # Used for config file format
setproctitle = "1.3.3"  # Gives the chia processes readable names
setuptools = "70.0.0"
sortedcontainers = "2.4.0"  # For maintaining sorted mempools
typing-extensions = "4.11.0"  # typing backports like Protocol and TypedDict
watchdog = "4.0.1"  # Filesystem event watching - watches keyring.yaml
zstd = [
	{version="1.5.5.1", python = "<3.12"},
	{version="1.5.5.1", python = "3.12", source="chia"},
]
importlib-resources = "6.4.0"
hsms = "0.3.1"
aiohttp_cors = { version = "0.7.0", optional = true }
black = { version = "24.4.2", optional = true }
build = { version = "1.2.1", optional = true }
coverage = { version = "7.5.3", optional = true }
diff-cover = { version = "9.0.0", optional = true }
flake8 = { version = "7.0.0", optional = true }
isort = { version = "5.13.2", optional = true }
# TODO: but...  keyrings_cryptfile goes 15 minutes without locking while this does in 75 seconds
"keyrings.cryptfile" = { version = "1.3.9", optional = true }
mypy = { version = "1.10.0", optional = true }
pre-commit = [ { version = "3.5.0", python = "<3.9", optional = true }, { version = "3.7.1", python = ">=3.9", optional = true } ]
py3createtorrent = { version = "1.1.0", optional = true }
pyinstaller = { version = "6.9.0", optional = true }
pylint = { version = "3.2.2", optional = true }
pytest = { version = "8.1.1", optional = true }
pytest-cov = { version = "5.0.0", optional = true }
pytest-mock = { version = "3.14.0", optional = true }
pytest-monitor = { version = "1.6.6", platform = "linux", optional = true }
pytest-xdist = { version = "3.6.1", optional = true }
types-aiofiles = { version = "23.2.0.20240311", optional = true }
types-cryptography = { version = "3.3.23.2", optional = true }
types-pyyaml = { version = "6.0.12.20240311", optional = true }
types-setuptools = { version = "70.0.0.20240524", optional = true }
lxml = { version = "5.2.2", optional = true }
miniupnpc = { version = "2.2.2", source = "chia", optional = true }
pyupgrade = { version = "3.15.2", optional = true }
# big-o = {version = "0.11.0", optional = true}
# numpy = [
# 	{version="1.24.4", python = "<3.9", optional = true},
# 	{version="1.26.4", python = ">=3.9", optional = true}]


[tool.poetry.extras]
dev = ["aiohttp_cors", "black", "build", "coverage", "diff-cover", "flake8", "isort", "mypy", "pre-commit", "py3createtorrent", "pyinstaller", "pylint", "pytest", "pytest-cov", "pytest-mock", "pytest-monitor", "pytest-xdist", "twine", "types-aiofiles", "types-cryptography", "types-pyyaml", "types-setuptools", "pyupgrade", "lxml"]
upnp = ["miniupnpc"]
legacy_keyring = ["keyrings.cryptfile"]

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
pattern = "default-unprefixed"
format-jinja = """
    {%- if distance == 0 -%}
        {%- if stage is none -%}
            {{ base }}
        {%- else -%}
            {{ base }}-{{stage}}{{revision}}
        {%- endif -%}
    {%- else -%}
        {%- if stage is none -%}
            {{ base }}-dev{{ distance }}
        {%- else -%}
            {{ base }}-{{stage}}{{revision}}.dev{{ distance }}
        {%- endif -%}
    {%- endif -%}
"""
#format-jinja = """
#    {%- if distance == 0 -%}
#        {{ serialize_pep440(base, stage, revision) }}
#    {%- else -%}
#        {{ serialize_pep440(base, stage, revision, dev=distance) }}
#    {%- endif -%}
#"""
style = "semver"
bump = true

[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry_dynamic_versioning.backend"

[tool.black]
line-length = 120
target-version =  ['py38', 'py39', 'py310', 'py311', 'py312']
include = '''
^/(
    [^/]*.py
    | (benchmarks|build_scripts|chia|tests|tools)/.*\.pyi?
)$
'''
exclude = ''
