You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ops: add pre-commit and hooks for code checking (#641)
* ops: add pre-commit and hooks for checking
* chore: pass pre-commit checks
* docs: add pre-commit setup instructions
* fix: run maturin before other hooks on relevant file changes
Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/💡-feature-request.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,4 @@ assignees: ''
17
17
18
18
---
19
19
❤️ Contributors, please refer to 📙[Contributing Guide](https://cocoindex.io/docs/about/contributing).
20
-
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like **`I'm working on it`** or **`Can I work on this issue?`** to avoid duplicating work. Our [Discord server](https://discord.com/invite/zpA9S2DR7s) is always open and friendly.
20
+
Unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like **`I'm working on it`** or **`Can I work on this issue?`** to avoid duplicating work. Our [Discord server](https://discord.com/invite/zpA9S2DR7s) is always open and friendly.
Copy file name to clipboardExpand all lines: README.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,10 @@ Unlike a workflow orchestration framework where data is usually opaque, in CocoI
32
32
33
33
```python
34
34
# import
35
-
data['content'] = flow_builder.add_source(...)
35
+
data['content'] = flow_builder.add_source(...)
36
36
37
37
# transform
38
-
data['out'] = data['content']
38
+
data['out'] = data['content']
39
39
.transform(...)
40
40
.transform(...)
41
41
@@ -56,17 +56,17 @@ As a data framework, CocoIndex takes it to the next level on data freshness. **I
56
56
The frameworks takes care of
57
57
- Change data capture.
58
58
- Figure out what exactly needs to be updated, and only updating that without having to recompute everything.
59
-
59
+
60
60
This makes it fast to reflect any source updates to the target store. If you have concerns with surfacing stale data to AI agents and are spending lots of efforts working on infra piece to optimize the latency, the framework actually handles it for you.
61
61
62
62
63
63
## Quick Start:
64
-
If you're new to CocoIndex, we recommend checking out
64
+
If you're new to CocoIndex, we recommend checking out
- 🎬 [Quick Start Video Tutorial](https://youtu.be/gv5R8nOXsWU?si=9ioeKYkMEnYevTXT)
67
+
- 🎬 [Quick Start Video Tutorial](https://youtu.be/gv5R8nOXsWU?si=9ioeKYkMEnYevTXT)
68
68
69
-
### Setup
69
+
### Setup
70
70
71
71
1. Install CocoIndex Python library
72
72
@@ -136,8 +136,8 @@ It defines an index flow like this:
136
136
|[Google Drive Text Embedding](examples/gdrive_text_embedding)| Index text documents from Google Drive |
137
137
|[Docs to Knowledge Graph](examples/docs_to_knowledge_graph)| Extract relationships from Markdown documents and build a knowledge graph |
138
138
|[Embeddings to Qdrant](examples/text_embedding_qdrant)| Index documents in a Qdrant collection for semantic search |
139
-
|[FastAPI Server with Docker](examples/fastapi_server_docker)| Run the semantic search server in a Dockerized FastAPI setup |
140
-
|[Product Recommendation](examples/product_recommendation)| Build real-time product recommendations with LLM and graph database|
139
+
|[FastAPI Server with Docker](examples/fastapi_server_docker)| Run the semantic search server in a Dockerized FastAPI setup |
140
+
|[Product Recommendation](examples/product_recommendation)| Build real-time product recommendations with LLM and graph database|
141
141
|[Image Search with Vision API](examples/image_search)| Generates detailed captions for images using a vision model, embeds them, enables live-updating semantic search via FastAPI and served on a React frontend|
142
142
143
143
More coming and stay tuned 👀!
@@ -159,7 +159,7 @@ Join our community here:
159
159
- 📜 [Read our blog posts](https://cocoindex.io/blogs/)
160
160
161
161
## Support us:
162
-
We are constantly improving, and more features and examples are coming soon. If you love this project, please drop us a star ⭐ at GitHub repo [](https://github.com/cocoindex-io/cocoindex) to stay tuned and help us grow.
162
+
We are constantly improving, and more features and examples are coming soon. If you love this project, please drop us a star ⭐ at GitHub repo [](https://github.com/cocoindex-io/cocoindex) to stay tuned and help us grow.
Copy file name to clipboardExpand all lines: docs/docs/about/contributing.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,22 +15,22 @@ We use [GitHub Issues](https://github.com/cocoindex-io/cocoindex/issues) to trac
15
15
16
16
We tag issues with the ["good first issue"](https://github.com/cocoindex-io/cocoindex/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label for beginner contributors.
17
17
18
-
## How to Contribute
18
+
## How to Contribute
19
19
- If you decide to work on an issue, unless the PR can be sent immediately (e.g. just a few lines of code), we recommend you to leave a comment on the issue like **`I'm working on it`** or **`Can I work on this issue?`** to avoid duplicating work.
20
20
- For larger features, we recommend you to discuss with us first in our [Discord server](https://discord.com/invite/zpA9S2DR7s) to coordinate the design and work.
21
21
- Our [Discord server](https://discord.com/invite/zpA9S2DR7s) are constantly open. If you are unsure about anything, it is a good place to discuss! We'd love to collaborate and will always be friendly.
22
22
23
-
## Start hacking! Setting Up Development Environment
23
+
## Start hacking! Setting Up Development Environment
24
24
Following the steps below to get cocoindex build on latest codebase locally - if you are making changes to cocoindex funcionality and want to test it out.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
31
31
```
32
-
Already have Rust? Make sure it's up to date
33
-
```sh
32
+
Already have Rust? Make sure it's up to date
33
+
```sh
34
34
rustup update
35
35
```
36
36
@@ -46,14 +46,19 @@ Following the steps below to get cocoindex build on latest codebase locally - if
46
46
47
47
- Install required tools:
48
48
```sh
49
-
pip install maturin mypy ruff
49
+
pip install maturin mypy pre-commit
50
50
```
51
51
52
52
- Build the library. Run at the root of cocoindex directory:
53
53
```sh
54
54
maturin develop
55
55
```
56
56
57
+
- Install and enable pre-commit hooks. This ensures all checks run automatically before each commit:
58
+
```sh
59
+
pre-commit install
60
+
```
61
+
57
62
- Before running a specific example, set extra environment variables, for exposing extra traces, allowing dev UI, etc.
58
63
```sh
59
64
. ./.env.lib_debug
@@ -67,10 +72,14 @@ To submit your code:
67
72
1. Fork the [CocoIndex repository](https://github.com/cocoindex-io/cocoindex)
68
73
2. [Create a new branch](https://docs.github.com/en/desktop/making-changes-in-a-branch/managing-branches-in-github-desktop) on your fork
69
74
3. Make your changes
70
-
4. Make sure all tests and linting pass by running
71
-
```sh
72
-
./check.sh
73
-
```
75
+
4. Run the pre-commit checks (automatically triggered on `git commit`)
76
+
77
+
:::tip
78
+
To run them manually (same as CI):
79
+
```sh
80
+
pre-commit run --all-files
81
+
```
82
+
:::
74
83
75
84
5. [Open a Pull Request (PR)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork) when your work is ready for review
Copy file name to clipboardExpand all lines: docs/docs/core/basics.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ An indexing flow, once set up, maintains a long-lived relationship between data
71
71
72
72
***One time update**: Once triggered, CocoIndex updates the target data to reflect the version of source data up to the current moment.
73
73
***Live update**: CocoIndex continuously reacts to changes of source data and updates the target data accordingly, based on various **change capture mechanisms** for the source.
74
-
74
+
75
75
See more details in the [build / update target data](flow_methods#build--update-target-data) section.
76
76
77
77
3. CocoIndex intelligently reprocesses to propagate source changes to target by:
@@ -101,4 +101,4 @@ As an indexing flow is long-lived, it needs to store intermediate data to keep t
101
101
CocoIndex uses internal storage for this purpose.
102
102
103
103
Currently, CocoIndex uses Postgres database as the internal storage.
104
-
See [Settings](settings#databaseconnectionspec) for configuring its location, and `cocoindex setup` CLI command (see [CocoIndex CLI](cli)) creates tables for the internal storage.
104
+
See [Settings](settings#databaseconnectionspec) for configuring its location, and `cocoindex setup` CLI command (see [CocoIndex CLI](cli)) creates tables for the internal storage.
0 commit comments