[project] name = "read_aconity_layers" description = "A utility for fast reading of layer data from the aconity mini powder bed fusion machine" requires-python = ">=3.11" classifiers = [ "Programming Language :: Rust", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ] authors = [{ name = "Cian Hughes", email = "chughes000@gmail.com" }] license = { text = "MIT" } readme = "README.rst" dynamic = ["version"] [project.urls] github = "https://github.com/Cian-H/read_aconity_layers" [tool.poetry] name = "read_aconity_layers" description = "A utility for fast reading of layer data from the aconity mini powder bed fusion machine" authors = ["Cian Hughes "] license = "MIT" readme = "README.rst" package-mode = false [tool.poetry.dependencies] python = "^3.11" maturin = "^1.8.6" numpy = ">=2.0.0,<3.0.0" [tool.poetry.group.dev.dependencies] ruff = "^0.11.11" mypy = "^1.15.0" pytest = "^8.3.5" loguru = "^0.7.3" pytest-cov = "^6.1.1" [tool.poetry.group.docs.dependencies] sphinx = "^8.2.3" sphinx-autodoc-typehints = "^3.2.0" sphinx-copybutton = "^0.5.2" sphinxcontrib-rust = "^0.8.1" myst-parser = "^4.0.1" sphinx-autobuild = "^2024.10.3" pydata-sphinx-theme = "^0.16.1" [build-system] requires = ["maturin>=1.7,<2.0"] build-backend = "maturin" [tool.maturin] module-name = "read_aconity_layers" features = ["pyo3/extension-module"] [tool.ruff] line-length = 100 target-version = "py312" exclude = ["docs/", "tests/"] [tool.ruff.lint] # Configure ruff to be *heavily* opinionated. We want to enforce a consistent style across all code. # Enable checks for pydocstyle (`D`), pycodestyle (`E`, `W`), Pyflakes (`F`), McCabe Complexity (C90) # isort (`I`), pep8 naming (`N`), flake8 (`A`, `ANN`, `B`, `C4`, `EM`, `FBT`, `ICN`, `INT`, `ISC`, `PT`, # `PTH`, `RET`, `SIM`, `TC`, and `TID`), perflint (`PERF`), numpy rules (`NPY`), pandas # rules (`PD`), pylint (`PL`), ruff rules (`RUF`). select = [ "D", "E", "W", "F", "C90", "I", "N", "A", "ANN", "B", "C4", "EM", "FBT", "ICN", "INT", "ISC", "PT", "PTH", "RET", "SIM", "TC", "TID", "PERF", "NPY", "PD", "PL", "RUF", ] # Reasons for disabling certain rules: # - PD002: despite its problems we need to use inplace operations for performance reasons. # - ANN002: as much as i'd like to enforce this using `TypedDict`s and a `__kwargs__` # dunder, it would tightly couple us to external libraries. # - ANN003: same as above. # - PLR0913: as nice as smaller functions are for maintenance and readability, this rule # is unenforceable in such a data-heavy library. # - PLR0914: same as above. # - PLR0917: same as above. # - TC001: the `TYPE_CHECKING` blocks either don't work or i'm too stupid to get them to work. # - TC002: same as above. # - TC003: same as above. # - ISC001: Personally, i really like this rule but apparently it can cause issues with the ruff formatter. ignore = [ "PD002", "ANN002", "ANN003", "PLR0913", # "PLR0914", # "PLR0917", "TC001", "TC002", "TC003", "ISC001", ] # Allow autofix for all enabled rules (when `--fix`) is provided. fixable = [ "A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W", "ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TC", "TID", "TRY", "UP", "YTT", ] unfixable = [] exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".hg", ".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv", ".vscode", "docs", ] # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" extend-select = ["I"] [tool.ruff.lint.isort] force-sort-within-sections = true lines-after-imports = -1 [tool.ruff.lint.pydocstyle] convention = "google" [tool.ruff.format] quote-style = "double" indent-style = "space" line-ending = "auto" [tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 [tool.ruff.lint.flake8-annotations] mypy-init-return = true [tool.mypy] check_untyped_defs = true ignore_missing_imports = true exclude = ["docs/", "tests/"] [tool.pytest.ini_options] testpaths = ["tests"] pythonpath = [".venv/bin/python"]