Skip to content

Commit b07c90b

Browse files
committed
initial commit on sdk
0 parents  commit b07c90b

File tree

12 files changed

+1490
-0
lines changed

12 files changed

+1490
-0
lines changed

.gitignore

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

.pre-commit-config.yaml

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
# See https://pre-commit.com for more information
3+
# See https://pre-commit.com/hooks.html for more hooks
4+
# - Added pkgs feature flag auto generated code to flake8 exclude list
5+
# Force all unspecified python hooks to run python 3.10
6+
default_language_version:
7+
python: python3.9
8+
default_stages:
9+
- commit
10+
repos:
11+
- repo: https://github.com/pre-commit/pre-commit-hooks
12+
rev: v4.5.0
13+
hooks:
14+
- id: trailing-whitespace
15+
exclude_types:
16+
- "markdown"
17+
- id: end-of-file-fixer
18+
- id: check-yaml
19+
args: [--unsafe]
20+
- id: check-added-large-files
21+
args: ["--maxkb=10240"]
22+
- id: check-case-conflict
23+
- id: check-docstring-first
24+
- id: check-ast
25+
- id: check-json
26+
exclude: ".vscode/launch.json"
27+
- id: check-executables-have-shebangs
28+
- id: check-shebang-scripts-are-executable
29+
- id: check-toml
30+
- id: debug-statements
31+
- id: detect-private-key
32+
- id: check-merge-conflict
33+
- id: check-symlinks
34+
- id: destroyed-symlinks
35+
- id: forbid-new-submodules
36+
- id: mixed-line-ending
37+
- id: no-commit-to-branch
38+
- repo: https://github.com/adrienverge/yamllint
39+
rev: v1.35.1
40+
hooks:
41+
- id: yamllint
42+
args: ["-d", "relaxed"]
43+
language: system
44+
- repo: https://github.com/rhysd/actionlint
45+
rev: v1.6.26
46+
hooks:
47+
- id: actionlint-docker
48+
args: [-ignore, 'label ".+" is unknown']
49+
- repo: https://github.com/psf/black
50+
rev: 24.2.0
51+
hooks:
52+
- id: black
53+
args: [--config=pyproject.toml, -l 120]
54+
language: system
55+
exclude: |
56+
(?x)^(
57+
pkgs/unstract-flags/src/unstract/flags/evaluation_.*\.py|
58+
)$
59+
- repo: https://github.com/pycqa/flake8
60+
rev: 7.0.0
61+
hooks:
62+
- id: flake8
63+
args: [--max-line-length=120]
64+
exclude: |
65+
(?x)^(
66+
.*migrations/.*\.py|
67+
unstract-core/tests/.*|
68+
pkgs/unstract-flags/src/unstract/flags/evaluation_.*\.py|
69+
)$
70+
- repo: https://github.com/pycqa/isort
71+
rev: 5.13.2
72+
hooks:
73+
- id: isort
74+
files: "\\.(py)$"
75+
args:
76+
[
77+
"--profile",
78+
"black",
79+
"--filter-files",
80+
--settings-path=pyproject.toml,
81+
]
82+
- repo: https://github.com/hadialqattan/pycln
83+
rev: v2.4.0
84+
hooks:
85+
- id: pycln
86+
args: [--config=pyproject.toml]
87+
- repo: https://github.com/pycqa/docformatter
88+
rev: v1.7.5
89+
hooks:
90+
- id: docformatter
91+
# - repo: https://github.com/MarcoGorelli/absolufy-imports
92+
# rev: v0.3.1
93+
# hooks:
94+
# - id: absolufy-imports
95+
- repo: https://github.com/asottile/pyupgrade
96+
rev: v3.15.0
97+
hooks:
98+
- id: pyupgrade
99+
entry: pyupgrade --py39-plus --keep-runtime-typing
100+
types:
101+
- python
102+
- repo: https://github.com/gitleaks/gitleaks
103+
rev: v8.18.2
104+
hooks:
105+
- id: gitleaks
106+
- repo: https://github.com/asottile/yesqa
107+
rev: v1.5.0
108+
hooks:
109+
- id: yesqa
110+
# TODO: Uncomment after typing the SDK
111+
# - repo: https://github.com/pre-commit/mirrors-mypy
112+
# rev: v1.8.0
113+
# hooks:
114+
# - id: mypy
115+
# language: system
116+
# entry: mypy .
117+
# pass_filenames: false
118+
# # IMPORTANT!
119+
# # Keep args same as tool.mypy section in pyproject.toml
120+
# args:
121+
# [
122+
# --allow-subclassing-any,
123+
# --allow-untyped-decorators,
124+
# --check-untyped-defs,
125+
# --exclude, ".*migrations/.*.py",
126+
# --exclude, "backend/prompt/.*",
127+
# --exclude, "document_display_service/.*",
128+
# --exclude, "pkgs/unstract-connectors/tests/.*",
129+
# --exclude, "pkgs/unstract-core/.*",
130+
# --exclude, "pkgs/unstract-flags/src/unstract/flags/.*",
131+
# --exclude, "sdks/.*",
132+
# --exclude, "unstract-document-service/.*",
133+
# --exclude, "__pypackages__/.*",
134+
# --follow-imports, "silent",
135+
# --ignore-missing-imports,
136+
# --implicit-reexport,
137+
# --pretty,
138+
# --python-version=3.9,
139+
# --show-column-numbers,
140+
# --show-error-codes,
141+
# --strict,
142+
# --warn-redundant-casts,
143+
# --warn-return-any,
144+
# --warn-unreachable,
145+
# --warn-unused-configs,
146+
# --warn-unused-ignores,
147+
# ]
148+
- repo: https://github.com/igorshubovych/markdownlint-cli
149+
rev: v0.39.0
150+
hooks:
151+
- id: markdownlint
152+
args: [--disable, MD013]
153+
- id: markdownlint-fix
154+
args: [--disable, MD013]
155+
- repo: https://github.com/pdm-project/pdm
156+
rev: 2.12.3
157+
hooks:
158+
- id: pdm-lock-check

0 commit comments

Comments
 (0)