Commit 87b1a020 authored by Arun's avatar Arun
Browse files

added dependency and pytest marker guidelines

parent 169b2fba
Loading
Loading
Loading
Loading
+30 −14
Original line number Diff line number Diff line
@@ -36,14 +36,7 @@ packages. If you want to manage multiple builds of DeepChem, you can make use of
to maintain seperate Python package environments, each of which can be tied
to a specific build of DeepChem. Here are some tips to get started:

1. Set up a new conda environment for DeepChem

```bash
conda create -n deepchem python=3.8
conda activate deepchem
```

2. Fork the [DeepChem](https://github.com/deepchem/deepchem/) repository
1. Fork the [DeepChem](https://github.com/deepchem/deepchem/) repository
and clone the forked repository

```bash
@@ -51,13 +44,30 @@ git clone https://github.com/YOUR-USERNAME/deepchem.git
cd deepchem
```

 2.1. If you already have DeepChem from source, update it:

     1.1. If you already have DeepChem from source, update it by running
```bash
git fetch upstream
git rebase upstream/master
```

2. Set up a new conda environment for DeepChem

```bash
conda create -n deepchem python=3.8
conda activate deepchem
```

     2.1. DeepChem provides backend support with tensorflow, pytorch or jax.
For developemnt of DeepChem with one of the above backend, update the environment using
```bash
conda env update -n deepchem --file requirements/backend-name/env_backend-name.yml --prune
```
You need to replace `backend-name` with one of `tensorflow`, `pytorch` or `jax`. PyTorch
by default is installed with GPU support. For pytorch CPU, use the following command:
```bash
conda env update -n deepchem --file requirements/torch/env_torch.cpu.yml --prune
```

3. Install DeepChem in `develop` mode

```bash
@@ -73,7 +83,13 @@ In case you need to reinstall, uninstall DeepChem first by running
as it is not installed`; run `python setup.py clean` and install in `develop` mode again.

Some other tips:
- DeepChem has a number of requirements which can be found [here](https://deepchem.readthedocs.io/en/latest/get_started/requirements.html).
- Every contribution must pass the unit tests. Some tests are
[marked](https://docs.pytest.org/en/6.2.x/example/markers.html) with custom
markers like `@pytest.mark.tensorflow`. This helps mainly in two ways: 1) restricting the tests only
to the part of code marked with the marker 2) giving
[flexibility](https://docs.pytest.org/en/6.2.x/example/markers.html) in running
the unit tests depending on the environment.
- DeepChem has a number of soft requirements which can be found [here](https://deepchem.readthedocs.io/en/latest/get_started/requirements.html).
- If a commit is simple and doesn't affect any code (keep in mind that some
docstrings contain code that is used in tests), you can add `[skip ci]`
(case sensitive) somewhere in your commit message to [skip all build /
@@ -82,7 +98,6 @@ test steps](https://github.blog/changelog/2021-02-08-github-actions-skip-pull-re

### Pull Request Process


Every contribution, must be a pull request and must have adequate time for
review by other committers.

@@ -102,6 +117,7 @@ DeepChem uses these tools or styles for keeping our codes healthy.
- [Flake8](https://flake8.pycqa.org/en/latest/) (code style check)
- [mypy](http://mypy-lang.org/) (type check)
- [doctest](https://docs.python.org/3/library/doctest.html) (interactive examples)
- [pytest](https://docs.pytest.org/en/6.2.x/index.html) (unit testing)

Before making a PR, please check your codes using them.
You can confirm how to check your codes from [Coding Conventions](https://deepchem.readthedocs.io/en/latest/development_guide/coding.html).
@@ -110,8 +126,8 @@ You can confirm how to check your codes from [Coding Conventions](https://deepch

DeepChem uses [Sphinx](https://www.sphinx-doc.org/en/master/) to build
[the document](https://deepchem.readthedocs.io/en/latest/index.html).
The document is automatically built by [Numpy style docstrings]
(https://numpydoc.readthedocs.io/en/latest/format.html#numpydoc-docstring-guide)
The document is automatically built by
[Numpy style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html#numpydoc-docstring-guide)
in source codes and [Napoleon extension](http://www.sphinx-doc.org/en/stable/ext/napoleon.html).
For any changes or modification to source code in a PR, please don't forget to add or modify Numpy style docstrings.