2024-10-08 17:09:28 +00:00
|
|
|
[project]
|
|
|
|
name = "thealgorithms-python"
|
|
|
|
version = "0.0.1"
|
|
|
|
description = "TheAlgorithms in Python"
|
|
|
|
authors = [ { name = "TheAlgorithms Contributors" } ]
|
|
|
|
requires-python = ">=3.13"
|
|
|
|
classifiers = [
|
|
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
|
|
"Programming Language :: Python :: 3.13",
|
|
|
|
|
|
|
|
]
|
|
|
|
optional-dependencies.docs = [
|
|
|
|
"myst-parser",
|
|
|
|
"sphinx-autoapi",
|
|
|
|
"sphinx-pyproject",
|
|
|
|
]
|
|
|
|
|
2023-03-15 12:58:25 +00:00
|
|
|
[tool.ruff]
|
2024-10-08 17:09:28 +00:00
|
|
|
target-version = "py313"
|
2024-05-20 20:44:57 +00:00
|
|
|
|
|
|
|
output-format = "full"
|
|
|
|
lint.select = [
|
|
|
|
# https://beta.ruff.rs/docs/rules
|
2024-05-14 11:38:55 +00:00
|
|
|
"A", # flake8-builtins
|
|
|
|
"ARG", # flake8-unused-arguments
|
|
|
|
"ASYNC", # flake8-async
|
|
|
|
"B", # flake8-bugbear
|
|
|
|
"BLE", # flake8-blind-except
|
|
|
|
"C4", # flake8-comprehensions
|
|
|
|
"C90", # McCabe cyclomatic complexity
|
|
|
|
"DJ", # flake8-django
|
|
|
|
"DTZ", # flake8-datetimez
|
|
|
|
"E", # pycodestyle
|
|
|
|
"EM", # flake8-errmsg
|
|
|
|
"EXE", # flake8-executable
|
|
|
|
"F", # Pyflakes
|
|
|
|
"FA", # flake8-future-annotations
|
|
|
|
"FLY", # flynt
|
|
|
|
"G", # flake8-logging-format
|
|
|
|
"I", # isort
|
|
|
|
"ICN", # flake8-import-conventions
|
|
|
|
"INP", # flake8-no-pep420
|
|
|
|
"INT", # flake8-gettext
|
|
|
|
"ISC", # flake8-implicit-str-concat
|
|
|
|
"N", # pep8-naming
|
|
|
|
"NPY", # NumPy-specific rules
|
|
|
|
"PD", # pandas-vet
|
|
|
|
"PGH", # pygrep-hooks
|
|
|
|
"PIE", # flake8-pie
|
|
|
|
"PL", # Pylint
|
|
|
|
"PT", # flake8-pytest-style
|
|
|
|
"PYI", # flake8-pyi
|
|
|
|
"RSE", # flake8-raise
|
|
|
|
"RUF", # Ruff-specific rules
|
|
|
|
"S", # flake8-bandit
|
|
|
|
"SIM", # flake8-simplify
|
|
|
|
"SLF", # flake8-self
|
|
|
|
"T10", # flake8-debugger
|
|
|
|
"TD", # flake8-todos
|
|
|
|
"TID", # flake8-tidy-imports
|
|
|
|
"UP", # pyupgrade
|
|
|
|
"W", # pycodestyle
|
|
|
|
"YTT", # flake8-2020
|
2023-05-26 07:34:17 +00:00
|
|
|
# "ANN", # flake8-annotations # FIX ME?
|
|
|
|
# "COM", # flake8-commas
|
|
|
|
# "D", # pydocstyle -- FIX ME?
|
|
|
|
# "ERA", # eradicate -- DO NOT FIX
|
|
|
|
# "FBT", # flake8-boolean-trap # FIX ME
|
|
|
|
# "PTH", # flake8-use-pathlib # FIX ME
|
|
|
|
# "Q", # flake8-quotes
|
|
|
|
# "RET", # flake8-return # FIX ME?
|
|
|
|
# "T20", # flake8-print
|
|
|
|
# "TCH", # flake8-type-checking
|
|
|
|
# "TRY", # tryceratops
|
2023-03-15 12:58:25 +00:00
|
|
|
]
|
2024-05-28 01:56:48 +00:00
|
|
|
lint.ignore = [
|
|
|
|
# `ruff rule S101` for a description of that rule
|
|
|
|
"B904", # Within an `except` clause, raise exceptions with `raise ... from err` -- FIX ME
|
|
|
|
"B905", # `zip()` without an explicit `strict=` parameter -- FIX ME
|
|
|
|
"EM101", # Exception must not use a string literal, assign to variable first
|
|
|
|
"EXE001", # Shebang is present but file is not executable -- DO NOT FIX
|
|
|
|
"G004", # Logging statement uses f-string
|
|
|
|
"PLC1901", # `{}` can be simplified to `{}` as an empty string is falsey
|
|
|
|
"PLW060", # Using global for `{name}` but no assignment is done -- DO NOT FIX
|
|
|
|
"PLW2901", # PLW2901: Redefined loop variable -- FIX ME
|
|
|
|
"PT011", # `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception
|
|
|
|
"PT018", # Assertion should be broken down into multiple parts
|
|
|
|
"S101", # Use of `assert` detected -- DO NOT FIX
|
|
|
|
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes -- FIX ME
|
|
|
|
"SLF001", # Private member accessed: `_Iterator` -- FIX ME
|
|
|
|
"UP038", # Use `X | Y` in `{}` call instead of `(X, Y)` -- DO NOT FIX
|
|
|
|
]
|
|
|
|
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."data_structures/hashing/tests/test_hash_map.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"BLE001",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."hashes/enigma_machine.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"BLE001",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."machine_learning/sequential_minimum_optimization.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"SIM115",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."matrix/sherman_morrison.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"SIM103",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."other/l*u_cache.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"RUF012",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."physics/newtons_second_law_of_motion.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"BLE001",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."project_euler/problem_099/sol1.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"SIM115",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.per-file-ignores."sorts/external_sort.py" = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"SIM115",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.mccabe.max-complexity = 17 # default: 10
|
|
|
|
lint.pylint.allow-magic-value-types = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"float",
|
|
|
|
"int",
|
|
|
|
"str",
|
|
|
|
]
|
2024-05-20 20:44:57 +00:00
|
|
|
lint.pylint.max-args = 10 # default: 5
|
|
|
|
lint.pylint.max-branches = 20 # default: 12
|
|
|
|
lint.pylint.max-returns = 8 # default: 6
|
|
|
|
lint.pylint.max-statements = 88 # default: 50
|
2023-06-20 16:03:16 +00:00
|
|
|
|
2023-11-07 00:49:09 +00:00
|
|
|
[tool.codespell]
|
|
|
|
ignore-words-list = "3rt,ans,bitap,crate,damon,fo,followings,hist,iff,kwanza,manuel,mater,secant,som,sur,tim,toi,zar"
|
|
|
|
skip = "./.*,*.json,ciphers/prehistoric_men.txt,project_euler/problem_022/p022_names.txt,pyproject.toml,strings/dictionary.txt,strings/words.txt"
|
|
|
|
|
2024-10-08 17:09:28 +00:00
|
|
|
[tool.pyproject-fmt]
|
|
|
|
max_supported_python = "3.13"
|
|
|
|
|
2023-06-20 16:03:16 +00:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
markers = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"mat_ops: mark a test as utilizing matrix operations.",
|
2023-06-20 16:03:16 +00:00
|
|
|
]
|
|
|
|
addopts = [
|
2024-05-14 11:38:55 +00:00
|
|
|
"--durations=10",
|
|
|
|
"--doctest-modules",
|
|
|
|
"--showlocals",
|
2023-06-20 16:03:16 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
[tool.coverage.report]
|
2023-10-15 15:16:56 +00:00
|
|
|
omit = [
|
|
|
|
".env/*",
|
2024-05-14 11:38:55 +00:00
|
|
|
"project_euler/*",
|
2023-10-15 15:16:56 +00:00
|
|
|
]
|
2023-06-20 16:03:16 +00:00
|
|
|
sort = "Cover"
|
2024-10-08 17:09:28 +00:00
|
|
|
|
|
|
|
[tool.sphinx-pyproject]
|
|
|
|
copyright = "2014, TheAlgorithms"
|
|
|
|
autoapi_dirs = [
|
|
|
|
"audio_filters",
|
|
|
|
"backtracking",
|
|
|
|
"bit_manipulation",
|
|
|
|
"blockchain",
|
|
|
|
"boolean_algebra",
|
|
|
|
"cellular_automata",
|
|
|
|
"ciphers",
|
|
|
|
"compression",
|
|
|
|
"computer_vision",
|
|
|
|
"conversions",
|
|
|
|
"data_structures",
|
|
|
|
"digital_image_processing",
|
|
|
|
"divide_and_conquer",
|
|
|
|
"dynamic_programming",
|
|
|
|
"electronics",
|
|
|
|
"file_transfer",
|
|
|
|
"financial",
|
|
|
|
"fractals",
|
|
|
|
"fuzzy_logic",
|
|
|
|
"genetic_algorithm",
|
|
|
|
"geodesy",
|
|
|
|
"geometry",
|
|
|
|
"graphics",
|
|
|
|
"graphs",
|
|
|
|
"greedy_methods",
|
|
|
|
"hashes",
|
|
|
|
"knapsack",
|
|
|
|
"linear_algebra",
|
|
|
|
"linear_programming",
|
|
|
|
"machine_learning",
|
|
|
|
"maths",
|
|
|
|
"matrix",
|
|
|
|
"networking_flow",
|
|
|
|
"neural_network",
|
|
|
|
"other",
|
|
|
|
"physics",
|
|
|
|
"project_euler",
|
|
|
|
"quantum",
|
|
|
|
"scheduling",
|
|
|
|
"searches",
|
|
|
|
"sorts",
|
|
|
|
"strings",
|
|
|
|
"web_programming",
|
|
|
|
]
|
|
|
|
autoapi_member_order = "groupwise"
|
|
|
|
# autoapi_python_use_implicit_namespaces = true
|
|
|
|
exclude_patterns = [
|
|
|
|
".*/*",
|
|
|
|
"docs/",
|
|
|
|
]
|
|
|
|
extensions = [
|
|
|
|
"autoapi.extension",
|
|
|
|
"myst_parser",
|
|
|
|
]
|
|
|
|
html_static_path = [ "_static" ]
|
|
|
|
html_theme = "alabaster"
|
|
|
|
myst_enable_extensions = [
|
|
|
|
"amsmath",
|
|
|
|
"attrs_inline",
|
|
|
|
"colon_fence",
|
|
|
|
"deflist",
|
|
|
|
"dollarmath",
|
|
|
|
"fieldlist",
|
|
|
|
"html_admonition",
|
|
|
|
"html_image",
|
|
|
|
# "linkify",
|
|
|
|
"replacements",
|
|
|
|
"smartquotes",
|
|
|
|
"strikethrough",
|
|
|
|
"substitution",
|
|
|
|
"tasklist",
|
|
|
|
]
|
|
|
|
myst_fence_as_directive = [
|
|
|
|
"include",
|
|
|
|
]
|
|
|
|
templates_path = [ "_templates" ]
|
|
|
|
[tool.sphinx-pyproject.source_suffix]
|
|
|
|
".rst" = "restructuredtext"
|
|
|
|
# ".txt" = "markdown"
|
|
|
|
".md" = "markdown"
|