|
| 1 | +[build-system] |
| 2 | +requires = [ |
| 3 | + # pin NumPy version used in the build |
| 4 | + "oldest-supported-numpy", |
| 5 | + "setuptools>=65.0.0", |
| 6 | +] |
| 7 | +build-backend = "setuptools.build_meta" |
| 8 | + |
| 9 | +[tool.versioningit.vcs] |
| 10 | +method = "git" |
| 11 | +default-tag = "0.0.1" |
| 12 | + |
| 13 | +[tool.black] |
| 14 | +line-length = 120 |
| 15 | + |
| 16 | +[tool.ruff] |
| 17 | +target-version = "py38" |
| 18 | +line-length = 120 |
| 19 | +select = [ |
| 20 | + "B", # flake8-bugbear |
| 21 | + "C4", # flake8-comprehensions |
| 22 | + "D", # pydocstyle |
| 23 | + "E", # pycodestyle error |
| 24 | + "EXE", # flake8-executable |
| 25 | + "F", # pyflakes |
| 26 | + "FA", # flake8-future-annotations |
| 27 | + "FLY", # flynt |
| 28 | + "I", # isort |
| 29 | + "ICN", # flake8-import-conventions |
| 30 | + "ISC", # flake8-implicit-str-concat |
| 31 | + "PD", # pandas-vet |
| 32 | + "PERF", # perflint |
| 33 | + "PIE", # flake8-pie |
| 34 | + "PL", # pylint |
| 35 | + "PT", # flake8-pytest-style |
| 36 | + "PYI", # flakes8-pyi |
| 37 | + "Q", # flake8-quotes |
| 38 | + "RET", # flake8-return |
| 39 | + "RSE", # flake8-raise |
| 40 | + "RUF", # Ruff-specific rules |
| 41 | + "SIM", # flake8-simplify |
| 42 | + "SLOT", # flake8-slots |
| 43 | + "TCH", # flake8-type-checking |
| 44 | + "TID", # tidy imports |
| 45 | + "TID", # flake8-tidy-imports |
| 46 | + "UP", # pyupgrade |
| 47 | + "W", # pycodestyle warning |
| 48 | + "YTT", # flake8-2020 |
| 49 | +] |
| 50 | +ignore = [ |
| 51 | + "B023", # Function definition does not bind loop variable |
| 52 | + "B028", # No explicit stacklevel keyword argument found |
| 53 | + "B904", # Within an except clause, raise exceptions with ... |
| 54 | + "C408", # unnecessary-collection-call |
| 55 | + "D105", # Missing docstring in magic method |
| 56 | + "D205", # 1 blank line required between summary line and description |
| 57 | + "D212", # Multi-line docstring summary should start at the first line |
| 58 | + "PD901", # pandas-df-variable-name |
| 59 | + "PERF203", # try-except-in-loop |
| 60 | + "PERF401", # manual-list-comprehension (TODO fix these or wait for autofix) |
| 61 | + "PLR", # pylint refactor |
| 62 | + "PLW2901", # Outer for loop variable overwritten by inner assignment target |
| 63 | + "PT013", # pytest-incorrect-pytest-import |
| 64 | + "RUF012", # Disable checks for mutable class args. This is a non-problem. |
| 65 | + "SIM105", # Use contextlib.suppress(OSError) instead of try-except-pass |
| 66 | +] |
| 67 | +pydocstyle.convention = "google" |
| 68 | +isort.required-imports = ["from __future__ import annotations"] |
| 69 | +isort.split-on-trailing-comma = false |
| 70 | + |
| 71 | +[tool.ruff.per-file-ignores] |
| 72 | +"__init__.py" = ["F401"] |
| 73 | +"*/tests/*" = ["D"] |
| 74 | +"tasks.py" = ["D"] |
| 75 | +"pymatgen/analysis/*" = ["D"] |
| 76 | +"pymatgen/vis/*" = ["D"] |
| 77 | +"pymatgen/io/*" = ["D"] |
| 78 | +"dev_scripts/*" = ["D"] |
| 79 | + |
| 80 | +[tool.pytest.ini_options] |
| 81 | +addopts = "--durations=30 --quiet -r xXs --color=yes -p no:warnings --import-mode=importlib" |
| 82 | + |
| 83 | +[tool.coverage.run] |
| 84 | +omit = ["pymatgen/cli"] |
| 85 | +relative_files = true |
| 86 | + |
| 87 | +[tool.coverage.report] |
| 88 | +exclude_lines = [ |
| 89 | + "@deprecated", |
| 90 | + "def __repr__", |
| 91 | + "if 0:", |
| 92 | + "if __name__ == .__main__.:", |
| 93 | + "if self.debug:", |
| 94 | + "if settings.DEBUG", |
| 95 | + "pragma: no cover", |
| 96 | + "raise AssertionError", |
| 97 | + "raise NotImplementedError", |
| 98 | +] |
| 99 | + |
| 100 | +[tool.mypy] |
| 101 | +ignore_missing_imports = true |
| 102 | +namespace_packages = true |
| 103 | +explicit_package_bases = true |
| 104 | +no_implicit_optional = false |
| 105 | + |
| 106 | +[[tool.mypy.overrides]] |
| 107 | +module = ["requests.*", "tabulate.*"] |
| 108 | +ignore_missing_imports = true |
| 109 | + |
| 110 | +[tool.codespell] |
| 111 | +ignore-words-list = """ |
| 112 | +titel,alls,ans,nd,mater,nwo,te,hart,ontop,ist,ot,fo,nax,coo,coul,ser,leary,thre, |
| 113 | +fase,rute,reson,titels,ges,scalr,strat,struc,hda,nin,ons,pres,kno,loos,lamda,lew |
| 114 | +""" |
| 115 | +check-filenames = true |
0 commit comments