Skip to content

Commit

Permalink
Adding setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
parkervg committed Feb 7, 2024
1 parent c56ac4a commit cc18a8f
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 37 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
proxies.py
outputs/
research/db/
*.crt
Expand Down
1 change: 0 additions & 1 deletion blend

This file was deleted.

7 changes: 3 additions & 4 deletions blendsql/blend-cli.py → blendsql/blend_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ def cls():
os.system("cls" if os.name == "nt" else "clear")


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser()
parser.add_argument("db_path", nargs="?")
parser.add_argument("--secrets_path", default="./secrets.json")
parser.add_argument("secrets_path", nargs="?", default="./secrets.json")
args = parser.parse_args()

init_secrets(args.secrets_path)
Expand All @@ -56,7 +56,7 @@ def cls():
ingredients={LLMQA, LLMMap, LLMJoin, DT},
overwrite_args={"endpoint": "gpt-4", "long_answer": False},
infer_map_constraints=True,
verbose=True
verbose=True,
)
print()
print(
Expand All @@ -70,4 +70,3 @@ def cls():
print()
except Exception as error:
print(error)
pass
1 change: 1 addition & 0 deletions blendsql/db/sqlite_db_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,5 @@ def _create_clause(con, tablename) -> str:
logging.debug(
f"Expected create_clause size to be 1, got {create_clause.size}\n{create_clause}"
)
return ""
return create_clause.values[0][0]
32 changes: 0 additions & 32 deletions requirements.txt

This file was deleted.

70 changes: 70 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import os
import re
import codecs
from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))


def read(*parts):
with codecs.open(os.path.join(here, *parts), "r") as fp:
return fp.read()


def find_version(*file_paths):
version_file = read(*file_paths)
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")


setup(
entry_points={
"console_scripts": ["blendsql=blendsql.blend_cli:main"],
},
name="blendsql",
version=find_version("blendsql", "__init__.py"),
url="https://github.com/parkervg/blendsql",
author="Parker Glenn",
author_email="[email protected]",
description="A scalable SQL dialect for problem decomposition and heterogenous question-answering with LLMs.",
license="Apache License 2.0",
packages=find_packages(exclude=["examples", "research", "img"]),
install_requires=[
"openai==0.28.0",
"guidance==0.0.64",
"pyparsing==3.1.1",
"pandas>=2.0.0",
"bottleneck>=1.3.6",
"sqlglot",
"pre-commit",
"attrs",
"tqdm",
"dateparser",
"colorama",
"fiscalyear",
"tabulate",
"typeguard",
"azure-identity",
"nbformat",
],
extras_require={
"research": [
"datasets==2.16.1",
"nltk",
"wikiextractor",
"rouge_score",
"rapidfuzz",
"records",
"SQLAlchemy",
"recognizers-text",
"recognizers-text-suite",
"emoji==1.7.0",
"transformers",
],
"test": [
"pytest",
],
},
)

0 comments on commit cc18a8f

Please sign in to comment.