Skip to content

Commit

Permalink
Update contributing.md (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacker authored Nov 27, 2023
1 parent 84e761d commit 3e0189a
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 18 deletions.
37 changes: 32 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,49 @@ git clone https://github.com/your-username/MemGPT.git
### 🧩 Install Dependencies

**Installing dependencies with poetry** (recommended):

First, install Poetry using [the official instructions here](https://python-poetry.org/docs/#installation).

Once Poetry is installed, navigate to the MemGPT directory and install the MemGPT project with Poetry:
```shell
cd MemGPT
pip install poetry
poetry shell
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`.

Now when you want to use `memgpt`, make sure you first activate the `poetry` environment using poetry shell:
```shell
$ poetry shell
(pymemgpt-py3.10) $ memgpt run
```

Alternatively, you can use `poetry run` (which will activate the `poetry` environment for the `memgpt run` command only):
```shell
poetry run memgpt run
```

**Installing dependencies with pip**:

First you should set up a dedicated virtual environment. This is optional, but is highly recommended:
```shell
cd MemGPT
# Optional: set up a virtual environment.
# python3 -m venv venv
# . venv/bin/activate
python3 -m venv venv
. venv/bin/activate
```

Once you've activated your virtual environment and are in the MemGPT project directory, you can install the dependencies with `pip`:
```shell
pip install -e '.[dev,postgres,local,legacy]'
```

Now, you should be able to run `memgpt` from the command-line using the downloaded source code (if you used a virtual environment, you have to activate the virtual environment to access `memgpt`):
```shell
$ . venv/bin/activate
(venv) $ memgpt run
```

If you are having dependency issues using `pip`, we recommend you install the package using Poetry. Installing MemGPT from source using Poetry will ensure that you are using exact package versions that have been tested for the production build.

#### (Optional) Installing pre-commit
We recommend installing pre-commit to ensure proper formatting during development:
```
Expand Down
44 changes: 31 additions & 13 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
# Contributing

## Installing from source

To install MemGPT from source, start by cloning the repo:
```sh
git clone [email protected]:cpacker/MemGPT.git
```

**Installing dependencies with poetry** (recommended):
### Installing dependencies with poetry** (recommended)

First, install Poetry using [the official instructions here](https://python-poetry.org/docs/#installing-with-the-official-installer).
First, install Poetry using [the official instructions here](https://python-poetry.org/docs/#installation).

Once Poetry is installed, navigate to the MemGPT directory and install the MemGPT project with Poetry:
```shell
cd MemGPT
pip install poetry
poetry shell
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**:
Now when you want to use `memgpt`, make sure you first activate the `poetry` environment using poetry shell:
```shell
$ poetry shell
(pymemgpt-py3.10) $ memgpt run
```

Alternatively, you can use `poetry run` (which will activate the `poetry` environment for the `memgpt run` command only):
```shell
poetry run memgpt run
```

### Installing dependencies with pip

First you should set up a dedicated virtual environment. This is optional, but is highly recommended:
```shell
cd MemGPT
# Optional: set up a virtual environment.
# python3 -m venv venv
# . venv/bin/activate
python3 -m venv venv
. venv/bin/activate
```

Once you've activated your virtual environment and are in the MemGPT project directory, you can install the dependencies with `pip`:
```shell
pip install -e '.[dev,postgres,local,legacy]'
```

Now, you should be able to run `memgpt` from the command-line using the downloaded source code.
Now, you should be able to run `memgpt` from the command-line using the downloaded source code (if you used a virtual environment, you have to activate the virtual environment to access `memgpt`):
```shell
$ . venv/bin/activate
(venv) $ memgpt run
```

If you are having dependency issues using `pip install -e .`, we recommend you install the package using Poetry (see below). Installing MemGPT from source using Poetry will ensure that you are using exact package versions that have been tested for the production build.
If you are having dependency issues using `pip`, we recommend you install the package using Poetry. Installing MemGPT from source using Poetry will ensure that you are using exact package versions that have been tested for the production build.

### Contributing to the MemGPT project
## Contributing to the MemGPT project

We welcome pull requests! Please see [our contributing guide](https://github.com/cpacker/MemGPT/blob/main/CONTRIBUTING.md) for instructions on how to contribute to the project.

0 comments on commit 3e0189a

Please sign in to comment.