-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Set up CD pipeline * format code * add tests --------- Co-authored-by: Yazhou Cao <[email protected]>
- Loading branch information
1 parent
52b2384
commit 8b32203
Showing
10 changed files
with
1,760 additions
and
0 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,5 @@ | ||
[flake8] | ||
extend-ignore = E501,E203 | ||
max-line-length = 88 | ||
max-complexity = 15 | ||
per-file-ignores = __init__.py:F401 |
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,84 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
Test: | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.10.11] | ||
os: [ ubuntu-22.04, windows-2022, macos-12 ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Python Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.4.2 | ||
- name: Configure poetry | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
- name: Print Python environment information | ||
run: | | ||
poetry env info | ||
poetry --version | ||
poetry run pip -V | ||
- name: Install dependencies | ||
run: | | ||
# Install main dependencies first so we can see their size | ||
poetry install --all-extras | ||
- name: Linting | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
poetry run flake8 . --exclude .venv --count --show-source --statistics | ||
- name: Check Format | ||
run: | | ||
poetry run black --check --diff --color . | ||
- name: Type Checking | ||
run: | | ||
poetry run mypy lmm_tools | ||
- name: Test with pytest | ||
run: | | ||
poetry run pytest -v tests | ||
Release: | ||
needs: Test | ||
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482 | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore(release):') && !contains(github.event.head_commit.message, '[skip release]') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.11 | ||
- name: Install Python Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: 1.4.2 | ||
- name: Configure poetry | ||
shell: bash | ||
run: poetry config virtualenvs.in-project true | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
- name: setup git config | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "[email protected]" | ||
- name: Bump up version | ||
run: | | ||
poetry version patch | ||
git add pyproject.toml | ||
new_version=`poetry version` | ||
git commit -m "[skip ci] chore(release): ${new_version}" | ||
git push -f | ||
- name: Publish to PyPI | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | ||
poetry publish --build -vvv |
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,52 @@ | ||
name: pdoc | ||
|
||
# build the documentation whenever there are new commits on main | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# Alternative: only build for tags. | ||
# tags: | ||
# - '*' | ||
|
||
# security: restrict permissions for CI jobs. | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
# Build the documentation and upload the static HTML files as an artifact. | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.11 | ||
|
||
- uses: Gr1N/setup-poetry@v8 | ||
with: | ||
poetry-version: "1.2.2" | ||
|
||
- run: poetry install --all-extras | ||
- run: mkdir -p docs-build | ||
#- run: poetry run pdoc -t pdocs/templates --docformat=numpy -o docs-build landingai | ||
- run: poetry run mkdocs build -f mkdocs.yml -d docs-build/ | ||
|
||
- uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: docs-build/ | ||
|
||
# Deploy the artifact to GitHub pages. | ||
# This is a separate job so that only actions/deploy-pages has the necessary permissions. | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- id: deployment | ||
uses: actions/deploy-pages@v2 |
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,94 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Object files | ||
*.o | ||
*.ko | ||
*.obj | ||
*.elf | ||
|
||
# Env files | ||
.env | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Libraries | ||
*.lib | ||
*.a | ||
*.la | ||
*.lo | ||
|
||
# Shared objects (inc. Windows DLLs) | ||
*.dll | ||
*.so | ||
*.so.* | ||
*.dylib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
*.i*86 | ||
*.x86_64 | ||
*.hex | ||
|
||
# Debug files | ||
*.dSYM/ | ||
*.su | ||
|
||
# Mac files | ||
.DS_Store | ||
.DS_STORE | ||
|
||
# Old HG stuff | ||
.hg | ||
.hgignore | ||
.hgtags | ||
|
||
.git | ||
__pycache__ | ||
.ipynb_checkpoints | ||
*/__pycache__ | ||
*/.ipynb_checkpoints | ||
.local | ||
.jupyter | ||
.ipython | ||
*/.terraform | ||
terraform.* | ||
.terraform.* | ||
shinobi-dvr/* | ||
.vscode/ | ||
|
||
# mypy | ||
.mypy_cache/* | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
pip-wheel-metadata/ | ||
share/python-wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# Output from various tools | ||
examples/output | ||
tests/output | ||
docs-build | ||
|
||
# Local or WIP files | ||
local/ |
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,17 @@ | ||
<p align="center"> | ||
<img width="100" height="100" src="https://github.com/landing-ai/landingai-python/raw/main/assets/avi-logo.png"> | ||
</p> | ||
|
||
# Welcome to the Landing AI LMM Tools Documentation | ||
|
||
This library provides a set of tools to help you build applications with Large Multimodal Model (LMM). | ||
|
||
|
||
## Quick Start | ||
|
||
### Install | ||
First, install the library: | ||
|
||
```bash | ||
pip install lmm-tools | ||
``` |
Empty file.
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,2 @@ | ||
if __name__ == "__main__": | ||
print("Hello, World!") |
Oops, something went wrong.