mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 06:52:55 +00:00
## Problem `black` is slow sometimes, we can replace it with `ruff format` (a new feature in 0.1.2 [0]), which produces pretty similar to black style [1]. On my local machine (MacBook M1 Pro 16GB): ``` # `black` on main $ hyperfine "BLACK_CACHE_DIR=/dev/null poetry run black ." Benchmark 1: BLACK_CACHE_DIR=/dev/null poetry run black . Time (mean ± σ): 3.131 s ± 0.090 s [User: 5.194 s, System: 0.859 s] Range (min … max): 3.047 s … 3.354 s 10 runs ``` ``` # `ruff format` on the current PR $ hyperfine "RUFF_NO_CACHE=true poetry run ruff format" Benchmark 1: RUFF_NO_CACHE=true poetry run ruff format Time (mean ± σ): 300.7 ms ± 50.2 ms [User: 259.5 ms, System: 76.1 ms] Range (min … max): 267.5 ms … 420.2 ms 10 runs ``` ## Summary of changes - Replace `black` with `ruff format` everywhere - [0] https://docs.astral.sh/ruff/formatter/ - [1] https://docs.astral.sh/ruff/formatter/#black-compatibility
87 lines
2.0 KiB
TOML
87 lines
2.0 KiB
TOML
[tool.poetry]
|
|
name = "neon"
|
|
version = "0.1.0"
|
|
description = ""
|
|
authors = []
|
|
|
|
[tool.poetry.dependencies]
|
|
python = "^3.9"
|
|
pytest = "^7.4.4"
|
|
psycopg2-binary = "^2.9.6"
|
|
typing-extensions = "^4.6.1"
|
|
PyJWT = {version = "^2.1.0", extras = ["crypto"]}
|
|
requests = "^2.31.0"
|
|
pytest-xdist = "^3.3.1"
|
|
asyncpg = "^0.29.0"
|
|
aiopg = "^1.4.0"
|
|
Jinja2 = "^3.0.2"
|
|
types-requests = "^2.31.0.0"
|
|
types-psycopg2 = "^2.9.21.10"
|
|
boto3 = "^1.34.11"
|
|
boto3-stubs = {extras = ["s3"], version = "^1.26.16"}
|
|
moto = {extras = ["server"], version = "^4.1.2"}
|
|
backoff = "^2.2.1"
|
|
pytest-lazy-fixture = "^0.6.3"
|
|
prometheus-client = "^0.14.1"
|
|
pytest-timeout = "^2.1.0"
|
|
Werkzeug = "^3.0.1"
|
|
pytest-order = "^1.1.0"
|
|
allure-pytest = "^2.13.2"
|
|
pytest-asyncio = "^0.21.0"
|
|
toml = "^0.10.2"
|
|
psutil = "^5.9.4"
|
|
types-psutil = "^5.9.5.12"
|
|
types-toml = "^0.10.8.6"
|
|
pytest-httpserver = "^1.0.8"
|
|
aiohttp = "3.9.0"
|
|
pytest-rerunfailures = "^13.0"
|
|
types-pytest-lazy-fixture = "^0.6.3.3"
|
|
pytest-split = "^0.8.1"
|
|
zstandard = "^0.21.0"
|
|
|
|
[tool.poetry.group.dev.dependencies]
|
|
mypy = "==1.3.0"
|
|
ruff = "^0.1.11"
|
|
|
|
[build-system]
|
|
requires = ["poetry-core>=1.0.0"]
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
[tool.mypy]
|
|
exclude = "^vendor/"
|
|
check_untyped_defs = true
|
|
# Help mypy find imports when running against list of individual files.
|
|
# Without this line it would behave differently when executed on the entire project.
|
|
mypy_path = "$MYPY_CONFIG_FILE_DIR:$MYPY_CONFIG_FILE_DIR/test_runner"
|
|
|
|
disallow_incomplete_defs = false
|
|
disallow_untyped_calls = false
|
|
disallow_untyped_decorators = false
|
|
disallow_untyped_defs = false
|
|
strict = true
|
|
|
|
[[tool.mypy.overrides]]
|
|
module = [
|
|
"asyncpg.*",
|
|
"pg8000.*",
|
|
"allure.*",
|
|
"allure_commons.*",
|
|
"allure_pytest.*",
|
|
]
|
|
ignore_missing_imports = true
|
|
|
|
[tool.ruff]
|
|
target-version = "py39"
|
|
extend-exclude = ["vendor/"]
|
|
ignore = [
|
|
"E501", # Line too long, we don't want to be too strict about it
|
|
]
|
|
select = [
|
|
"E", # pycodestyle
|
|
"F", # Pyflakes
|
|
"I", # isort
|
|
"W", # pycodestyle
|
|
"B", # bugbear
|
|
]
|
|
line-length = 100 # this setting is rather guidance, it won't fail if it can't make the shorter
|