Skip to content

Commit 1e05730

Browse files
committed
💃 Literal AI SDKs go Open Source !
0 parents  commit 1e05730

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+12022
-0
lines changed

‎.env.ci.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
LITERAL_API_URL=
2+
LITERAL_API_KEY=

‎.github/workflows/CI.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: ["main"]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python 3.9
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: "3.9"
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
- name: Lint and format with ruff
26+
run: |
27+
ruff check
28+
- name: Type check
29+
run: |
30+
mypy .
31+
e2e-tests:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python 3.9
36+
uses: actions/setup-python@v3
37+
with:
38+
python-version: "3.9"
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
pip install .
43+
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
44+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
45+
- name: Test with pytest
46+
env:
47+
LITERAL_API_URL: ${{ secrets.LITERAL_API_URL }}
48+
LITERAL_API_KEY: ${{ secrets.LITERAL_API_KEY }}
49+
run: |
50+
pytest -m e2e
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
build-n-publish:
10+
name: Upload release to PyPI
11+
runs-on: ubuntu-latest
12+
env:
13+
name: pypi
14+
url: https://pypi.org/p/literalai
15+
permissions:
16+
contents: read
17+
id-token: write
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
ref: main
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.9"
26+
- name: Install dependencies and build
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install -r requirements.txt
30+
python setup.py sdist
31+
- name: Publish package distributions to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
with:
34+
packages-dir: dist
35+
password: ${{ secrets.PYPI_API_TOKEN }}

‎.gitignore

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
node_modules
2+
3+
.DS_Store
4+
5+
# Byte-compiled / optimized / DLL files
6+
__pycache__/
7+
*.py[cod]
8+
*$py.class
9+
10+
# C extensions
11+
*.so
12+
.vscode/
13+
14+
# Distribution / packaging
15+
.Python
16+
build/
17+
develop-eggs/
18+
dist/
19+
downloads/
20+
eggs/
21+
.eggs/
22+
lib/
23+
lib64/
24+
parts/
25+
sdist/
26+
var/
27+
wheels/
28+
share/python-wheels/
29+
*.egg-info/
30+
.installed.cfg
31+
*.egg
32+
MANIFEST
33+
34+
# PyInstaller
35+
# Usually these files are written by a python script from a template
36+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
37+
*.manifest
38+
*.spec
39+
40+
# Installer logs
41+
pip-log.txt
42+
pip-delete-this-directory.txt
43+
44+
# Unit test / coverage reports
45+
htmlcov/
46+
.tox/
47+
.nox/
48+
.coverage
49+
.coverage.*
50+
.cache
51+
.ruff_cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
cover/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# poetry
104+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108+
#poetry.lock
109+
110+
# pdm
111+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112+
#pdm.lock
113+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114+
# in version control.
115+
# https://pdm.fming.dev/#use-with-ide
116+
.pdm.toml
117+
118+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
119+
__pypackages__/
120+
121+
# Celery stuff
122+
celerybeat-schedule
123+
celerybeat.pid
124+
125+
# SageMath parsed files
126+
*.sage.py
127+
128+
# Environments
129+
.env
130+
.venv
131+
env/
132+
venv/
133+
py_examples/
134+
ENV/
135+
env.bak/
136+
venv.bak/
137+
138+
# Spyder project settings
139+
.spyderproject
140+
.spyproject
141+
142+
# Rope project settings
143+
.ropeproject
144+
145+
# mkdocs documentation
146+
/site
147+
148+
# mypy
149+
.mypy_cache/
150+
.dmypy.json
151+
dmypy.json
152+
153+
# Pyre type checker
154+
.pyre/
155+
156+
# pytype static type analyzer
157+
.pytype/
158+
159+
# Cython debug symbols
160+
cython_debug/
161+
162+
# PyCharm
163+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
164+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
165+
# and can be added to the global gitignore or merged into this file. For a more nuclear
166+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
167+
.idea/

‎.pre-commit-config.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 23.11.0
4+
hooks:
5+
- id: black
6+
- repo: https://github.com/pre-commit/mirrors-isort
7+
rev: "v5.10.1" # Use the revision sha / tag you want to point at
8+
hooks:
9+
- id: isort
10+
args: ["--profile", "black", "--filter-files"]
11+
- repo: https://github.com/astral-sh/ruff-pre-commit
12+
rev: v0.1.11
13+
hooks:
14+
- id: ruff
15+
- repo: https://github.com/pre-commit/mirrors-mypy
16+
rev: "v1.7.1" # Use the sha / tag you want to point at
17+
hooks:
18+
- id: mypy
19+
additional_dependencies:
20+
- pydantic
21+
- httpx

0 commit comments

Comments
 (0)