mirror of
https://github.com/MadcowD/ell.git
synced 2024-09-22 16:14:36 +03:00
switch to poetry
This commit is contained in:
21
Makefile
Normal file
21
Makefile
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
.PHONY: install npm-install npm-build
|
||||||
|
|
||||||
|
install: npm-install npm-build
|
||||||
|
|
||||||
|
npm-install:
|
||||||
|
@echo "Running npm install"
|
||||||
|
cd ell-studio && npm install
|
||||||
|
|
||||||
|
npm-build:
|
||||||
|
@echo "Running npm build"
|
||||||
|
cd ell-studio && npm run build
|
||||||
|
@echo "Copying static files"
|
||||||
|
python -c "import os, shutil; \
|
||||||
|
source_dir = os.path.join('ell-studio', 'build'); \
|
||||||
|
target_dir = os.path.join('src', 'ell', 'studio', 'static'); \
|
||||||
|
shutil.rmtree(target_dir, ignore_errors=True); \
|
||||||
|
shutil.copytree(source_dir, target_dir); \
|
||||||
|
print(f'Copied static files from {source_dir} to {target_dir}')"
|
||||||
|
|
||||||
|
test:
|
||||||
|
poetry run pytest -vvv
|
||||||
1510
poetry.lock
generated
Normal file
1510
poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
56
pyproject.toml
Normal file
56
pyproject.toml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
[tool.poetry]
|
||||||
|
name = "ell"
|
||||||
|
version = "0.0.1"
|
||||||
|
description = "ell - a functional language model programming framework"
|
||||||
|
authors = ["William Guss <will@lrsys.xyz>"]
|
||||||
|
license = "MIT"
|
||||||
|
readme = "README.md"
|
||||||
|
repository = "https://github.com/MadcowD/ell-studio"
|
||||||
|
packages = [
|
||||||
|
{ include = "ell", from = "src" }
|
||||||
|
]
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 3 - Alpha",
|
||||||
|
"Intended Audience :: Developers",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"Programming Language :: Python :: 3.8",
|
||||||
|
"Programming Language :: Python :: 3.9"
|
||||||
|
]
|
||||||
|
include = ["ell.studio/static/*", "ell.studio/static/**/*"]
|
||||||
|
|
||||||
|
[tool.poetry.dependencies]
|
||||||
|
python = ">=3.9,<=3.12"
|
||||||
|
fastapi = "^0.111.1"
|
||||||
|
numpy = "^2.0.1"
|
||||||
|
dill = "^0.3.8"
|
||||||
|
colorama = "^0.4.6"
|
||||||
|
cattrs = "^23.2.3"
|
||||||
|
openai = "^1.37.1"
|
||||||
|
sqlmodel = "^0.0.21"
|
||||||
|
uvicorn = "^0.30.3"
|
||||||
|
requests = "^2.32.3"
|
||||||
|
typing-extensions = "^4.12.2"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry.group.dev.dependencies]
|
||||||
|
pytest = "^8.3.2"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["poetry-core"]
|
||||||
|
build-backend = "poetry.core.masonry.api"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[tool.poetry.scripts]
|
||||||
|
ell-studio = "ell.studio.__main__:main"
|
||||||
|
|
||||||
|
[tool.poetry.extras]
|
||||||
|
npm_install = ["invoke"]
|
||||||
|
npm_build = ["invoke"]
|
||||||
|
|
||||||
|
[tool.poetry.dev-dependencies]
|
||||||
|
invoke = "^1.6.0"
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
fastapi
|
|
||||||
numpy
|
|
||||||
dill
|
|
||||||
colorama
|
|
||||||
cattrs
|
|
||||||
openai
|
|
||||||
fastapi
|
|
||||||
sqlmodel
|
|
||||||
uvicorn
|
|
||||||
requests
|
|
||||||
@@ -14,8 +14,8 @@ from typing import (
|
|||||||
Tuple,
|
Tuple,
|
||||||
Any,
|
Any,
|
||||||
Callable,
|
Callable,
|
||||||
override,
|
|
||||||
)
|
)
|
||||||
|
from typing_extensions import override
|
||||||
|
|
||||||
|
|
||||||
class lstr(str):
|
class lstr(str):
|
||||||
@@ -257,10 +257,9 @@ class lstr(str):
|
|||||||
|
|
||||||
# Check if the attribute is a callable and not defined in lstr class itself
|
# Check if the attribute is a callable and not defined in lstr class itself
|
||||||
|
|
||||||
|
|
||||||
if name == "__class__":
|
if name == "__class__":
|
||||||
return type(self)
|
return type(self)
|
||||||
|
|
||||||
if callable(attr) and name not in lstr.__dict__:
|
if callable(attr) and name not in lstr.__dict__:
|
||||||
|
|
||||||
def wrapped(*args: Any, **kwargs: Any) -> Any:
|
def wrapped(*args: Any, **kwargs: Any) -> Any:
|
||||||
@@ -279,7 +278,7 @@ class lstr(str):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
return wrapped
|
return wrapped
|
||||||
|
|
||||||
return attr
|
return attr
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
@@ -1,11 +1,11 @@
|
|||||||
"""
|
"""
|
||||||
Pytest for the LM function (mocks the openai api so we can pretend to generate completions through te typoical approach taken in the decorators (and adapters file.))
|
Pytest for the LM function (mocks the openai api so we can pretend to generate completions through the typical approach taken in the decorators (and adapters file.))
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from ell.decorators.lm import lm
|
from ell.decorators.lm import lm
|
||||||
import pytest
|
import pytest
|
||||||
from unittest.mock import patch, MagicMock
|
from unittest.mock import patch, MagicMock
|
||||||
from ell.decorators import DEFAULT_SYSTEM_PROMPT
|
from ell.util.lm import DEFAULT_SYSTEM_PROMPT
|
||||||
from ell.types import Message, LMPParams
|
from ell.types import Message, LMPParams
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user