# Developer Guide
Before getting started, check out the `#bentoml-contributors` channel in the [BentoML community slack](https://l.bentoml.com/join-slack).
If you are interested in contributing to existing issues and feature requests, check out the [good-first-issue](https://github.com/bentoml/BentoML/issues?q=is%3Aopen+is%3Aissue+label%3Agood-first-issue) and [help-wanted](https://github.com/bentoml/BentoML/issues?q=is%3Aopen+is%3Aissue+label%3Ahelp-wanted) issues list.
If you are interested in proposing a new feature, make sure to create a new feature request ticket [here](https://github.com/bentoml/BentoML/issues/new/choose) and share your proposal in the `#bentoml-contributors` slack channel for feedback.
## Start Developing
1. Make sure to have [Git](https://git-scm.com/),
[pip](https://pip.pypa.io/en/stable/installation/),
[Python3.9+](https://www.python.org/downloads/), and
[PDM](https://pdm.fming.dev/latest/) installed.
Optionally, make sure to have [GNU Make](https://www.gnu.org/software/make/)
available on your system if you aren't using a UNIX-based system for a better
developer experience. If you don't want to use `make` then please refer to
the [Makefile](./Makefile) for specific commands on a given make target.
2. Fork the BentoML project on [GitHub](https://github.com/bentoml/BentoML).
3. Clone the source code from your fork of BentoML's GitHub repository:
```bash
git clone [email protected]:username/BentoML.git && cd BentoML
```
4. Add the BentoML upstream remote to your local BentoML clone:
```bash
git remote add upstream [email protected]:bentoml/BentoML.git
```
5. Configure git to pull from the upstream remote:
```bash
git switch main # ensure you're on the main branch
git fetch upstream --tags
git branch --set-upstream-to=upstream/main
```
6. Install BentoML in editable and all development dependencies:
```bash
pdm install -G all
pre-commit install
```
This installs BentoML with editable mode via `pdm` and development
dependencies in a isolated environment. If you wish not to setup within an
isolated environment, pass `--no-isolation` to pdm
> **Note**: Make sure to prepend `pdm run` to all commands within this guide
> if you are using isolated environment via `pdm`.
7. Test the BentoML installation either with `bash`:
```bash
bentoml --version
```
or in a Python session:
```python
import bentoml
print(bentoml.__version__)
```
with the Command Line
1. Confirm that you have the following installed:
- [Python3.9+](https://www.python.org/downloads/)
- VS Code with the [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python) and [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) extensions
2. Fork the BentoML project on [GitHub](https://github.com/bentoml/BentoML).
3. Clone the GitHub repository:
1. Open the command palette with Ctrl+Shift+P and type in 'clone'.
2. Select 'Git: Clone(Recursive)'.
3. Clone BentoML.
4. Add an BentoML upstream remote:
1. Open the command palette and enter 'add remote'.
2. Select 'Git: Add Remote'.
3. Press enter to select 'Add remote' from GitHub.
4. Enter https://github.com/bentoml/BentoML.git to select the BentoML repository.
5. Name your remote 'upstream'.
5. Pull from the BentoML upstream remote to your main branch:
1. Open the command palette and enter 'checkout'.
2. Select 'Git: Checkout to...'
3. Choose 'main' to switch to the main branch.
4. Open the command palette again and enter 'pull from'.
5. Click on 'Git: Pull from...'
6. Select 'upstream'.
6. Open a new terminal by clicking the Terminal dropdown at the top of the window, followed by the 'New Terminal' option. Next, add a virtual environment with this command:
```bash
python -m venv .venv
```
7. Click yes if a popup suggests switching to the virtual environment. Otherwise, go through these steps:
1. Open any python file in the directory.
2. Select the interpreter selector on the blue status bar at the bottom of the editor.
![vscode-status-bar](https://user-images.githubusercontent.com/489344/166984038-75f1f4bd-c896-43ee-a7ee-1b57fda359a3.png)
3. Switch to the path that includes .venv from the dropdown at the top.
![vscode-select-venv](https://user-images.githubusercontent.com/489344/166984060-170d25f5-a91f-41d3-96f4-4db3c21df7c8.png)
8. Update your PowerShell execution policies. Win+x followed by the 'a' key opens the admin Windows PowerShell. Enter the following command to allow the virtual environment activation script to run:
```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```
with VS Code
1. Make sure you're on the main branch.
```bash
git switch main
```
2. Use the git pull command to retrieve content from the BentoML Github repository.
```bash
git pull
```
3. Create a new branch and switch to it.
```bash
git switch -c my-new-branch-name
```
4. Make your changes!
5. Use the git add command to save the state of files you have changed.
```bash
git add using the Command Line
1. Switch to the main branch:
1. Open the command palette with Ctrl+Shift+P.
2. Search for 'Git: Checkout to...'
3. Select 'main'.
2. Pull from the upstream remote:
1. Open the command palette.
2. Enter and select 'Git: Pull...'
3. Select 'upstream'.
3. Create and change to a new branch:
1. Type in 'Git: Create Branch...' in the command palette.
2. Enter a branch name.
4. Make your changes!
5. Stage all your changes:
1. Enter and select 'Git: Stage All Changes...' in the command palette.
6. Commit your changes:
1. Open the command palette and enter 'Git: Commit'.
7. Push your changes:
1. Enter and select 'Git: Push...' in the command palette.
using VS Code