Skip to content

Latest commit

 

History

History
141 lines (104 loc) · 3.2 KB

DEVELOPMENT.md

File metadata and controls

141 lines (104 loc) · 3.2 KB

Install BentoML from source code

Download the source code to local file system:

$ git clone https://github.com/bentoml/BentoML.git
$ cd BentoML

Ensure you have python and pip installed, BentoML supports python 2.7, 3.6, and 3.7

$ python --version
$ pip --version

And install BentoML with pip in editable mode:

pip install --editable .

This will make bentoml available on your system which links to the sources of your local clone and pick up changes you made locally.

Now you can test your BentoML installation by running the following in terminal:

$ bentoml --version

How to run BentoML tests

  1. Install all test dependencies:
pip install .[test]
  1. Run all tests with current python version and environment
$ pytest
  1. Run test under all supported python versions using Conda

Make sure you have conda installed:

$ conda --version

Bentoml tox file is configured to run in muiltple python versions:

$ tox

If you want to run tests under conda for specific version, use -e option:

$ tox -e py27
// or
$ tox -e py36

Using forks/branches of BentoML

When trying new BentoML feature that has not been released, testing a fork of BentoML on Google Colab or trying out changes in a pull request, an easy way of doing so is to use pip install git+... command, for example to install BentoML from its master branch with all latest changes:

pip install git+https://github.com/bentoml/BentoML.git

Or to install from your own fork of BentoML:

pip install git+https://github.com/{your_github_username}/BentoML.git

You can also specify what branch to install from:

pip install git+https://github.com/{your_github_username}/BentoML.git@{branch_name}

Style check and auto-formatting your code

Make sure to install all dev dependencies:

$ pip install -e .[dev]

# For zsh users, use:
$ pip install -e .\[dev\]

Run linter/format script:

./script/format.sh

./script/lint.sh

How to edit, run, build documentation site

Install all dev dependencies:

$ pip install -e .[dev]

To build documentation for locally:

$ ./script/build-docs.sh

Modify *.rst files inside the docs folder to update content, and to view your changes, run the following command:

$ python -m http.server --directory built-docs

And go to your browser at http://localhost:8000

Creating Pull Request on Github

  1. Fork BentoML project on github and add upstream to local BentoML clone:
$ git remote add upstream git@github.com:YOUR_USER_NAME/BentoML.git
  1. Make the changes either to fix a known issue or adding new feature

  2. Push changes to your fork and follow this article on how to create a pull request on github

  3. Once your pull request created, an automated test run will be triggered on your branch and the BentoML authors will be notified to review your code changes. Once tests are passed and reviewer has signed off, we will merge your pull request.