-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from parea-ai/use-github-workflows
Use GitHub workflows
- Loading branch information
Showing
18 changed files
with
6,725 additions
and
288 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,5 +1,2 @@ | ||
OPENAI_API_KEY=<insert OpenAI API key here> | ||
LANGCHAIN_TRACING_V2=true | ||
LANGCHAIN_API_KEY=<insert Langsmith API key here> | ||
LANGCHAIN_ENDPOINT="https://api.smith.langchain.com" | ||
LANGCHAIN_PROJECT="rag-demo" | ||
PAREA_API_KEY=<insert Parea API key here> |
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,38 @@ | ||
name: build | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11" ] | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: make poetry-download | ||
|
||
- name: Set up cache | ||
uses: actions/[email protected] | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry install | ||
- name: Run style checks | ||
run: | | ||
make check-codestyle | ||
# - name: Run tests | ||
# run: | | ||
# make test |
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 |
---|---|---|
|
@@ -166,4 +166,4 @@ cython_debug/ | |
*.swp | ||
|
||
.dccache | ||
.DS_Store | ||
.DS_Store |
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,36 @@ | ||
default_language_version: | ||
python: python3.11 | ||
|
||
default_stages: [ commit, push ] | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
exclude: LICENSE | ||
|
||
- repo: local | ||
hooks: | ||
- id: pyupgrade | ||
name: pyupgrade | ||
entry: poetry run pyupgrade --py39-plus | ||
types: [ python ] | ||
language: system | ||
|
||
- repo: local | ||
hooks: | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort --settings-path pyproject.toml | ||
types: [ python ] | ||
language: system | ||
|
||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black --config pyproject.toml | ||
types: [ python ] | ||
language: system |
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,2 +1,2 @@ | ||
[MESSAGES CONTROL] | ||
disable=line-too-long,no-member,too-few-public-methods,missing-function-docstring,missing-module-docstring | ||
disable=line-too-long,no-member,too-few-public-methods,missing-function-docstring,missing-module-docstring |
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,89 @@ | ||
#* Variables | ||
SHELL := /usr/bin/env bash | ||
PYTHON := python3 | ||
PYTHONPATH := `pwd` | ||
|
||
#* Docker variables | ||
VERSION := latest | ||
|
||
#* Poetry | ||
.PHONY: poetry-download | ||
poetry-download: | ||
curl -sSL https://install.python-poetry.org | $(PYTHON) - | ||
|
||
.PHONY: poetry-remove | ||
poetry-remove: | ||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | $(PYTHON) - --uninstall | ||
|
||
#* Installation | ||
.PHONY: install | ||
install: | ||
poetry lock -n && poetry export --without-hashes > requirements.txt | ||
poetry install -n | ||
poetry run mypy --install-types --non-interactive ./ | ||
|
||
.PHONY: pre-commit-install | ||
pre-commit-install: | ||
poetry run pre-commit install | ||
|
||
#* Formatters | ||
.PHONY: codestyle | ||
codestyle: | ||
poetry run pyupgrade --exit-zero-even-if-changed --py39-plus **/*.py | ||
poetry run isort --settings-path pyproject.toml ./ | ||
poetry run black --config pyproject.toml ./ | ||
|
||
.PHONY: formatting | ||
formatting: codestyle | ||
|
||
#* Linting | ||
.PHONY: test | ||
test: | ||
PYTHONPATH=$(PYTHONPATH) poetry run pytest tests/test_chains.py | ||
|
||
.PHONY: check-codestyle | ||
check-codestyle: | ||
poetry run isort --diff --check-only --settings-path pyproject.toml ./ | ||
poetry run black --diff --check --config pyproject.toml ./ | ||
poetry run darglint --verbosity 2 parea tests | ||
|
||
.PHONY: mypy | ||
mypy: | ||
poetry run mypy --config-file pyproject.toml ./ | ||
|
||
.PHONY: lint | ||
lint: test check-codestyle mypy | ||
|
||
.PHONY: update-dev-deps | ||
update-dev-deps: | ||
poetry add -D bandit@latest darglint@latest "isort[colors]@latest" mypy@latest pre-commit@latest pydocstyle@latest pylint@latest pytest@latest pyupgrade@latest safety@latest coverage@latest coverage-badge@latest pytest-html@latest pytest-cov@latest | ||
poetry add -D --allow-prereleases black@latest | ||
|
||
|
||
#* Cleaning | ||
.PHONY: pycache-remove | ||
pycache-remove: | ||
find . | grep -E "(__pycache__|\.pyc|\.pyo$$)" | xargs rm -rf | ||
|
||
.PHONY: dsstore-remove | ||
dsstore-remove: | ||
find . | grep -E ".DS_Store" | xargs rm -rf | ||
|
||
.PHONY: mypycache-remove | ||
mypycache-remove: | ||
find . | grep -E ".mypy_cache" | xargs rm -rf | ||
|
||
.PHONY: ipynbcheckpoints-remove | ||
ipynbcheckpoints-remove: | ||
find . | grep -E ".ipynb_checkpoints" | xargs rm -rf | ||
|
||
.PHONY: pytestcache-remove | ||
pytestcache-remove: | ||
find . | grep -E ".pytest_cache" | xargs rm -rf | ||
|
||
.PHONY: build-remove | ||
build-remove: | ||
rm -rf build/ | ||
|
||
.PHONY: cleanup | ||
cleanup: pycache-remove dsstore-remove mypycache-remove ipynbcheckpoints-remove pytestcache-remove |
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
Oops, something went wrong.