|
| 1 | +[project] |
| 2 | +name = "torchinfo" |
| 3 | +description = "Model summary in PyTorch, based off of the original torchsummary." |
| 4 | +authors = [ |
| 5 | + { name = "Tyler Yep @tyleryep", email = "tyep@cs.stanford.edu" }, |
| 6 | +] |
| 7 | +readme = "README.md" |
| 8 | +classifiers = [ |
| 9 | + "Operating System :: OS Independent", |
| 10 | + "Programming Language :: Python :: 3", |
| 11 | + "Programming Language :: Python :: 3.6", |
| 12 | + "Programming Language :: Python :: 3.7", |
| 13 | + "Programming Language :: Python :: 3.8", |
| 14 | + "Programming Language :: Python :: 3.9", |
| 15 | + "Programming Language :: Python :: 3.10", |
| 16 | + "Programming Language :: Python :: 3.11", |
| 17 | + "Programming Language :: Python :: 3.12", |
| 18 | +] |
| 19 | +keywords = [ |
| 20 | + "torch pytorch torchsummary torch-summary summary keras deep-learning ml torchinfo torch-info visualize model statistics layer stats", |
| 21 | +] |
| 22 | +dynamic = [ |
| 23 | + "version", |
| 24 | +] |
| 25 | +requires-python = ">=3.8" |
| 26 | +dependencies = [ |
| 27 | + "torch", |
| 28 | + "torchvision", |
| 29 | + "numpy", |
| 30 | +] |
| 31 | + |
| 32 | +[dependency-groups] |
| 33 | +dev = [ |
| 34 | + "codecov", |
| 35 | + "mypy", |
| 36 | + "pre-commit", |
| 37 | + "pytest", |
| 38 | + "pytest-cov", |
| 39 | + "ruff", |
| 40 | + "transformers", |
| 41 | + "types-setuptools", |
| 42 | + "types-tqdm", |
| 43 | +] |
| 44 | + |
| 45 | +[project.urls] |
| 46 | +Homepage = "https://github.com/tyleryep/torchinfo" |
| 47 | + |
| 48 | +[build-system] |
| 49 | +requires = [ |
| 50 | + "setuptools>=61.2", |
| 51 | +] |
| 52 | +build-backend = "setuptools.build_meta" |
| 53 | + |
| 54 | +[tool.setuptools] |
| 55 | +packages = [ |
| 56 | + "torchinfo", |
| 57 | +] |
| 58 | +include-package-data = true |
| 59 | + |
| 60 | +[tool.setuptools.package-data] |
| 61 | +torchinfo = [ |
| 62 | + "py.typed", |
| 63 | +] |
| 64 | + |
| 65 | +[tool.setuptools.dynamic.version] |
| 66 | +attr = "torchinfo.__version__" |
| 67 | + |
| 68 | +[tool.mypy] |
| 69 | +strict = true |
| 70 | +warn_unreachable = true |
| 71 | +disallow_any_unimported = true |
| 72 | +extra_checks = true |
| 73 | +enable_error_code = "ignore-without-code" |
| 74 | + |
| 75 | +[tool.ruff] |
| 76 | +target-version = "py38" |
| 77 | +lint.select = ["ALL"] |
| 78 | +lint.ignore = [ |
| 79 | + "ANN401", # Dynamically typed expressions (typing.Any) are disallowed |
| 80 | + "C901", # function is too complex (12 > 10) |
| 81 | + "COM812", # Trailing comma missing |
| 82 | + "D", # Docstring rules |
| 83 | + "EM101", # Exception must not use a string literal, assign to variable first |
| 84 | + "EM102", # Exception must not use an f-string literal, assign to variable first |
| 85 | + "ERA001", # Found commented-out code |
| 86 | + "FBT001", # Boolean positional arg in function definition |
| 87 | + "FBT002", # Boolean default value in function definition |
| 88 | + "FBT003", # Boolean positional value in function call |
| 89 | + "FIX002", # Line contains TODO |
| 90 | + "PLR0911", # Too many return statements (11 > 6) |
| 91 | + "PLR2004", # Magic value used in comparison, consider replacing 2 with a constant variable |
| 92 | + "PLR0912", # Too many branches |
| 93 | + "PLR0913", # Too many arguments to function call |
| 94 | + "PLR0915", # Too many statements |
| 95 | + "S101", # Use of `assert` detected |
| 96 | + "S311", # Standard pseudo-random generators are not suitable for cryptographic purposes |
| 97 | + "T201", # print() found |
| 98 | + "T203", # pprint() found |
| 99 | + "TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` |
| 100 | + "TD003", # Missing issue link on the line following this TODO |
| 101 | + "TD005", # Missing issue description after `TODO` |
| 102 | + "TRY003", # Avoid specifying long messages outside the exception class |
| 103 | + |
| 104 | + # torchinfo-specific ignores |
| 105 | + "N803", # Argument name `A_i` should be lowercase |
| 106 | + "N806", # Variable `G` in function should be lowercase |
| 107 | + "BLE001", # Do not catch blind exception: `Exception` |
| 108 | + "PLW0602", # Using global for `_cached_forward_pass` but no assignment is done |
| 109 | + "PLW0603", # Using the global statement to update `_cached_forward_pass` is discouraged |
| 110 | + "PLW2901", # `for` loop variable `name` overwritten by assignment target |
| 111 | + "RUF005", # Consider unpack instead of concatenation |
| 112 | + "SIM108", # [*] Use ternary operator `model_mode = Mode.EVAL if mode is None else Mode(mode)` instead of `if`-`else`-block |
| 113 | + "SLF001", # Private member accessed: `_modules` |
| 114 | + "TC002", # Move third-party import into a type-checking block |
| 115 | + "TRY004", # Prefer `TypeError` exception for invalid type |
| 116 | + "TRY301", # Abstract `raise` to an inner function |
| 117 | +] |
| 118 | +exclude = ["tests"] # TODO: check tests too |
0 commit comments