refiners/pyproject.toml

120 lines
2.8 KiB
TOML
Raw Permalink Normal View History

[project]
2023-08-04 13:28:41 +00:00
name = "refiners"
2023-10-20 16:04:55 +00:00
version = "0.2.0"
2023-08-04 13:28:41 +00:00
description = "The simplest way to train and run adapters on top of foundational models"
authors = [{ name = "The Finegrain Team", email = "bonjour@lagon.tech" }]
2023-08-04 13:28:41 +00:00
license = "MIT"
dependencies = [
"torch>=2.1.1",
"safetensors>=0.4.0",
"pillow>=10.1.0",
"jaxtyping>=0.2.23",
"packaging>=23.2",
]
2023-08-04 13:28:41 +00:00
readme = "README.md"
requires-python = ">= 3.10"
2023-08-04 13:28:41 +00:00
[project.optional-dependencies]
training = [
"bitsandbytes>=0.41.2.post2",
"pydantic>=2.5.2",
"prodigyopt>=1.0",
"torchvision>=0.16.1",
"loguru>=0.7.2",
"wandb>=0.16.0",
"datasets>=2.15.0",
2023-12-15 17:02:32 +00:00
"tomli>=2.0.1",
]
test = [
"diffusers>=0.24.0",
"transformers>=4.35.2",
"piq>=0.8.0",
"invisible-watermark>=0.2.0",
"torchvision>=0.16.1",
# An unofficial Python package for Meta AI's Segment Anything Model:
# https://github.com/opengeos/segment-anything
"segment-anything-py>=1.0",
]
conversion = [
"diffusers>=0.24.0",
"transformers>=4.35.2",
"segment-anything-py>=1.0",
"requests>=2.26.0",
"tqdm>=4.62.3",
]
2023-08-04 13:28:41 +00:00
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
2023-08-04 13:28:41 +00:00
[tool.rye]
managed = true
dev-dependencies = [
"pyright==1.1.349",
"ruff>=0.1.15",
"docformatter>=1.7.5",
"pytest>=8.0.0",
"mkdocs-material>=9.5.6",
2024-01-27 15:10:31 +00:00
"coverage>=7.4.1",
"mkdocstrings[python]>=0.24.0",
]
[tool.hatch.metadata]
allow-direct-references = true
[tool.rye.scripts]
lint = { chain = ["ruff format .", "ruff --fix ."] }
serve-docs = "mkdocs serve"
2024-01-27 18:32:40 +00:00
test-cov = "coverage run -m pytest"
# Work around for "Couldn't parse" errors due to e.g. opencv-python:
# https://github.com/nedbat/coveragepy/issues/1653
build-html-cov = { cmd = "coverage html", env = { PYTHONWARNINGS = "ignore:Couldn't parse::coverage.report_core" } }
serve-cov-report = { chain = ["build-html-cov", "python -m http.server 8080 -b 127.0.0.1 -d htmlcov"]}
2023-08-04 13:28:41 +00:00
[tool.black]
line-length = 120
[tool.ruff]
src = ["src"] # see https://docs.astral.sh/ruff/settings/#src
select = [
2024-01-27 18:33:55 +00:00
"I", # isort
]
2023-08-04 13:28:41 +00:00
ignore = [
"F722", # forward-annotation-syntax-error, because of Jaxtyping
"E731", # do-not-assign-lambda
2023-08-04 13:28:41 +00:00
]
line-length = 120
[tool.ruff.lint.isort]
# Allow this kind of import on a single line:
#
# from torch import device as Device, dtype as DType
#
combine-as-imports = true
[tool.docformatter]
black = true
2023-08-04 13:28:41 +00:00
[tool.pyright]
include = ["src/refiners", "tests", "scripts"]
2023-08-16 09:17:55 +00:00
strict = ["*"]
exclude = ["**/__pycache__", "tests/weights"]
2023-08-04 13:28:41 +00:00
reportMissingTypeStubs = "warning"
2024-01-27 18:32:40 +00:00
[tool.coverage.run]
branch = true
source = ["src/refiners"]
2024-01-27 18:32:40 +00:00
# Also apply to HTML output, where appropriate
[tool.coverage.report]
ignore_errors = true # see `build-html-cov` for details
exclude_also = [
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]