-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kenzie Mihardja
committed
Dec 4, 2023
1 parent
ac4c637
commit 58e29d9
Showing
18 changed files
with
229 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Contributing to Docugami | ||
|
||
Hi there! Thank you for even being interested in contributing to Docugami's dgml-utils. | ||
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether they involve new features, improved infrastructure, better documentation, or bug fixes. | ||
|
||
## 🗺️ Guidelines | ||
|
||
### 👩💻 Contributing Code | ||
|
||
To contribute to this project, please follow the ["fork and pull request"](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) workflow. | ||
Please do not try to push directly to this repo unless you are a maintainer. | ||
|
||
Please follow the checked-in pull request template when opening pull requests. Note related issues and tag relevant | ||
maintainers. | ||
|
||
Pull requests cannot land without passing the formatting, linting, and testing checks first. See [Testing](#testing) and | ||
[Formatting and Linting](#formatting-and-linting) for how to run these checks locally. | ||
|
||
If there's something you'd like to add or change, opening a pull request is the | ||
best way to get our attention. | ||
|
||
### 🚩GitHub Issues | ||
|
||
Our [issues](https://github.com/docugami/dgml-utils/issues) page is kept up to date with bugs, improvements, and feature requests. | ||
|
||
If you start working on an issue, please assign it to yourself. | ||
|
||
If you are adding an issue, please try to keep it focused on a single, modular bug/improvement/feature. | ||
If two issues are related, or blocking, please link them rather than combining them. | ||
|
||
We will try to keep these issues as up-to-date as possible, though | ||
with the rapid rate of development in this field some may get out of date. | ||
If you notice this happening, please let us know. | ||
|
||
### 🙋Getting Help | ||
|
||
Our goal is to have the simplest developer setup possible. Should you experience any difficulty getting setup, please | ||
contact a maintainer! Not only do we want to help get you unblocked, but we also want to make sure that the process is | ||
smooth for future contributors. | ||
|
||
In a similar vein, we do enforce certain linting, formatting, and documentation standards in the codebase. | ||
If you are finding these difficult (or even just annoying) to work with, feel free to contact a maintainer for help - | ||
we do not want these to get in the way of getting good code into the codebase. | ||
|
||
### Local Development Dependencies | ||
|
||
Install dgml-utils development requirements (for running dgml-utils, running examples, linting, formatting, tests, and coverage): | ||
|
||
```bash | ||
poetry install | ||
``` | ||
|
||
Then verify dependency installation: | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
### Testing | ||
|
||
Unit tests cover modular logic that does not require calls to outside APIs. | ||
If you add new logic, please add a unit test. | ||
|
||
To run unit tests: | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
### Formatting and Linting | ||
|
||
Run these locally before submitting a PR; the CI system will check also. | ||
|
||
#### Code Formatting | ||
|
||
Formatting for this project is done via [ruff](https://docs.astral.sh/ruff/rules/). | ||
|
||
To run formatting for docs, cookbook and templates: | ||
|
||
```bash | ||
make format | ||
``` | ||
|
||
#### Linting | ||
|
||
Linting for this project is done via a combination of [ruff](https://docs.astral.sh/ruff/rules/) and [mypy](http://mypy-lang.org/). | ||
|
||
To run linting for docs, cookbook and templates: | ||
|
||
```bash | ||
make lint | ||
``` | ||
|
||
We recognize linting can be annoying - if you do not want to do it, please contact a project maintainer, and they can help you with it. We do not want this to be a blocker for good code getting contributed. | ||
|
||
## 🏭 Release Process | ||
|
||
As of now, Docugami has an ad hoc release process: releases are cut with high frequency by | ||
a developer and published to [PyPI](https://pypi.org/project/dgml-utils/). |
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,32 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Screenshots** | ||
If applicable, add screenshots to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- OS: [e.g. iOS] | ||
- Browser [e.g. chrome, safari] | ||
- Version [e.g. 22] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
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,15 @@ | ||
<!-- Thank you for contributing to Docugami's dgml-utils! | ||
Replace this entire comment with: | ||
- **Description:** a description of the change, | ||
- **Issue:** the issue # it fixes (if applicable), | ||
- **Dependencies:** any dependencies required for this change, | ||
- **Tag maintainer:** for a quicker response, tag the relevant maintainer (see below), | ||
Please make sure your PR is passing linting before submitting. Run `make lint` to check this locally. | ||
See contribution guidelines for more information on how to write/run tests, lint, etc: | ||
https://github.com/docugami/dgml-utils/tree/main/.github/CONTRIBUTING.md | ||
If no one reviews your PR within a few days, please @-mention one of @tjaffri, @kenzie28. | ||
--> |
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,31 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Poetry | ||
run: | | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
shell: bash | ||
|
||
- name: Install dependencies | ||
working-directory: python | ||
run: poetry install | ||
|
||
- name: Lint code | ||
working-directory: python | ||
run: make lint | ||
|
||
- name: Check PR status | ||
run: | | ||
if [ -n "$(git diff --name-only ${{ github.base_ref }}..${{ github.head_ref }})" ]; then | ||
echo "Changes detected. Please make sure to push all changes to the branch before merging."; | ||
exit 1; | ||
fi |
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,7 @@ | ||
format: | ||
poetry run black . | ||
|
||
lint: | ||
poetry run ruff check . | ||
poetry run black --check . | ||
poetry run npx pyright . |
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,14 +1,12 @@ | ||
import os | ||
import sys | ||
from fastapi import FastAPI | ||
from langserve import add_routes | ||
from docugami_kg_rag.chain import chain as docugami_kg_rag_chain | ||
import subprocess | ||
|
||
app = FastAPI() | ||
|
||
add_routes(app, docugami_kg_rag_chain, path="/docugami-kg-rag") | ||
|
||
if __name__ == "__main__": | ||
import uvicorn | ||
|
||
uvicorn.run(app, host="0.0.0.0", port=8000) |
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
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
Oops, something went wrong.