lalib/pyproject.toml
Alexander Hess fb407631d9
Set up code formatting tools
- auto-format code with:
  + autoflake => * remove unused imports and variables
                 * remove duplicate dict keys
                 * expand star imports
  + black => enforce an uncompromising code style
  + isort => enforce a consistent import style
             compliant with Google's Python style guide
- add nox session "format" to run these tools
2024-09-10 01:27:34 +02:00

101 lines
2.3 KiB
TOML

[tool.poetry]
name = "lalib"
version = "0.4.2.dev0"
authors = [
"Alexander Hess <alexander@webartifex.biz>",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
description = "A Python library to study linear algebra"
license = "MIT"
readme = "README.md"
homepage = "https://github.com/webartifex/lalib"
repository = "https://github.com/webartifex/lalib"
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.group.dev.dependencies]
# Code formatters
autoflake = "^2.3"
black = "^24.8"
isort = "^5.13"
[tool.poetry.urls]
"Issues Tracker" = "https://github.com/webartifex/lalib/issues"
[tool.autoflake]
# Source: https://github.com/PyCQA/autoflake#configuration
in-place = true
recursive = true
expand-star-imports = true
remove-all-unused-imports = true
ignore-init-module-imports = true # modifies "remove-all-unused-imports"
remove-duplicate-keys = true
remove-unused-variables = true
[tool.black]
# Source: https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html
line-length = 88
target-version = ["py312", "py311", "py310", "py39"]
[tool.isort]
# Source: https://pycqa.github.io/isort/docs/configuration/options.html
known_first_party = ["lalib"]
atomic = true
case_sensitive = true
combine_star = true
force_alphabetical_sort_within_sections = true
lines_after_imports = 2
remove_redundant_aliases = true
# Comply with black's style => Instead of: 'profile = "black"'
# Source: https://pycqa.github.io/isort/docs/configuration/profiles.html
ensure_newline_before_comments = true
force_grid_wrap = 0
include_trailing_comma = true
line_length = 88
multi_line_output = 3
split_on_trailing_comma = true
use_parentheses = true
# Comply with Google's Python style guide
# => All imports go on a single line (with some exceptions)
# Source: https://google.github.io/styleguide/pyguide.html#313-imports-formatting
force_single_line = true
single_line_exclusions = ["collections.abc", "typing"]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"