Skip to content

Instantly share code, notes, and snippets.

@Ruslan-Skira
Created August 27, 2026 15:44
Show Gist options
  • Select an option

  • Save Ruslan-Skira/ca54e93869501eaf99dc89b4c28499d1 to your computer and use it in GitHub Desktop.

Select an option

Save Ruslan-Skira/ca54e93869501eaf99dc89b4c28499d1 to your computer and use it in GitHub Desktop.
pyproject.toml file with collection of common used settings.
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "MEGA_DUPER"
version = "1.0.1"
description = "Future"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"pydantic>=2.7.4",
"psycopg2-binary>=2.9.9",
"python-dotenv>=1.0.1",
"SQLAlchemy>=2.0",
"alembic>=1.11.1",
]
[dependency-groups]
dev = [
"pytest>=8.2.2",
"ruff>=0.16.3",
]
[tool.pytest.ini_options]
pythonpath = ["main_folder for imports please"]
addopts = "-ra -q"
testpaths = [
"tests/*"
]
[project.optional-dependencies]
test = [
"pytest",
]
[[tool.uv.index]]
url = "http://could_be_any_server/nexus/repository/pypi-proxy/simple"
default = true
[tool.ruff]
target-version = "py311"
# Set line length limit (Black-compatible default)
line-length = 88
# Directory exclusions
extend-exclude = [
"alembic/versions",
]
[tool.ruff.lint]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"F", # Pyflakes
"G", # flake8-logging-format
"I", # isort
"N", # pep8-naming
"PIE", # flake8-pie
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"B012", # Jump statements (break/continue/return) inside finally block
"B904", # Within an except clause, raise exceptions with raise ... from err
"D104", # Missing docstring in public package
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D107", # Missing docstring in `__init__`
"D203", # 1 blank line required before class docstring (conflicts with D211)
"D213", # Multi-line docstring summary should start at the second line (conflicts with D212)
"E501", # Line too long (handled by ruff format)
"ISC001", # Single line implicit string concatenation (formatter conflict)
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"RUF012", # Mutable class attributes (ClassVar requirement)
"S603", # subprocess call: check for execution of untrusted input
"UP007", # Use X | Y for type annotations
"G004", # Logging statement uses f-string
"N812", # Lowercase `connection` imported as non-lowercase `_PGConnection`
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"D",
"DTZ001",
"N999",
"S101",
"S105",
"S106",
"SIM117",
]
"alembic/**/*.py" = [
"D",
"E501",
"N806",
"S",
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment