Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0e47e5d
Run tests on PR
isaacbmiller Feb 26, 2024
79ea18c
Split CI into build and test
isaacbmiller Feb 26, 2024
2dbf8ca
Update pre-commit checks workflow
isaacbmiller Feb 26, 2024
7912b48
Add docs to readme and contrib.md, del requirements.txt, disable prec…
isaacbmiller Feb 26, 2024
808debf
Remove test installing built package with req.txt and add instruction…
isaacbmiller Feb 26, 2024
6f984d0
Refactor build and test workflows
isaacbmiller Feb 26, 2024
05c7ed5
Add pydantic to deps
isaacbmiller Feb 26, 2024
d0db324
Update pydantic version to 2.5.0
isaacbmiller Feb 26, 2024
2bdb982
Update pydantic version to 2.5.0
isaacbmiller Feb 26, 2024
92d1e83
Fix pydantic not installing
isaacbmiller Feb 26, 2024
7c9e9c1
Update pydantic dependency to be pep508
isaacbmiller Feb 26, 2024
50b917f
Merge branch 'main' into test-ci
isaacbmiller Feb 26, 2024
8ab61da
Testing CI
isaacbmiller Feb 26, 2024
c1f3214
Simplify requirements.txt
isaacbmiller Feb 26, 2024
5497a93
Add note to req.txt
isaacbmiller Feb 26, 2024
07b18f6
Add Build setup.py to CI
isaacbmiller Feb 26, 2024
56e5596
Remove setup.py install
isaacbmiller Feb 26, 2024
ec9aa6b
Remove commented out code for installing Poetry
isaacbmiller Feb 26, 2024
c416794
Remove build_setup job from run_tests.yml
isaacbmiller Feb 26, 2024
3293e93
Forcing an empty commit.
isaacbmiller Feb 26, 2024
bb1de2d
Add Build setup back
isaacbmiller Feb 26, 2024
05636e5
Merge branch 'main' into test-ci
okhat Feb 27, 2024
6cbf3d2
Update pyproject.toml
okhat Feb 27, 2024
5fb354f
Update pyproject.toml
okhat Feb 27, 2024
04b73f5
Update pyproject.toml
okhat Feb 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .github/workflows/build_package.yml

This file was deleted.

12 changes: 1 addition & 11 deletions .github/workflows/precommits_check.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
name: Pre-commit checks
on:
pull_request:
branches:
- dev
- main
types:
- opened
- edited
- synchronize
workflow_dispatch:
branches:
- dev
- main

jobs:
pre-commit-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build and Run Tests

on:
push:
branches:
- main
pull_request:

env:
POETRY_VERSION: "1.6.1"

jobs:
test:
name: Test
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@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: poetry install
- name: Run tests with pytest
run: poetry run pytest tests/
build_poetry:
name: Build Poetry
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@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Build
run: poetry build
- name: Install built package
run: python -m pip install dist/*.whl
- name: Test import dspy
run: python -c "import dspy"
- name: Test import dsp
run: python -c "import dsp"
build_setup:
name: Build Setup
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@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run setup.py build
run: python setup.py build
39 changes: 15 additions & 24 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,54 +4,45 @@

### Bounty Board

The bounty board will have various features, issues, and requests that are up for grabs.
The bounty board will have various features, issues, and requests that are up for grabs. We are still working on this. Come to the discord and ask for the current bounties.

See the spreadsheet [here](https://docs.google.com/spreadsheets/d/1psHSfFXENAxhQTd5veKRzKydVubD2Ov62aKQHiYC-CQ/edit?usp=sharing) for the current bounties.


## Setting-up

### Create new environment
To run the tests, you need to first clone the repository.

```bash
conda create --name dspy python=3.11
```

or
Then install the package through poetry:
Note - You may need to install poetry. See [here](https://python-poetry.org/docs/#installing-with-the-official-installer)

```bash
python3 -m venv dspy
poetry install --with test
```

## Pre-commit hook

Before using pre-commit hook you need to install it in your python environment.
## Testing

```bash
conda install -c conda-forge pre-commit
```

go to the root folder and then activate it as follows (it will first download all required dependencies):
To run the all tests, or a specific test suite, use the following commands:

```bash
pre-commit install
poetry run pytest
poetry run pytest tests/PATH_TO_TEST_SUITE
```

> Pre-commit hooks will attempt to fix all your files and so you will need to (add + commit) them once the fixes are done !
If you are changing CI actions, you can use the [act](https://nektosact.com/introduction.html) tool to test the CI locally.

### Optional

Generally the pre-commit will run automatically before each of your commit,
but you can also manually trigger it, as follows:
Example for testing the push action:
You may need the `--container-architecture linux/amd64` flag if you are on an M1/2 mac.

```bash
pre-commit run --all-files
act push
```

## Commit Message format

Commit message format must be respected, with the following regex:

This ends up looking like feature(dspy): added new feature

```
^(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix|release|maint|init|enh|revert)\([a-z,A-Z,0-9,\-,\_,\/,:]+\)(:)\s{1}([\w\s]+)
```
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,27 @@ This is very useful in many settings, but it's generally focused on low-level, s
In contrast, **DSPy** automatically optimizes the prompts in your programs to align them with various task needs, which may also include producing valid structured ouputs. That said, we are considering allowing **Signatures** in **DSPy** to express regex-like constraints that are implemented by these libraries.
</details>

## Testing

To run the tests, you need to first clone the repository.

Then install the package through poetry:
Note - You may need to

```bash
poetry install --with test
```

Then run the all tests, or a specific test suite, with the following commands:

```bash
poetry run pytest
poetry run pytest tests/PATH_TO_TEST_SUITE
```

## Contribution Quickstart

See [CONTRIBUTING.md](CONTRIBUTING.md) for a quickstart guide to contributing to DSPy.

## Contributors & Acknowledgements

Expand Down
Loading