Skip to content

Commit

Permalink
Update Developer Setup instructions in README to mention pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
omad authored and mergify[bot] committed May 13, 2019
1 parent a48f423 commit 972d388
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 27 deletions.
28 changes: 12 additions & 16 deletions .pre-commit-config.yaml
Expand Up @@ -2,26 +2,22 @@ repos:
- repo: https://github.com/adrienverge/yamllint.git
sha: v1.15.0
hooks:
- id: yamllint
- id: yamllint
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: flake8
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: debug-statements
- id: name-tests-test
args: ['--django']
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-merge-conflict
- id: flake8
- id: end-of-file-fixer
- id: check-docstring-first
- id: check-json
- id: check-yaml
- id: debug-statements
- id: name-tests-test
args: ['--django']
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-merge-conflict
- repo: https://github.com/pre-commit/mirrors-pylint
rev: 'v2.3.1' # Use the sha / tag you want to point at
hooks:
- id: pylint

# - repo: https://github.com/pre-commit/mirrors-pylint
# hooks:
# - id: pylint
28 changes: 17 additions & 11 deletions README.rst
Expand Up @@ -36,28 +36,34 @@ Developer setup

- ``git clone https://github.com/opendatacube/datacube-core.git``

2. Install the native libraries for `GDAL <http://www.gdal.org/>`__ &
NetCDF4.
2. Create a Python environment to use ODC within, we recommend `conda <https://docs.conda.io/en/latest/miniconda.html>`__ as the
easiest way to handle Python dependencies.

- This depends on your OS.
- Eg. ``yum install gdal``
::

3. Install Python dependencies:
conda create -n odc -c conda-forge python=3.7 datacube pre_commit
conda activate odc

``python setup.py develop``
3. Install a develop version of datacube-core.

Note that the versions must match between GDAL's Python bindings and
the native GDAL library. If you receive a gdal error when installing
dependencies, you may need to install a specific version first:
::

eg. ``pip install gdal==2.0.1``
cd datacube-core
pip install --upgrade -e .

4. Install the `pre-commit <https://pre-commit.com>`__ hooks to help follow ODC coding
conventions when committing with git.

::

pre-commit install

4. Run unit tests + PyLint

``./check-code.sh``

(this script approximates what is run by Travis. You can
alternatively run ``py.test`` yourself)
alternatively run ``pytest`` yourself)

5. **(or)** Run all tests, including integration tests.

Expand Down

0 comments on commit 972d388

Please sign in to comment.