Skip to content

Commit

Permalink
Merge pull request #210 from ericdill/contributing
Browse files Browse the repository at this point in the history
Add instructions for installing the pre-commit hooks
  • Loading branch information
mariusvniekerk authored Jul 12, 2022
2 parents 1160b1c + 0348a43 commit 20e28f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@ dist/
venv/
test_install*.yml
test_install*.lock
tests/**/*.lock
tests/**/*.yml
tests/**/*.bak
site/
filelock
filelock
.coverage
22 changes: 15 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@

For the most up-to-date instructions see the github actions [test.yml workflow](./github/workflows.test.yml)

1. Install conda and mamba
1. mamba create -n test pip pytest-cov pytest-xdist pip
1. conda activate test
1. python -m pip install -r requirements.txt
1. python -m pip install -r requirements-dev.txt
1. pip install -e . --no-deps --force-reinstall
1. pytest -n auto -vrsx --cov=conda_lock tests
1. Ensure conda and mamba are installed. Install [mambaforge](https://github.com/conda-forge/miniforge#mambaforge) if you're otherwise not sure which one to pick.
2. `mamba create -n conda-lock-dev pip pytest-cov pytest-xdist pip`
3. `conda activate conda-lock-dev`
4. `python -m pip install -r requirements.txt`
5. `python -m pip install -r requirements-dev.txt`
6. `pip install -e . --no-deps --force-reinstall`

Run the tests to ensure that everything is running correctly. Due to the nature of this project, it hits remote webservers regularly so some tests occasionally fail. This is a normal part of conda-lock development. If you're not sure if your env is borked or the remote webserver is just being flaky, run the tests again. If you're still not sure you can open an issue about.

7. `pytest`

Whilst not strictly necessary; the CI run using github actions will run pre-commit in order to reduce development friction you may want to install the pre-commit hooks:

8. `pre-commit install`

5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
[tool:pytest]
addopts = -vrsx -n auto
flake8-max-line-length = 105
flake8-ignore =
docs/* ALL
conda_lock/_version.py ALL

[coverage:run]
omit = conda_lock/vendor/*
source = conda_lock/*

[metadata]
name = conda_lock
description = Lockfiles for conda
Expand Down

0 comments on commit 20e28f1

Please sign in to comment.