Skip to content
This repository was archived by the owner on Mar 25, 2024. It is now read-only.

Add ci to run pytest #1

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7.1", "3.8", "3.9", "3.10", "3.11"]

# This job sets up Python versions using Python images instead of
# actions/setup-python because Python 3.7.1 does not exist in
# the GitHub local cache. Once the support for Python 3.7.1 is
# dropped, this job can be simplified to use actions/setup-python.
container:
image: python:${{ matrix.python-version }}

steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev,datalib,wandb,embeddings]
- name: Test with pytest
run: python -m pytest
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/public/dist
__pycache__
build
dist
*.egg
.vscode/settings.json
.ipynb_checkpoints
Expand Down
2 changes: 1 addition & 1 deletion openai/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def completions_space_start_validator(df):

def add_space_start(x):
x["completion"] = x["completion"].apply(
lambda x: ("" if x[0] == " " else " ") + x
lambda x: ("" if x == "" or x[0] == " " else " ") + x
)
return x

Expand Down