Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update contributing guidelines #516

Merged
merged 6 commits into from
Nov 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 43 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,28 @@ git clone https://github.com/your-username/MemGPT.git

### 🧩 Install Dependencies

**Installing dependencies with poetry** (recommended):
```shell
cd MemGPT
pip install poetry
poetry install -E dev -E postgres -E local -E legacy
```
If you are managing dependencies with poetry, you will need to run MemGPT commands with `poetry run memgpt run`.

**Installing dependencies with pip**:
```shell
cd MemGPT
# Optional: set up a virtual environment.
# python3 -m venv venv
# . venv/bin/activate
pip install -r requirements.txt
pip install -e '.[dev,postgres,local,legacy]'
```

#### (Optional) Installing pre-commit
We recommend installing pre-commit to ensure proper formatting during development:
```
poetry run pre-commit install
poetry run pre-commit run --all-files
```

## 2. 🛠️ Making Changes
Expand All @@ -47,13 +63,31 @@ Now, the world is your oyster! Go ahead and craft your fabulous changes. 🎨

Before we hit the 'Wow, I'm Done' button, let's make sure everything works as expected. Run tests and make sure the existing ones don't throw a fit. And if needed, create new tests. 🕵️

Make sure that you can run
```shell
python3 main.py
### Run existing tests

Running tests if you installed via poetry:
```
successfully before submitting a pull request.
poetry run pytest -s tests
```

Running tests if you installed via pip:
```
pytest -s tests
```

### Creating new tests
If you added a major feature change, please add new tests in the `tests/` directory.

## 4. 🚀 Submitting Changes
## 4. 🧩 Adding new dependencies
If you need to add a new dependency to MemGPT, please add the package via `poetry add <PACKAGE_NAME>`. This will update the `pyproject.toml` and `poetry.lock` files. If the dependency does not need to be installed by all users, make sure to mark the dependency as optional in the `pyproject.toml` file and if needed, create a new extra under `[tool.poetry.extras]`.

## 5. 🚀 Submitting Changes

### Check Formatting
Please ensure your code is formatted correctly by running:
```
poetry run black . -l 140
```

### 🚀 Create a Pull Request

Expand All @@ -64,15 +98,15 @@ You're almost there! It's time to share your brilliance with the world. 🌍
3. Choose the base branch (`main`) and the compare branch (your feature branch).
4. Whip up a catchy title and describe your changes in the description. 🪄

## 5. 🔍 Review and Approval
## 6. 🔍 Review and Approval

The maintainers, will take a look and might suggest some cool upgrades or ask for more details. Once they give the thumbs up, your creation becomes part of MemGPT!

## 6. 📜 Code of Conduct
## 7. 📜 Code of Conduct

Please be sure to follow the project's Code of Conduct.

## 7. 📫 Contact
## 8. 📫 Contact

Need help or just want to say hi? We're here for you. Reach out through filing an issue on this GitHub repository or message us on our [Discord server](https://discord.gg/9GEQrxmVyE).

Expand Down