diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml new file mode 100644 index 0000000000..138e421580 --- /dev/null +++ b/.github/workflows/build_package.yml @@ -0,0 +1,44 @@ +name: Build Package + +# Build package on its own without additional pip install + +on: + push: + branches: + - main + pull_request: + +env: + POETRY_VERSION: "1.6.1" + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9"] + steps: + - uses: actions/checkout@v3 + - name: Set up python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install Poetry + uses: snok/install-poetry@v1 + - name: Install dependencies + run: poetry install --no-root + - name: Build + shell: bash + run: poetry build + - name: Test installing built package + shell: bash + run: python -m pip install . + - name: Test import dspy + shell: bash + working-directory: ${{ vars.RUNNER_TEMP }} + run: python -c "import dspy" + - name: Test import dsp + shell: bash + working-directory: ${{ vars.RUNNER_TEMP }} + run: python -c "import dsp" + diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..ac712706d6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,119 @@ +[build-system] +requires = ["setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "dspy-ai" +version = "2.1.1" +description = "DSPy" +readme = "README.md" +authors = [{name = "Omar Khattab", email = "okhattab@stanford.edu"}] +license = {text = "MIT License"} +requires-python = ">=3.9, <3.12" +classifiers = [ + "Development Status :: 3 - Alpha", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Programming Language :: Python :: 3", # removed 3.8 + "Programming Language :: Python :: 3.9", +] +dependencies = [ + "backoff~=2.2.1", + "joblib~=1.3.2", + "openai~=0.28.1", + "pandas~=2.1.1", + "regex~=2023.10.3", + "ujson~=5.8.0", + "tqdm~=4.66.1", + "datasets~=2.14.6", + "requests~=2.31.0", + "optuna~=3.4.0", +] + +[project.optional-dependencies] +pinecone = ["pinecone-client~=2.2.4"] +qdrant = ["qdrant-client~=1.6.2", "fastembed~=0.1.0"] +chromadb = ["chromadb~=0.4.14"] +marqo = ["marqo"] +docs = [ + "sphinx>=4.3.0", + "furo>=2023.3.27", + "docutils<0.17", + "m2r2", + "myst-parser", + "myst-nb", + "sphinx-autobuild", + "sphinx_rtd_theme", + "pydantic<2.0.0", + "autodoc_pydantic", + "sphinx-reredirects>=0.1.2", + "sphinx-automodapi==0.16.0" +] + +[project.urls] +homepage = "https://github.com/stanfordnlp/dspy" + +[tool.poetry] +name = "dspy" +version = "2.0.8" +description = "DSPy" +authors = ["Omar Khattab "] +license = "MIT" +readme = "README.md" +homepage = "https://github.com/stanfordnlp/dspy" +repository = "https://github.com/stanfordnlp/dspy" +# documentation = "https://dspy-ai.readthedocs.io" +keywords = ["dspy", "ai", "language models", "llm", "openai"] +# may be a bit much + + +[tool.poetry.dependencies] +python = ">=3.9,<3.12" +backoff = "^2.2.1" +joblib = "^1.3.2" +openai = "^0.28.1" +pandas = "^2.1.1" +regex = "^2023.10.3" +ujson = "^5.8.0" +tqdm = "^4.66.1" +datasets = "^2.14.6" +requests = "^2.31.0" +optuna = "^3.4.0" +pinecone-client = {version = "^2.2.4", optional = true} +qdrant-client = {version = "^1.6.2", optional = true} +fastembed = {version = "^0.1.0", optional = true} +chromadb = {version = "^0.4.14", optional = true} +marqo = {version = "*", optional = true} +sphinx = {version = ">=4.3.0", optional = true} +furo = {version = ">=2023.3.27", optional = true} +docutils = {version = "<0.17", optional = true} +m2r2 = {version = "*", optional = true} +myst-parser = {version = "*", optional = true} +myst-nb = {version = "*", optional = true} +sphinx-autobuild = {version = "*", optional = true} +sphinx_rtd_theme = {version = "*", optional = true} +pydantic = {version = "*", optional = true} +autodoc_pydantic = {version = "*", optional = true} +sphinx-reredirects = {version = "^0.1.2", optional = true} +sphinx-automodapi = {version = "0.16.0", optional = true} + +[tool.poetry.extras] +pinecone = ["pinecone-client"] +qdrant = ["qdrant-client", "fastembed"] +chromadb = ["chromadb"] +marqo = ["marqo"] +docs = [ + "sphinx", + "furo", + "docutils", + "m2r2", + "myst-parser", + "myst-nb", + "sphinx-autobuild", + "sphinx_rtd_theme", + "pydantic", + "autodoc_pydantic", + "sphinx-reredirects", + "sphinx-automodapi" +]