| [build-system] | |
| build-backend = "setuptools.build_meta" | |
| requires = ["setuptools>=61"] | |
| [dependency-groups] | |
| dev = ["labbench[dev]"] | |
| [project] | |
| classifiers = [ | |
| "Operating System :: OS Independent", | |
| "Programming Language :: Python :: 3 :: Only", | |
| "Programming Language :: Python :: 3.10", | |
| "Programming Language :: Python :: 3.11", | |
| "Programming Language :: Python :: 3.12", | |
| "Programming Language :: Python" | |
| ] | |
| name = "labbench" | |
| version = "0.1.0" | |
| dependencies = [ | |
| "anthropic", | |
| "chembench", | |
| "datasets", | |
| "google-auth>=2.31", # Pin for py.typed | |
| "openai~=1.0", | |
| "pydantic~=2.0", | |
| "python-dotenv", | |
| "Pillow", | |
| "tenacity", | |
| "tqdm", | |
| "vertexai" | |
| ] | |
| requires-python = ">=3.10" | |
| [project.optional-dependencies] | |
| dev = [ | |
| "mypy>=1.8", # Pin for mutable-override | |
| "pre-commit>=3.4", # Pin to keep recent | |
| "pytest", | |
| "pytest-xdist", | |
| "types-tqdm" | |
| ] | |
| [project.urls] | |
| issues = "https://github.com/Future-House/LAB-Bench/issues" | |
| repository = "https://github.com/Future-House/LAB-Bench" | |
| [tool.black] | |
| preview = true | |
| [tool.mypy] | |
| # Type-checks the interior of functions without type annotations. | |
| check_untyped_defs = true | |
| # Allows enabling one or multiple error codes globally. Note: This option will | |
| # override disabled error codes from the disable_error_code option. | |
| enable_error_code = [ | |
| "ignore-without-code", | |
| "mutable-override", | |
| "redundant-cast", | |
| "redundant-expr", | |
| "redundant-self", | |
| "truthy-bool", | |
| "truthy-iterable", | |
| "unimported-reveal", | |
| "unreachable", | |
| "unused-ignore" | |
| ] | |
| # Shows a short summary line after error messages. | |
| error_summary = false | |
| # A regular expression that matches file names, directory names and paths which mypy | |
| # should ignore while recursively discovering files to check. Use forward slashes (/) as | |
| # directory separators on all platforms. | |
| exclude = [ | |
| "^\\.?venv" # SEE: https://regex101.com/r/0rp5Br/1 | |
| ] | |
| # This flag tells mypy that top-level packages will be based in either the current | |
| # directory, or a member of the MYPYPATH environment variable or mypy_path config | |
| # option. This option is only useful in the absence of __init__.py. See Mapping file | |
| # paths to modules for details. | |
| explicit_package_bases = true | |
| # Specifies the OS platform for the target program, for example darwin or win32 | |
| # (meaning OS X or Windows, respectively). The default is the current platform | |
| # as revealed by Python’s sys.platform variable. | |
| platform = "linux" | |
| # Comma-separated list of mypy plugins. | |
| plugins = ["pydantic.mypy"] | |
| # Use visually nicer output in error messages: use soft word wrap, show source | |
| # code snippets, and show error location markers. | |
| pretty = true | |
| # Shows column numbers in error messages. | |
| show_column_numbers = true | |
| # Shows error codes in error messages. | |
| # SEE: https://mypy.readthedocs.io/en/stable/error_codes.html#error-codes | |
| show_error_codes = true | |
| # Prefixes each error with the relevant context. | |
| show_error_context = true | |
| # Warns about casting an expression to its inferred type. | |
| warn_redundant_casts = true | |
| # Shows a warning when encountering any code inferred to be unreachable or | |
| # redundant after performing type analysis. | |
| warn_unreachable = true | |
| # Warns about per-module sections in the config file that do not match any | |
| # files processed when invoking mypy. | |
| warn_unused_configs = true | |
| # Warns about unneeded `# type: ignore` comments. | |
| warn_unused_ignores = true | |
| [[tool.mypy.overrides]] | |
| # Suppresses error messages about imports that cannot be resolved. | |
| ignore_missing_imports = true | |
| # Per-module configuration options | |
| module = [ | |
| "chembench.*", # SEE: https://github.com/lamalab-org/chembench/issues/485 | |
| "datasets", # SEE: https://github.com/huggingface/datasets/issues/3841 | |
| "vertexai" | |
| ] | |
| [tool.pytest.ini_options] | |
| testpaths = ["tests"] | |
| [tool.ruff] | |
| # Line length to use when enforcing long-lines violations (like `E501`). | |
| line-length = 120 | |
| # Enable application of unsafe fixes. | |
| unsafe-fixes = true | |
| [tool.ruff.format] | |
| # Enable reformatting of code snippets in docstrings. | |
| docstring-code-format = true | |
| # Enable preview style formatting. | |
| preview = true | |
| [tool.ruff.lint] | |
| explicit-preview-rules = true | |
| extend-select = [ | |
| "A006", | |
| "ASYNC116", | |
| "B901", | |
| "B909", | |
| "C420", | |
| "DOC202", | |
| "DOC403", | |
| "DTZ901", | |
| "E111", | |
| "E112", | |
| "E113", | |
| "E114", | |
| "E115", | |
| "E116", | |
| "E117", | |
| "E201", | |
| "E202", | |
| "E203", | |
| "E204", | |
| "E211", | |
| "E221", | |
| "E222", | |
| "E223", | |
| "E224", | |
| "E225", | |
| "E226", | |
| "E227", | |
| "E228", | |
| "E231", | |
| "E241", | |
| "E242", | |
| "E251", | |
| "E252", | |
| "E261", | |
| "E262", | |
| "E265", | |
| "E266", | |
| "E271", | |
| "E272", | |
| "E273", | |
| "E274", | |
| "E275", | |
| "E301", | |
| "E302", | |
| "E303", | |
| "E304", | |
| "E305", | |
| "E306", | |
| "E502", | |
| "FURB101", | |
| "FURB103", | |
| "FURB110", | |
| "FURB113", | |
| "FURB116", | |
| "FURB118", | |
| "FURB131", | |
| "FURB132", | |
| "FURB140", | |
| "FURB142", | |
| "FURB145", | |
| "FURB148", | |
| "FURB152", | |
| "FURB154", | |
| "FURB156", | |
| "FURB157", | |
| "FURB164", | |
| "FURB166", | |
| "FURB171", | |
| "FURB180", | |
| "FURB188", | |
| "FURB189", | |
| "FURB192", | |
| "LOG015", | |
| "PLC1901", | |
| "PLC2801", | |
| "PLE0304", | |
| "PLE1141", | |
| "PLR6104", | |
| "PLE4703", | |
| "PLR6201", | |
| "PLW0108", | |
| "PYI059", | |
| "RUF027", | |
| "RUF028", | |
| "RUF031", | |
| "RUF032", | |
| "RUF033", | |
| "RUF034", | |
| "RUF035", | |
| "RUF036", | |
| "RUF038", | |
| "RUF039", | |
| "RUF048", | |
| "SIM905", | |
| "UP042", | |
| "UP044", | |
| "W391" | |
| ] | |
| # List of rule codes that are unsupported by Ruff, but should be preserved when | |
| # (e.g.) validating # noqa directives. Useful for retaining # noqa directives | |
| # that cover plugins not yet implemented by Ruff. | |
| external = [ | |
| "FURB" # refurb | |
| ] | |
| ignore = [ | |
| "ANN", # Don't care to enforce typing | |
| "ARG002", # Thrown all the time when we are subclassing | |
| "ARG003", # Thrown all the time when we are subclassing | |
| "ASYNC109", # Buggy, SEE: https://github.com/astral-sh/ruff/issues/12353 | |
| "ASYNC2", # It's ok to mix async and sync ops (like opening a file) | |
| "B023", | |
| "BLE001", # Don't care to enforce blind exception catching | |
| "C901", # we can be complex | |
| "COM812", # Trailing comma with black leads to wasting lines | |
| "D100", # D100, D101, D102, D103, D104, D105, D106, D107: don't always need docstrings | |
| "D101", | |
| "D102", | |
| "D103", | |
| "D104", | |
| "PLR0913", | |
| "D105", | |
| "D106", | |
| "D107", | |
| "D203", # Keep docstring next to the class definition (covered by D211) | |
| "D212", # Summary should be on second line (opposite of D213) | |
| "D402", # It's nice to reuse the method name | |
| "D406", # Google style requires ":" at end | |
| "D407", # We aren't using numpy style | |
| "D413", # Blank line after last section. -> No blank line | |
| "DTZ", # Don't care to have timezone safety | |
| "EM", # Overly pedantic | |
| "ERA001", # Don't care to prevent commented code | |
| "FBT001", # FBT001, FBT002: overly pedantic | |
| "FBT002", | |
| "FIX", # Don't care to prevent TODO, FIXME, etc. | |
| "FLY002", # Can be less readable | |
| "G004", # f-strings are convenient | |
| "INP001", # Can use namespace packages | |
| "ISC001", # For ruff format compatibility | |
| "N803", # Allow matching math formula names/conventions | |
| "N806", # Allow matching math formula names/conventions | |
| "PLC0415", # Don't care to prevent imports outside of top-level | |
| "PLR0912", # Allow us to have lots of branches | |
| "PLR0915", # we can write lots of code | |
| "PLR0913", | |
| "PLR6104", # Moving to __iadd__ risks ldp graph manipulation | |
| "PLW2901", # Allow modifying loop variables | |
| "PTH", # Overly pedantic | |
| "RUF027", # Prompt templates may not be f-strings | |
| "S101", # Don't care to prevent asserts | |
| "S105", # Duplicates Yelp/detect-secrets in pre-commit | |
| "S311", # Ok to use python random | |
| "SLF001", # Overly pedantic | |
| "T201", # Overly pedantic | |
| "TC001", # TC001, TC002, TC003: don't care to enforce type checking blocks | |
| "TC002", | |
| "TC003", | |
| "TD002", # Don't care for TODO author | |
| "TD003", # Don't care for TODO links | |
| "TRY003" # Overly pedantic | |
| ] | |
| preview = true | |
| select = ["ALL"] | |
| unfixable = [ | |
| "B007", # While debugging, unused loop variables can be useful | |
| "B905", # Default fix is zip(strict=False), but that can hide bugs | |
| "ERA001", # While debugging, temporarily commenting code can be useful | |
| "F401", # While debugging, unused imports can be useful | |
| "F841", # While debugging, unused locals can be useful | |
| "TC004" # While debugging, it can be nice to keep TYPE_CHECKING in tact | |
| ] | |
| [tool.ruff.lint.flake8-annotations] | |
| mypy-init-return = true | |
| [tool.ruff.lint.per-file-ignores] | |
| "**/tests/*.py" = [ | |
| "N802", # Tests function names can match class names | |
| "PLR2004", # Tests can have magic values | |
| "S101" # Tests can have assertions | |
| ] | |
| [tool.ruff.lint.pycodestyle] | |
| # The maximum line length to allow for line-length violations within | |
| # documentation (W505), including standalone comments. | |
| max-doc-length = 120 # Match line-length | |
| [tool.ruff.lint.pydocstyle] | |
| # Whether to use Google-style or NumPy-style conventions or the PEP257 | |
| # defaults when analyzing docstring sections. | |
| convention = "google" | |
| [tool.setuptools.packages.find] | |
| include = ["labbench*"] | |