-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release-0.0.6.5-blog
- Loading branch information
Showing
9 changed files
with
200 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Run Tests and Publish Wheel | ||
|
||
on: | ||
# on release publish | ||
release: | ||
types: [released] | ||
|
||
|
||
jobs: | ||
test-without-hf-transformers: | ||
runs-on: lmql-ci | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Fresh Virtual Environment | ||
run: | | ||
pip install --upgrade pip | ||
python3.10 -m venv env | ||
export PATH=$PATH:/home/docker/.local/bin | ||
source env/bin/activate | ||
echo "VIRTUAL ENV:" $VIRTUAL_ENV | ||
- name: Install Dependencies | ||
run: source env/bin/activate && pip install -e . && pip install langchain | ||
- name: Greet | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }} | ||
run: source env/bin/activate && python -m lmql.cli hello openai | ||
test-with-hf-transformers: | ||
runs-on: lmql-ci | ||
needs: [test-without-hf-transformers] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Fresh Virtual Environment | ||
run: | | ||
pip install --upgrade pip | ||
python3.10 -m venv env | ||
export PATH=$PATH:/home/docker/.local/bin | ||
source env/bin/activate | ||
echo "VIRTUAL ENV:" $VIRTUAL_ENV | ||
- name: Install Dependencies | ||
run: source env/bin/activate && pip install -e '.[hf]' && pip install langchain | ||
- name: Run Tests | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }} | ||
run: source env/bin/activate && python src/lmql/tests/all.py --failearly | ||
publish: | ||
runs-on: lmql-ci | ||
needs: [test-with-hf-transformers, test-without-hf-transformers] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Fresh Virtual Environment | ||
run: | | ||
pip install --upgrade pip | ||
python3.10 -m venv env | ||
export PATH=$PATH:/home/docker/.local/bin | ||
source env/bin/activate | ||
echo "VIRTUAL ENV:" $VIRTUAL_ENV | ||
- name: Install Packaging Dependencies | ||
run: pip install build twine | ||
- name: Package | ||
env: | ||
VERSION: ${{ github.ref }} | ||
run: bash scripts/wheel.sh $(echo $VERSION | sed 's/^refs\/tags\/v//') | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
VERSION: ${{ github.ref }} | ||
run: bash scripts/pypi-release.sh lmql-$(echo $VERSION | sed 's/^refs\/tags\/v//') # --production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Run Tests | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
test-without-hf-transformers: | ||
runs-on: lmql-ci | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Fresh Virtual Environment | ||
run: | | ||
pip install --upgrade pip | ||
python3.10 -m venv env | ||
export PATH=$PATH:/home/docker/.local/bin | ||
source env/bin/activate | ||
echo "VIRTUAL ENV:" $VIRTUAL_ENV | ||
- name: Install Dependencies | ||
run: source env/bin/activate && pip install -e . && pip install langchain | ||
- name: Greet | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }} | ||
run: source env/bin/activate && python -m lmql.cli hello openai | ||
test-with-hf-transformers: | ||
runs-on: lmql-ci | ||
needs: [test-without-hf-transformers] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Fresh Virtual Environment | ||
run: | | ||
pip install --upgrade pip | ||
python3.10 -m venv env | ||
export PATH=$PATH:/home/docker/.local/bin | ||
source env/bin/activate | ||
echo "VIRTUAL ENV:" $VIRTUAL_ENV | ||
- name: Install Dependencies | ||
run: source env/bin/activate && pip install -e '.[hf]' && pip install langchain | ||
- name: Run Tests | ||
env: | ||
OPENAI_API_KEY: ${{ secrets.LMQL_CI_OPENAI_KEY }} | ||
run: source env/bin/activate && python src/lmql/tests/all.py --failearly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
if [ "$2" == "--production" ]; then | ||
echo "[WARNING] Uploading to production PyPI" | ||
echo "Source Distribution" | ||
python -m twine upload dist/$1.tar.gz | ||
python -m twine upload dist/$1.tar.gz -u $TWINE_USERNAME -p $TWINE_PASSWORD | ||
echo "Wheel Distribution" | ||
python -m twine upload dist/$1-py3-none-any.whl | ||
python -m twine upload dist/$1-py3-none-any.whl -u $TWINE_USERNAME -p $TWINE_PASSWORD | ||
else | ||
echo "Uploading to test.pypi.org" | ||
echo "Source Distribution" | ||
python -m twine upload --repository testpypi dist/$1.tar.gz | ||
python -m twine upload --repository testpypi dist/$1.tar.gz -u $TWINE_USERNAME -p $TWINE_PASSWORD | ||
echo "Wheel Distribution" | ||
python -m twine upload --repository testpypi dist/$1-py3-none-any.whl | ||
python -m twine upload --repository testpypi dist/$1-py3-none-any.whl -u $TWINE_USERNAME -p $TWINE_PASSWORD | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters