Skip to content

Commit 654501e

Browse files
authored
(bump:minor) Feat: Add mechanism for user-site update and auto creating releases (Cinnamon#56)
* move flowsettings.py and launch.py to root * update docs * sync sub package versions * rename launch.py to app.py and make run scripts work with installation package * add update scripts * auto version for root package * rename authors and update doc dir * Update auto-bump-and-release.yaml to trigger on push to main branch * latest as branch instead of tag * pin deps versions * cache the changelogs
1 parent eb198e0 commit 654501e

20 files changed

+597
-146
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Auto Bump and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
auto-bump-and-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the repo
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Update Application Version
17+
id: update-version
18+
uses: anothrNick/github-tag-action@v1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
WITH_V: true
22+
DEFAULT_BUMP: none
23+
MAJOR_STRING_TOKEN: "bump:major"
24+
MINOR_STRING_TOKEN: "bump:minor"
25+
PATCH_STRING_TOKEN: "bump:patch"
26+
- name: Create release for ${{ steps.update-version.outputs.new_tag }}
27+
run: |
28+
echo Create release folder
29+
mkdir kotaemon-app
30+
echo ${{ steps.update-version.outputs.new_tag }} > kotaemon-app/VERSION
31+
cp LICENSE.txt kotaemon-app/
32+
cp flowsettings.py kotaemon-app/
33+
cp app.py kotaemon-app/
34+
cp -r scripts kotaemon-app/
35+
tree kotaemon-app
36+
zip -r kotaemon-app.zip kotaemon-app
37+
- name: Release ${{ steps.update-version.outputs.new_tag }}
38+
uses: softprops/action-gh-release@v2
39+
with:
40+
files: kotaemon-app.zip
41+
fail_on_unmatched_files: true
42+
token: ${{ secrets.GITHUB_TOKEN }}
43+
generate_release_notes: true
44+
tag_name: ${{ steps.update-version.outputs.new_tag }}
45+
make_latest: true
46+
- name: Update latest branch
47+
run: git branch -f latest tags/${{ steps.update-version.outputs.new_tag }}

.github/workflows/style-check.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Clone the repo
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v4
1515
- name: Setup python
1616
uses: actions/setup-python@v4
1717
with:

.github/workflows/unit-test.yaml

+4-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
name: unit testing with python ${{ matrix.python-version }}
3434
steps:
3535
- name: Clone the repo
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3737
with:
3838
ref: ${{ github.event.pull_request.head.sha }}
3939

@@ -56,11 +56,9 @@ jobs:
5656

5757
- name: Get cache key
5858
id: get-cache-key
59-
# using tomli so that it works on windows. From python 3.11, this can be switched to the
60-
# built-in tomllib
6159
run: |
62-
pip install tomli
63-
package_version=$(python -c "import tomli; print(tomli.load(open('libs/kotaemon/pyproject.toml', 'rb'))['project']['version'])")
60+
pip install "setuptools-git-versioning>=2.0,<3"
61+
package_version=$(setuptools-git-versioning)
6462
cache_key="${{ runner.os }}-py${{ matrix.python-version }}-v${package_version}"
6563
echo "key=$cache_key" | tee -a ${{ matrix.GITHUB_OUTPUT }}
6664
@@ -82,10 +80,7 @@ jobs:
8280
cache_hit=${{ steps.restore-dependencies.outputs.cache-primary-key == steps.restore-dependencies.outputs.cache-matched-key }}
8381
echo "check=$cache_hit" | tee -a ${{ matrix.GITHUB_OUTPUT }}
8482
85-
- name: Install dependencies if ignore caching or no cache hit
86-
if: |
87-
steps.check-ignore-cache.outputs.check == 'true' ||
88-
steps.check-cache-hit.outputs.check != 'true'
83+
- name: Install additional dependencies (if any)
8984
run: |
9085
python -m pip install --upgrade pip
9186
cd libs/kotaemon

README.md

+17-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# kotaemon
22

3-
Build and use local RAG-based Question Answering (QA) applications.
3+
An open-source tool for chatting with your documents. Built with both end users and
4+
developers in mind.
45

56
https://github.com/Cinnamon/kotaemon/assets/25688648/815ecf68-3a02-4914-a0dd-3f8ec7e75cd9
67

@@ -28,6 +29,21 @@ documents and developers who want to build their own QA pipeline.
2829
- See your RAG pipeline in action with the provided UI (built with Gradio).
2930
- Share your pipeline so that others can use it.
3031

32+
```yml
33+
+----------------------------------------------------------------------------+
34+
| End users: Those who use apps built with `kotaemon`. |
35+
| (You use an app like the one in the demo above) |
36+
| +----------------------------------------------------------------+ |
37+
| | Developers: Those who built with `kotaemon`. | |
38+
| | (You have `import kotaemon` somewhere in your project) | |
39+
| | +----------------------------------------------------+ | |
40+
| | | Contributors: Those who make `kotaemon` better. | | |
41+
| | | (You make PR to this repo) | | |
42+
| | +----------------------------------------------------+ | |
43+
| +----------------------------------------------------------------+ |
44+
+----------------------------------------------------------------------------+
45+
```
46+
3147
This repository is under active development. Feedback, issues, and PRs are highly
3248
appreciated. Your input is valuable as it helps us persuade our business guys to support
3349
open source.

libs/ktem/launch.py app.py

File renamed without changes.

docs/about.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# About Kotaemon
2+
3+
An open-source tool for chatting with your documents. Built with both end users and
4+
developers in mind.
5+
6+
[Source Code](https://github.com/Cinnamon/kotaemon) |
7+
[Live Demo](https://huggingface.co/spaces/lone17/kotaemon-app)
8+
9+
[User Guide](https://cinnamon.github.io/kotaemon/) |
10+
[Developer Guide](https://cinnamon.github.io/kotaemon/development/) |
11+
[Feedback](https://github.com/Cinnamon/kotaemon/issues)

docs/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Download and upzip the latest version of `kotaemon` by clicking this
1919
2. Enable All Applications and choose Terminal.
2020
3. NOTE: If you always want to open that file with Terminal, then check Always Open With.
2121
4. From now on, double click on your file and it should work.
22-
- Linux: `run_linux.sh`. If you are using Linux, you would know how to run a bash script, right ?
22+
- Linux: `run_linux.sh`. Please run the script using `bash run_linux.sh` in your terminal.
2323
2. After the installation, the installer will ask to launch the ktem's UI, answer to continue.
2424
3. If launched, the application will be open automatically in your browser.
2525

docs/pages/app/customize-flows.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ At high level, to add new indexing and reasoning pipeline:
88
`BaseComponent`.
99
2. You declare that class in the setting files `flowsettings.py`.
1010

11-
Then when `python launch.py`, the application will dynamically load those
11+
Then when `python app.py`, the application will dynamically load those
1212
pipelines.
1313

1414
The below sections talk in more detail about how the pipelines should be

libs/ktem/flowsettings.py flowsettings.py

+6
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
this_file = getframeinfo(cur_frame).filename
1212
this_dir = Path(this_file).parent
1313

14+
# change this if your app use a different name
15+
KH_PACKAGE_NAME = "kotaemon_app"
16+
1417
# App can be ran from anywhere and it's not trivial to decide where to store app data.
1518
# So let's use the same directory as the flowsetting.py file.
1619
KH_APP_DATA_DIR = this_dir / "ktem_app_data"
@@ -20,6 +23,9 @@
2023
KH_USER_DATA_DIR = KH_APP_DATA_DIR / "user_data"
2124
KH_USER_DATA_DIR.mkdir(parents=True, exist_ok=True)
2225

26+
# doc directory
27+
KH_DOC_DIR = this_dir / "docs"
28+
2329
# HF models can be big, let's store them in the app data directory so that it's easier
2430
# for users to manage their storage.
2531
# ref: https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache

libs/kotaemon/pyproject.toml

+44-45
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,78 @@
11
# build backand and build dependencies
22
[build-system]
3-
requires = ["setuptools >= 61.0"]
3+
requires = ["setuptools >= 61.0", "wheel", "setuptools-git-versioning>=2.0,<3"]
44
build-backend = "setuptools.build_meta"
55

66
[tool.setuptools]
77
include-package-data = false
88
packages.find.include = ["kotaemon*"]
99
packages.find.exclude = ["tests*", "env*"]
1010

11+
[tool.setuptools-git-versioning]
12+
enabled = true
13+
dev_template = "{tag}"
14+
dirty_template = "{tag}"
15+
tag_filter = "v?\\d+(\\.\\d+)*.*"
16+
1117
# metadata and dependencies
1218
[project]
1319
name = "kotaemon"
14-
version = "0.3.12"
20+
dynamic = ["version"]
1521
requires-python = ">= 3.10"
1622
description = "Kotaemon core library for AI development."
1723
dependencies = [
18-
"langchain",
19-
"langchain-community",
20-
"langchain-openai",
21-
"openai",
22-
"theflow",
23-
"llama-index>=0.9.0,<0.10.0",
24-
"llama-hub",
25-
"gradio>=4.26.0",
26-
"openpyxl",
27-
"cookiecutter",
28-
"click",
29-
"pandas",
30-
"trogon",
31-
"tenacity",
32-
"python-dotenv", # currently used to read configs from file, should be remove in the future
33-
"chromadb",
34-
"unstructured",
35-
"pypdf",
36-
"html2text",
37-
"fastembed",
24+
"langchain>=0.1.16,<0.2.0",
25+
"langchain-community>=0.0.34,<0.1.0",
26+
"langchain-openai>=0.1.4,<0.2.0",
27+
"openai>=1.23.6,<2",
28+
"theflow>=0.8.6,<0.9.0",
29+
"llama-index==0.9.48",
30+
"llama-hub>=0.0.79,<0.1.0",
31+
"gradio>=4.26.0,<5",
32+
"openpyxl>=3.1.2,<3.2",
33+
"cookiecutter>=2.6.0,<2.7",
34+
"click>=8.1.7,<9",
35+
"pandas>=2.2.2,<2.3",
36+
"trogon>=0.5.0,<0.6",
37+
"tenacity>=8.2.3,<8.3",
38+
"python-dotenv>=1.0.1,<1.1",
39+
"chromadb>=0.4.21,<0.5",
40+
"unstructured==0.13.4",
41+
"pypdf>=4.2.0,<4.3",
42+
"html2text==2024.2.26",
43+
"fastembed==0.2.6",
44+
"llama-cpp-python==0.2.65",
45+
"azure-ai-documentintelligence",
46+
"cohere>=5.3.2,<5.4",
3847
]
3948
readme = "README.md"
40-
license = { text = "MIT License" }
4149
authors = [
42-
{ name = "john", email = "[email protected]" },
43-
{ name = "ian", email = "[email protected]" },
44-
{ name = "tadashi", email = "[email protected]" },
50+
{ name = "@trducng", email = "[email protected]" },
51+
{ name = "@lone17", email = "[email protected]" },
52+
{ name = "@taprosoft", email = "[email protected]" },
53+
{ name = "@cin-albert", email = "[email protected]" },
4554
]
4655
classifiers = [
4756
"Programming Language :: Python :: 3",
48-
"License :: OSI Approved :: MIT License",
4957
"Operating System :: OS Independent",
5058
]
5159

5260
[project.optional-dependencies]
5361
adv = [
54-
"wikipedia",
55-
"duckduckgo-search",
56-
"googlesearch-python",
57-
"python-docx",
58-
"pytest-mock",
59-
"unstructured[pdf]",
60-
"sentence_transformers",
61-
"cohere",
62-
"elasticsearch",
63-
"llama-cpp-python",
62+
"wikipedia>=1.4.0,<1.5",
63+
"duckduckgo-search>=5.3.0,<5.4.0",
64+
"googlesearch-python>=1.2.4,<1.3",
65+
"python-docx>=1.1.0,<1.2",
66+
"unstructured[pdf]==0.13.4",
67+
"sentence_transformers==2.7.0",
68+
"elasticsearch>=8.13.0,<8.14",
6469
"pdfservices-sdk @ git+https://github.com/niallcm/pdfservices-python-sdk.git@bump-and-unfreeze-requirements",
65-
"fastembed",
66-
"beautifulsoup4",
67-
"azure-ai-documentintelligence",
70+
"beautifulsoup4>=4.12.3,<4.13",
6871
]
6972
dev = [
7073
"ipython",
7174
"pytest",
75+
"pytest-mock",
7276
"pre-commit",
7377
"black",
7478
"flake8",
@@ -80,8 +84,3 @@ all = ["kotaemon[adv,dev]"]
8084

8185
[project.scripts]
8286
kotaemon = "kotaemon.cli:main"
83-
84-
[project.urls]
85-
Homepage = "https://github.com/Cinnamon/kotaemon/"
86-
Repository = "https://github.com/Cinnamon/kotaemon/"
87-
Documentation = "https://github.com/Cinnamon/kotaemon/wiki"

libs/ktem/README.md

-24
This file was deleted.

0 commit comments

Comments
 (0)