Skip to content

Commit

Permalink
Add setup()
Browse files Browse the repository at this point in the history
  • Loading branch information
hebiao064 committed Dec 11, 2024
1 parent 0529166 commit 36e483c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@ description = "Efficient Triton kernels for LLM Training"
urls = { "Homepage" = "https://github.com/linkedin/Liger-Kernel" }
readme = { file = "README.md", content-type = "text/markdown" }
license = { file = "LICENSE" }
dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {attr = "setup.get_default_dependencies"}
optional-dependencies = {attr = "setup.get_optional_dependencies"}
[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["src"]
include = ["liger_kernel", "liger_kernel.*"]
include = ["liger_kernel*"]
namespaces = false

[tool.pytest.ini_options]
pythonpath = [
"src",
"."
]
pythonpath = ["src", "."]
asyncio_mode = "auto"
log_cli = true
log_cli_level = "INFO"
10 changes: 9 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import subprocess
from typing import Literal

from setuptools import setup

def get_default_dependencies():
"""Determine the appropriate dependencies based on detected hardware."""
Expand Down Expand Up @@ -73,3 +73,11 @@ def _get_platform() -> Literal["cuda", "rocm", "cpu"]:
return "rocm"
except (subprocess.SubprocessError, FileNotFoundError):
return "cpu"

setup(
name="liger_kernel",
package_dir={"": "src"},
packages=["liger_kernel"],
install_requires=get_default_dependencies(),
extras_require=get_optional_dependencies(),
)

0 comments on commit 36e483c

Please sign in to comment.