Skip to content

Commit

Permalink
Fix conflits
Browse files Browse the repository at this point in the history
  • Loading branch information
Satarupa22-SD committed Mar 18, 2024
2 parents 27af443 + 7816f61 commit e0577d0
Show file tree
Hide file tree
Showing 3 changed files with 225 additions and 0 deletions.
138 changes: 138 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: main

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

jobs:
check-branch:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
timeout-minutes: 10
concurrency:
group: check-pr-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check if the PR's branch is updated
uses: osl-incubator/gh-check-pr-is-updated@1.0.0
with:
remote_branch: origin/main
pr_sha: ${{ github.event.pull_request.head.sha }}

tests:
needs: check-branch
timeout-minutes: 10
strategy:
matrix:
python_version:
- "3.8.1"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
os:
- "ubuntu"
- "macos"
# - "windows"
runs-on: ${{ matrix.os }}-latest
concurrency:
group: ci-tests-${{ matrix.os }}-${{ matrix.python_version }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v3

- name: Install MacOS extra tools and add extra setup
if: ${{ matrix.os == 'macos' }}
run: |
sudo mkdir -p /tmp
sudo chmod 777 /tmp
brew install gnu-sed
echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bashrc
echo 'export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"' >> ~/.bash_profile
- name: Prepare conda environment (windows)
if: ${{ matrix.os == 'windows' }}
run: |
$env:Path += ";C:\Program Files\Git\usr\bin"
sed -i s/python\ 3\.8\.1/python\ ${{ matrix.python_version }}/ conda/dev.yaml
cat conda/dev.yaml
- name: Prepare conda environment
if: ${{ matrix.os != 'windows' }}
run: |
sed -i s/python\ 3\.8\.1/python\ ${{ matrix.python_version }}/ conda/dev.yaml
cat conda/dev.yaml
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: anamnesisai
auto-update-conda: true
conda-solver: libmamba

- name: Install dependencies
run: poetry install

- name: Run unit tests
run: makim tests.unittest

- name: Test jupyter notebooks
run: makim tests.notebooks

linter-and-docs:
needs: check-branch
runs-on: ubuntu-latest
timeout-minutes: 10

defaults:
run:
shell: bash -l {0}

concurrency:
group: ci-linter-docs-${{ matrix.os }}-${{ matrix.python_version }}-${{ github.ref }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
environment-file: conda/dev.yaml
channels: conda-forge,nodefaults
activate-environment: anamnesisai
auto-update-conda: true
conda-solver: libmamba

- name: Install dependencies
run: |
poetry config virtualenvs.create false
poetry install
- name: Test documentation generation
run: makim docs.build

- name: Run style checks
if: success() || failure()
run: |
pre-commit install
makim tests.linter
- name: Setup tmate session
if: "${{ failure() && (contains(github.event.pull_request.labels.*.name, 'ci:enable-debugging')) }}"
uses: mxschmitt/action-tmate@v3
86 changes: 86 additions & 0 deletions .makim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
version: 1.0
groups:
clean:
targets:
tmp:
help: remove build artifacts, compiled files, and cache
shell: bash
run: |
find . -name '*.egg-info' -exec rm -rf {} +
find . -name '*.egg' -exec rm -f {} +
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +
find . -name '*~' -exec rm -f {} +
rm -rf build/
rm -rf dist/
rm -rf .eggs/
rm -f .coverage
rm -rf htmlcov/
rm -rf .pytest_cache
tests:
targets:
linter:
help: run linter tools
run: |
pre-commit install
pre-commit run --all-files
unittest:
help: run tests
args:
path:
help: Specify the location of the tests
type: string
default: ""
params:
help: Specify parameters to be used for tests
type: string
default: "-vv"
run: pytest {{ args.path }} {{ args.params }}

notebooks:
help: test jupyter notebooks
run: pytest -vv --nbmake docs/tutorials

ci:
help: run the sames tests executed on CI
dependencies:
- target: tests.unittest
- target: tests.notebooks
- target: tests.linter

docs:
targets:
build:
help: build documentation
run: mkdocs build --config-file mkdocs.yaml

preview:
help: preview documentation page locally
run: mkdocs serve --watch docs --config-file mkdocs.yaml

release:
vars:
app: |
npx --yes \
-p semantic-release \
-p conventional-changelog-conventionalcommits \
-p "@semantic-release/commit-analyzer" \
-p "@semantic-release/release-notes-generator" \
-p "@semantic-release/changelog" \
-p "@semantic-release/exec" \
-p "@semantic-release/github" \
-p "@semantic-release/git" \
-p "semantic-release-replace-plugin" \
semantic-release
targets:
ci:
help: run semantic release on CI
run: {{ vars.app }} --ci

dry:
help: run semantic release in dry-run mode
run: {{ vars.app }} --dry-run
1 change: 1 addition & 0 deletions src/anamnesisai/anamnesisai.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@


from langchain import OpenAI
from langchain.utilities import SQLDatabase
from langchain_experimental.sql import SQLDatabaseChain
Expand Down

0 comments on commit e0577d0

Please sign in to comment.