From 1d4a0c9081882c27a2824cbb58681a92126c4d5f Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Wed, 7 Aug 2024 21:40:40 +0200 Subject: [PATCH] style: run pyproject-fmt on pyproject --- pyproject.toml | 361 ++++++++++++++++++++++++------------------------- 1 file changed, 179 insertions(+), 182 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d89f42e6..86a49d8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,143 +1,137 @@ [build-system] -requires = ["hatchling", "hatch-vcs"] build-backend = "hatchling.build" +requires = [ "hatch-vcs", "hatchling" ] + [project] name = "pyaleph" -dynamic = ["version"] description = "Reference implementation of Aleph.im next generation network of decentralized big data applications." -requires-python = ">=3.12,<3.13" readme = "README.md" license = { file = "LICENSE.txt" } authors = [ - { name = "Moshe Malawach", email = "moshe.malawach@protonmail.com" }, + { name = "Moshe Malawach", email = "moshe.malawach@protonmail.com" }, ] +requires-python = ">=3.12,<3.13" classifiers = [ - "Development Status :: 4 - Beta", - "Programming Language :: Python", + "Development Status :: 4 - Beta", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.12", ] +dynamic = [ "version" ] dependencies = [ - "aio_pika==9.1.3", - "aiocache==0.12.2", - "aiofiles==23.2.1", - "aiohttp-cors==0.7.0", - "aiohttp-jinja2==1.5", - "aiohttp==3.9.5", - "aioipfs@git+https://github.com/aleph-im/aioipfs.git@d671c79b2871bb4d6c8877ba1e7f3ffbe7d20b71", - "alembic==1.12.1", - "aleph-message==0.4.8", - "aleph-p2p-client@git+https://github.com/aleph-im/p2p-service-client-python@2c04af39c566217f629fd89505ffc3270fba8676", - "aleph-nuls2==0.1.0", - "aleph-pytezos@git+https://github.com/aleph-im/aleph-pytezos.git@hoh-continue-upgrade", - "asyncpg==0.28.0", - "base58>=1.0.3", - "coincurve==20.0.0", - "configmanager==1.35.1", - "configparser==6.0.0", - "cosmospy==6.0.0", - "dataclasses_json==0.5.6", - "eth-typing~=4.0", - "eth_account==0.10.0", - "gunicorn==21.2.0", - "hexbytes==0.2.2", - "msgpack==1.0.3", # required by aiocache - "multiaddr==0.0.9", # for libp2p-stubs - "orjson>=3.7.7", # Minimum version for Python 3.11 - "psycopg2-binary==2.9.5", # Note: psycopg3 is not yet supported by SQLAlchemy - "pycryptodome==3.17.0", # for libp2p-stubs - "pymultihash==0.8.2", # for libp2p-stubs - "pynacl==1.5.0", - "python-dateutil==2.8.2", - "pytz==2023.3", - "pyyaml==6.0.1", - "redis[hiredis]==5.0.1", - "requests==2.31.0", - "sentry-sdk==1.34.0", - "setproctitle==1.3.3", - "sqlalchemy[mypy]==1.4.52", - "sqlalchemy-utils==0.38.3", - "setuptools>=70.3.0", - "substrate-interface==1.7.4", - "types-aiofiles==23.2.0.20240403", - "ujson==5.1.0", # required by aiocache - "urllib3==2.0.7", - "uvloop==0.19.0", - "web3==6.11.2", + "aio-pika==9.1.3", + "aiocache==0.12.2", + "aiofiles==23.2.1", + "aiohttp==3.9.5", + "aiohttp-cors==0.7", + "aiohttp-jinja2==1.5", + "aioipfs @ git+https://github.com/aleph-im/aioipfs.git@d671c79b2871bb4d6c8877ba1e7f3ffbe7d20b71", + "alembic==1.12.1", + "aleph-message==0.4.8", + "aleph-nuls2==0.1", + "aleph-p2p-client @ git+https://github.com/aleph-im/p2p-service-client-python@2c04af39c566217f629fd89505ffc3270fba8676", + "aleph-pytezos @ git+https://github.com/aleph-im/aleph-pytezos.git@hoh-continue-upgrade", + "asyncpg==0.28", + "base58>=1.0.3", + "coincurve==20", + "configmanager==1.35.1", + "configparser==6", + "cosmospy==6", + "dataclasses-json==0.5.6", + "eth-account==0.10", + "eth-typing~=4.0", + "gunicorn==21.2", + "hexbytes==0.2.2", + "msgpack==1.0.3", # required by aiocache + "multiaddr==0.0.9", # for libp2p-stubs + "orjson>=3.7.7", # Minimum version for Python 3.11 + "psycopg2-binary==2.9.5", # Note: psycopg3 is not yet supported by SQLAlchemy + "pycryptodome==3.17", # for libp2p-stubs + "pymultihash==0.8.2", # for libp2p-stubs + "pynacl==1.5", + "python-dateutil==2.8.2", + "pytz==2023.3", + "pyyaml==6.0.1", + "redis[hiredis]==5.0.1", + "requests==2.31", + "sentry-sdk==1.34", + "setproctitle==1.3.3", + "setuptools>=70.3", + "sqlalchemy[mypy]==1.4.52", + "sqlalchemy-utils==0.38.3", + "substrate-interface==1.7.4", + "types-aiofiles==23.2.0.20240403", + "ujson==5.1", # required by aiocache + "urllib3==2.0.7", + "uvloop==0.19", + "web3==6.11.2", ] -dependency_links = [ - "https://github.com/aleph-im/py-libp2p/tarball/0.1.4-1-use-set#egg=libp2p", - "https://github.com/aleph-im/aioipfs/tarball/hoh-more-exceptions#egg=aioipfs", +optional-dependencies.cosmos = [ + "cosmospy", ] - -[project.scripts] -pyaleph = "aleph.commands:run" - -[project.optional-dependencies] -nuls2 = [ - "aleph-nuls2==0.1.0", - "py-ed25519-bindings==1.0.2; python_version >=\"3.11\"", +optional-dependencies.docs = [ + "sphinxcontrib-plantuml", ] -polkadot = [ - "substrate-interface>=0.9.27", +optional-dependencies.nuls2 = [ + "aleph-nuls2==0.1", + "py-ed25519-bindings==1.0.2; python_version>='3.11'", ] -cosmos = [ - "cosmospy", +optional-dependencies.polkadot = [ + "substrate-interface>=0.9.27", ] -docs = [ - "sphinxcontrib-plantuml", +urls.Documentation = "https://aleph.im/" +urls.Homepage = "https://github.com/aleph-im/pyaleph" +scripts.pyaleph = "aleph.commands:run" +dependency_links = [ + "https://github.com/aleph-im/py-libp2p/tarball/0.1.4-1-use-set#egg=libp2p", + "https://github.com/aleph-im/aioipfs/tarball/hoh-more-exceptions#egg=aioipfs", ] [tool.hatch.metadata] allow-direct-references = true -[project.urls] -Documentation = "https://aleph.im/" -Homepage = "https://github.com/aleph-im/pyaleph" - [tool.hatch.version] source = "vcs" [tool.hatch.build.targets.wheel] packages = [ - "alembic.ini", - "src/aleph", - "pyproject.toml", - "AUTHORS.rst", - "CHANGELOG.rst", - "README.md", - "LICENSE.txt", - "code-of-conduct.md", + "alembic.ini", + "src/aleph", + "pyproject.toml", + "AUTHORS.rst", + "CHANGELOG.rst", + "README.md", + "LICENSE.txt", + "code-of-conduct.md", ] [tool.hatch.build.targets.sdist] include = [ - "alembic.ini", - "src/aleph", - "pyproject.toml", - "AUTHORS.rst", - "CHANGELOG.rst", - "README.md", - "LICENSE.txt", - "code-of-conduct.md", + "alembic.ini", + "src/aleph", + "pyproject.toml", + "AUTHORS.rst", + "CHANGELOG.rst", + "README.md", + "LICENSE.txt", + "code-of-conduct.md", ] -[tool.isort] -profile = "black" - [tool.hatch.envs.testing] features = [ - "cosmos", - "nuls2", - "polkadot", + "cosmos", + "nuls2", + "polkadot", ] dependencies = [ - "ipfshttpclient==0.8.0a2", # eth/web3 test dependency, for some reason" - "more-itertools==8.14.0", - "pytest==8.0.1", - "pytest-cov==4.1.0", - "pytest-mock==3.12.0", - "pytest-asyncio==0.23.5", - "pytest-aiohttp==1.0.5", + "ipfshttpclient==0.8.0a2", # eth/web3 test dependency, for some reason" + "more-itertools==8.14.0", + "pytest==8.0.1", + "pytest-cov==4.1.0", + "pytest-mock==3.12.0", + "pytest-asyncio==0.23.5", + "pytest-aiohttp==1.0.5", ] # XXX see https://github.com/aleph-im/pyaleph/blob/main/.github/workflows/pyaleph-ci.yml @@ -156,53 +150,105 @@ cov = [ [tool.hatch.envs.linting] detached = true dependencies = [ - "black==24.2.0", - "mypy==1.2.0", - "mypy-extensions==1.0.0", - "ruff==0.4.8", - "isort==5.13.2", - "sqlalchemy[mypy]==1.4.41", - "yamlfix==1.16.0", - # because of aleph messages otherwise yamlfix install a too new version - "pydantic>=1.10.5,<2.0.0", - "pyproject-fmt==2.2.1", - "types-aiofiles", - "types-protobuf", - "types-pytz", - "types-redis", - "types-requests", - "types-setuptools", + "black==24.2.0", + "mypy==1.2.0", + "mypy-extensions==1.0.0", + "ruff==0.4.8", + "isort==5.13.2", + "sqlalchemy[mypy]==1.4.41", + "yamlfix==1.16.0", + # because of aleph messages otherwise yamlfix install a too new version + "pydantic>=1.10.5,<2.0.0", + "pyproject-fmt==2.2.1", + "types-aiofiles", + "types-protobuf", + "types-pytz", + "types-redis", + "types-requests", + "types-setuptools", ] [tool.hatch.envs.linting.scripts] typing = "mypy --config-file=pyproject.toml {args:} ./src/ ./tests/" style = [ - "ruff check {args:.}", - "black --check --diff {args:} ./src/ ./tests/", - "isort --check-only --profile black {args:} ./src/ ./tests/", - "yamlfix --check .", - "pyproject-fmt --check pyproject.toml", + "ruff check {args:.}", + "black --check --diff {args:} ./src/ ./tests/", + "isort --check-only --profile black {args:} ./src/ ./tests/", + "yamlfix --check .", + "pyproject-fmt --check pyproject.toml", ] fmt = [ - "black {args:} ./src/ ./tests/", - "ruff check --fix {args:.} ./src/ ./tests/", - "isort --profile black {args:} ./src/ ./tests/", - "yamlfix .", - "pyproject-fmt pyproject.toml", - "style", + "black {args:} ./src/ ./tests/", + "ruff check --fix {args:.} ./src/ ./tests/", + "isort --profile black {args:} ./src/ ./tests/", + "yamlfix .", + "pyproject-fmt pyproject.toml", + "style", ] all = [ - "style", - "typing", + "style", + "typing", +] + +[tool.isort] +profile = "black" + +[tool.pytest.ini_options] +minversion = "6.0" +pythonpath = [ "src" ] +addopts = "-vv -m \"not ledger_hardware\"" +norecursedirs = [ "*.egg", "dist", "build", ".tox", ".venv", "*/site-packages/*" ] +testpaths = [ "tests/unit" ] +markers = { ledger_hardware = "marks tests as requiring ledger hardware" } + +[tool.coverage.run] +branch = true +parallel = true +source = [ + "src/", +] +omit = [ + "*/site-packages/*", +] + +[tool.coverage.paths] +source = [ + "src/", +] +omit = [ + "*/site-packages/*", +] + +[tool.coverage.report] +show_missing = true +skip_empty = true +exclude_lines = [ + # Have to re-enable the standard pragma + "pragma: no cover", + + # Don't complain about missing debug-only code: + "def __repr__", + "if self\\.debug", + + # Don't complain if tests don't hit defensive assertion code: + "raise AssertionError", + "raise NotImplementedError", + + # Don't complain if non-runnable code isn't run: + "if 0:", + "if __name__ == .__main__.:", + + # Don't complain about ineffective code: + "pass", ] [tool.mypy] python_version = 3.12 mypy_path = "src" plugins = [ - "sqlalchemy.ext.mypy.plugin", + "sqlalchemy.ext.mypy.plugin", ] exclude = [ - "conftest.py" + "conftest.py", ] show_column_numbers = true @@ -272,54 +318,5 @@ allow_redefinition = true # [mypy-aleph.toolkit.libp2p_stubs.""] # ignore_errors = True -[tool.pytest.ini_options] -minversion = "6.0" -pythonpath = ["src"] -addopts = "-vv -m \"not ledger_hardware\"" -norecursedirs = ["*.egg", "dist", "build", ".tox", ".venv", "*/site-packages/*"] -testpaths = ["tests/unit"] -markers = {ledger_hardware = "marks tests as requiring ledger hardware"} - -[tool.coverage.run] -branch = true -parallel = true -source = [ - "src/", -] -omit = [ - "*/site-packages/*", -] - -[tool.coverage.paths] -source = [ - "src/", -] -omit = [ - "*/site-packages/*", -] - -[tool.coverage.report] -show_missing = true -skip_empty = true -exclude_lines = [ - # Have to re-enable the standard pragma - "pragma: no cover", - - # Don't complain about missing debug-only code: - "def __repr__", - "if self\\.debug", - - # Don't complain if tests don't hit defensive assertion code: - "raise AssertionError", - "raise NotImplementedError", - - # Don't complain if non-runnable code isn't run: - "if 0:", - "if __name__ == .__main__.:", - - # Don't complain about ineffective code: - "pass", -] - [tool.yamlfix] sequence_style = "keep_style"