Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

feat: add GitHub Actions workflow to build the package

Darinc18acf77ce11
diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml
new file mode 100644
index 000000000..23fc4b28f
--- /dev/null
+++ b/.github/workflows/build_package.yml
@@ -0,0 +1,57 @@
+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: Load cached Poetry installation
+ id: cached-poetry
+ uses: actions/cache@v3
+ with:
+ path: ~/.local # the path depends on the OS
+ key: poetry-0 # increment to reset cache
+ - name: Install Poetry
+ if: steps.cached-poetry.outputs.cache-hit != 'true'
+ uses: snok/install-poetry@v1
+ - name: Load cached venv
+ id: cached-poetry-dependencies
+ uses: actions/cache@v3
+ with:
+ path: .venv
+ key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
+ - name: Install dependencies
+ if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
+ run: poetry install --no-root
+ - name: Debug
+ run: |
+ pwd
+ ls -la
+ - name: Build
+ shell: bash
+ run: poetry build
+ - name: Test installing built package
+ shell: bash
+ run: python -m pip install .
+ - name: Test import
+ shell: bash
+ working-directory: ${{ vars.RUNNER_TEMP }}
+ run: python -c "import dspy"
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 000000000..945bd5dd7
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,117 @@
+[build-system]
+requires = ["setuptools>=40.8.0", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "dspy-ai"
+version = "2.0.8"
+description = "DSPy"
+readme = "README.md"
+authors = [{name = "Omar Khattab", email = "[email protected]"}]
+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/dsp"
+
+[tool.poetry]
+name = "dspy"
+version = "2.0.8"
+description = "DSPy"
+authors = ["Omar Khattab <[email protected]>"]
+license = "MIT"
+readme = "README.md"
+homepage = "https://github.com/stanfordnlp/dsp"
+documentation = "https://dspy-ai.readthedocs.io"
+repository = "https://github.com/stanfordnlp/dsp"
+keywords = ["dsp", "ai", "signal processing"]
+
+[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"
+]
\ No newline at end of file