Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
240 changes: 120 additions & 120 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,124 +1,70 @@
[tool.ruff]
exclude = ["test_*.py"]
line-length = 121

[tool.ruff.lint]
ignore = ["ANN002", "ANN003", "ANN401", "C901", "D100", "D104", "D401", "D406", "C408"]
select = ["A", "C", "CPY", "D", "E", "ERA", "F", "FIX", "I", "N", "SIM", "T20", "W", "FA"]
preview = true # enable preview features for copyright checking

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["ERA", "CPY", "T"] # commented out code is intended for tutorials
"tests/*" = ["T20", "CPY"] # print statements are intended for tests
"docs/*" = ["CPY"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.flake8-copyright]
author = "- Pruna AI GmbH"

[tool.mypy]
ignore_missing_imports = true

[tool.poetry]
[project]
name = "pruna"
version = "0.2.5"
description = "Smash your AI models"
authors = ["Pruna AI <hello@pruna.ai>"]
license = "All Rights Reserved"

# **Include only .so files in the built distributions**
include = ["**/*.so"]

# **Exclude specific files or directories from the built distributions**
exclude = [
"tests*",
"docs*",
authors = [{ name = "Pruna AI", email = "hello@pruna.ai" }]
requires-python = ">=3.9,<3.13"
license = "Apache-2.0"
dependencies = [
"wget",
"torch==2.7.0",
"torchvision==0.22.0",
"torchmetrics[image]",
"requests>=2.31.0",
"transformers",
"pillow>=9.5.0",
"pytorch-lightning",
"huggingface-hub[hf-xet]>=0.30.0",
"datasets>=0.34",
"jsonschema",
"numpy>=1.24.4",
"setuptools",
"packaging",
"diffusers>=0.21.4",
"platformdirs",
"torch_pruning",
"python-dotenv",
"ConfigSpace>=1.2.1",
"cython",
"lago-python-client",
"sentencepiece",
"blobfile",
"librosa",
"openvino",
"soundfile",
"ipywidgets>=8.1.5",
"DeepCache",
"colorama",
"protobuf",
"peft",
"optuna",
"trl",
"opentelemetry-api>=1.30.0",
"opentelemetry-sdk>=1.30.0",
"opentelemetry-exporter-otlp>=1.29.0",
"codecarbon",
"pynvml",
"thop",
"timm",
"bitsandbytes",
"optimum-quanto>=0.2.5",
"optimum",
"ctranslate2==4.5.0",
"whisper-s2t==1.3.0",
"hqq",
"torchao",
"llmcompressor",
]

[tool.poetry.dependencies]
python = ">=3.9,<3.13"
wget = "*"
torch = "2.7.0"
torchvision = "0.22.0"
torchmetrics = { version = "*", extras = ["image"] }
requests = ">=2.31.0"
transformers = "*"
pillow = ">=9.5.0"
pytorch-lightning = "*"
huggingface-hub = { version = ">=0.30.0", extras = ["hf-xet"] }
datasets = ">=0.34"
jsonschema = "*"
numpy = ">=1.24.4"
setuptools = "*"
packaging = "*"
diffusers = ">=0.21.4"
platformdirs = "*"
torch_pruning = "*"
python-dotenv = "*"
ConfigSpace = ">=1.2.1"
cython = "*" # Consider removing if Cython is only needed for building
lago-python-client = "*"
sentencepiece = "*"
blobfile = "*"
librosa = "*"
openvino = "*"
soundfile = "*"
ipywidgets = ">=8.1.5"
DeepCache = "*"
colorama = "*"
protobuf = "*"
peft = "*"
optuna = "*"
trl = "*"
opentelemetry-api = ">=1.30.0"
opentelemetry-sdk = ">=1.30.0"
opentelemetry-exporter-otlp = ">=1.29.0"
codecarbon = "*"
pynvml = "*"
thop = "*"
timm = "*"
bitsandbytes = "*"
optimum-quanto = ">=0.2.5"
optimum = "*"
ctranslate2 = "==4.5.0"
whisper-s2t = "==1.3.0"
hqq = "*"
torchao = "*"
llmcompressor = "*"
# Added Optional Dependencies from Extras
ruff = { version = "*", optional = true }
jupyterlab = { version = "*", optional = true }
notebook = { version = "*", optional = true }
pre-commit = { version = "*", optional = true }
build = { version = "*", optional = true }
twine = { version = "*", optional = true }
pyc-wheel = { version = "*", optional = true }
pytest-cov = { version = "*", optional = true }
coverage = { version = "*", optional = true }
pytest = { version = "7.4.4", optional = true }
docutils = { version = "*", optional = true }
xformers = { version = "==0.0.30", optional = true }
stable-fast-pruna = { version = "1.0.7", optional = true, markers = "extra == 'stable-fast' or extra == 'full'"}
numpydoc-validation = { version = "*", optional = true }
mypy = { version = "*", optional = true }
types-PyYAML = { version = "*", optional = true }
gptqmodel = { version = "*", optional = true }


[tool.poetry.extras]
[project.optional-dependencies]
stable-fast = [
"xformers",
"stable-fast-pruna",
]
# Note: You must first install the base package with ``pip install pruna`` before installing the GPTQ extension with ``pip install pruna[gptq]``
gptq = [
"gptqmodel",
"xformers==0.0.30",
"stable-fast-pruna==1.0.7 ; extra == 'stable-fast' or extra == 'full'",
]
gptq = ["gptqmodel"]
full = [
"xformers",
"stable-fast-pruna",
"xformers==0.0.30",
"stable-fast-pruna==1.0.7 ; extra == 'stable-fast' or extra == 'full'",
]
dev = [
"jupyterlab",
Expand All @@ -131,7 +77,7 @@ dev = [
"numpydoc-validation",
]
tests = [
"pytest",
"pytest==7.4.4",
"pytest-cov",
"coverage",
"docutils",
Expand All @@ -143,14 +89,68 @@ tests = [
]
cpu = []

[tool.ruff]
exclude = ["test_*.py"]
line-length = 121

[tool.ruff.lint]
ignore = [
"ANN002",
"ANN003",
"ANN401",
"C901",
"D100",
"D104",
"D401",
"D406",
"C408",
]
select = [
"A",
"C",
"CPY",
"D",
"E",
"ERA",
"F",
"FIX",
"I",
"N",
"SIM",
"T20",
"W",
"FA",
]
preview = true # enable preview features for copyright checking

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = ["ERA", "CPY", "T"] # commented out code is intended for tutorials
"tests/*" = ["T20", "CPY"] # print statements are intended for tests
"docs/*" = ["CPY"]

# TODO: ask pruna people together find a way for handling this
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need some help with this part

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hatch build took ages on my machine; while with uv it was instantaneous and it seems something is off 🤷

[tool.hatch.build.targets.sdist]
include = ["**/*.so"]
exclude = ["tests*", "docs*"]

[tool.hatch.build.targets.wheel]
include = ["**/*.so"]
exclude = ["tests*", "docs*"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.setuptools]
package-dir = {"" = "pruna"}
[tool.ruff.lint.flake8-copyright]
author = "- Pruna AI GmbH"

[tool.mypy]
ignore_missing_imports = true

[tool.setuptools.packages.find]
where = ["pruna"]
where = ["src"]
include = ["pruna"]
exclude = ["openai", "docker", "saved_model"]
exclude = ["openai", "docker", "saved_model"]
Loading