generated from langchain-ai/integration-repo-template
-
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.
Migrate Python integration package to independent repo (#1)
* Update .gitignore * Update doc * Add code and tests * Fix lints and formatting * Fix unused imports and paths * Fix linting and mypy errors * Fix paths and makefile * Fix lint error for py39 * Fix type inheritance for pydantic validator * Add docs * Fix lint error * Fix bug with schema * Update build workflow * Pass mypy * Fix lint * Remove integration tests
- Loading branch information
Showing
28 changed files
with
3,458 additions
and
145 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
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
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
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
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 |
---|---|---|
|
@@ -5,3 +5,6 @@ __pycache__ | |
.mypy_cache_test | ||
.env | ||
.venv* | ||
test_db | ||
.DS_Store | ||
.coverage |
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,70 +1,5 @@ | ||
# 🦜️🔗 LangChain {partner} | ||
# 🦜️🔗 LangChain Kùzu | ||
|
||
This repository contains 1 package with {partner} integrations with LangChain: | ||
This repository contains 1 package that integrates Kùzu, an embedded graph database, with LangChain: | ||
|
||
- [langchain-{package_lower}](https://pypi.org/project/langchain-{package_lower}/) | ||
|
||
## Initial Repo Checklist (Remove this section after completing) | ||
|
||
Welcome to the LangChain Partner Integration Repository! This checklist will help you get started with your new repository. | ||
|
||
After creating your repo from the integration-repo-template, we'll go through the following steps: | ||
|
||
1. Setting up your new repository in GitHub | ||
2. | ||
|
||
This setup assumes that the partner package is already split. For those instructions, | ||
see [these docs](https://python.langchain.com/docs/contributing/integrations#partner-packages). | ||
|
||
Code (auto ecli) | ||
|
||
- [ ] Fill out the readme above (for folks that follow pypi link) | ||
- [ ] Copy package into /libs folder | ||
- [ ] Update these fields in /libs/*/pyproject.toml | ||
|
||
- `tool.poetry.repository` | ||
- `tool.poetry.urls["Source Code"]` | ||
|
||
Workflow code (auto ecli) | ||
|
||
- [ ] Populate .github/workflows/_release.yml with `on.workflow_dispatch.inputs.working-directory.default` | ||
- [ ] Configure `LIB_DIRS` in .github/scripts/check_diff.py | ||
|
||
Workflow code (manual) | ||
|
||
- [ ] Add secrets as env vars in .github/workflows/_release.yml | ||
|
||
Monorepo workflow code (manual) | ||
|
||
- [ ] Pull in new code location, remove old in .github/workflows/api_doc_build.yml | ||
|
||
In github (manual) | ||
|
||
- [ ] Add integration testing secrets in Github (ask Erick for help) | ||
- [ ] Add partner collaborators in Github (ask Erick for help) | ||
- [ ] "Allow auto-merge" in General Settings | ||
- [ ] Only "Allow squash merging" in General Settings | ||
- [ ] Set up ruleset matching CI build (ask Erick for help) | ||
- name: ci build | ||
- enforcement: active | ||
- bypass: write | ||
- target: default branch | ||
- rules: restrict deletions, require status checks ("CI Success"), block force pushes | ||
- [ ] Set up ruleset | ||
- name: require prs | ||
- enforcement: active | ||
- bypass: none | ||
- target: default branch | ||
- rules: restrict deletions, require a pull request before merging (0 approvals, no boxes), block force pushes | ||
|
||
Pypi (manual) | ||
|
||
- [ ] Add new repo to test-pypi and pypi trusted publishing (ask Erick for help) | ||
|
||
Slack | ||
|
||
- [ ] Set up release alerting in Slack (ask Erick for help) | ||
|
||
release: | ||
/github subscribe langchain-ai/langchain-{partner_lower} releases workflows:{name:"release"} | ||
/github unsubscribe langchain-ai/langchain-{partner_lower} issues pulls commits deployments | ||
- [langchain-kuzu](https://pypi.org/project/langchain-kuzu/) |
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,64 @@ | ||
.PHONY: all format lint test tests integration_tests docker_tests help extended_tests | ||
|
||
# Default target executed when no arguments are given to make. | ||
all: help | ||
|
||
# Define a variable for the test file path. | ||
TEST_FILE ?= tests/unit_tests/ | ||
# integration_test integration_tests: TEST_FILE = tests/integration_tests/ | ||
|
||
|
||
# unit tests are run with the --disable-socket flag to prevent network calls | ||
test tests: | ||
poetry run pytest --disable-socket --allow-unix-socket $(TEST_FILE) | ||
|
||
test_watch: | ||
poetry run ptw --snapshot-update --now . -- -vv $(TEST_FILE) | ||
|
||
# # integration tests are run without the --disable-socket flag to allow network calls | ||
# integration_test integration_tests: | ||
# poetry run pytest $(TEST_FILE) | ||
|
||
###################### | ||
# LINTING AND FORMATTING | ||
###################### | ||
|
||
# Define a variable for Python and notebook files. | ||
PYTHON_FILES=. | ||
MYPY_CACHE=.mypy_cache | ||
lint format: PYTHON_FILES=. | ||
lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/partners/kuzu --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$') | ||
lint_package: PYTHON_FILES=langchain_kuzu | ||
lint_tests: PYTHON_FILES=tests | ||
lint_tests: MYPY_CACHE=.mypy_cache_test | ||
|
||
lint lint_diff lint_package lint_tests: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff | ||
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) | ||
|
||
format format_diff: | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) | ||
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --select I --fix $(PYTHON_FILES) | ||
|
||
spell_check: | ||
poetry run codespell --toml pyproject.toml | ||
|
||
spell_fix: | ||
poetry run codespell --toml pyproject.toml -w | ||
|
||
check_imports: $(shell find langchain_kuzu -name '*.py') | ||
poetry run python ./scripts/check_imports.py $^ | ||
|
||
###################### | ||
# HELP | ||
###################### | ||
|
||
help: | ||
@echo '----' | ||
@echo 'check_imports - check imports' | ||
@echo 'format - run code formatters' | ||
@echo 'lint - run linters' | ||
@echo 'test - run unit tests' | ||
@echo 'tests - run unit tests' | ||
@echo 'test TEST_FILE=<test_file> - run all tests in file' |
Oops, something went wrong.