Skip to content

Commit

Permalink
add asv running to tox
Browse files Browse the repository at this point in the history
  • Loading branch information
luizirber committed Dec 9, 2020
1 parent 1b32cb5 commit 8f1388b
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 21 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/asv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: make latest branch available
run: |
git checkout latest
git checkout -
- name: Set up Python 3.7
uses: actions/setup-python@v1
Expand All @@ -29,9 +36,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install asv virtualenv==16.7.9
pip install tox
- name: Runs benchmarks against latest
run: |
asv machine --yes
asv continuous origin/latest $(git rev-parse HEAD)
run: tox -e asv
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ coverage: all
tox -e coverage

benchmark:
asv continuous latest `git rev-parse HEAD`
tox -e asv
cargo bench

check:
Expand Down
36 changes: 24 additions & 12 deletions doc/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Development environment


You can get the latest development branch with:
```
git clone https://github.com/dib-lab/sourmash.git
Expand All @@ -13,24 +12,29 @@ extension code). We suggest using `rustup` to install the Rust environment:

curl https://sh.rustup.rs -sSf | sh

To install all of the necessary Python dependencies, do:
We use [`tox`](https://tox.readthedocs.io) for managing dependencies and
running tests and checks during development.
To install it, do:
```
pip install -r requirements.txt
pip install tox
```
Briefly, we use `py.test` and `cargo test` for testing, and `coverage` for code
coverage analysis.
and use `tox -l` to list available tasks.

We suggest working on sourmash in a virtualenv; e.g. from within the
sourmash clone directory, you can do:
```
python -m virtualenv dev
. dev/bin/activate
pip install -e .
tox -e dev
. .tox/dev/bin/activate
```

You can run tests by invoking `make test` in the sourmash directory;
`python -m pytest` will run the Python tests, and `cargo test` will
run the Rust tests.
`tox -e py39` will run the Python tests with Python 3.9,
and `cargo test` will run the Rust tests.

You can also explicitly install all the dependencies for sourmash by running
```
pip install -r requirements.txt
```

### If you're having trouble installing or using the development environment

Expand All @@ -40,14 +44,22 @@ If you are getting an error that contains `ImportError: cannot import name 'to_b
make clean
```

## Adding new changes

We use [`pre-commit`](https://pre-commit.com/) to run automatic checks and fixes
when developing sourmash. You can run it with
```
tox -e fix_lint
```
which prints a "hint" at the end of the run with instructions to set it up to
run automatically every time you run `git commit`.

## Automated tests and code coverage calculation

We use [Travis][0] and [GitHub Actions][2] for continuous integration.
We use [GitHub Actions][2] for continuous integration.

Code coverage can be viewed interactively at [codecov.io][1].

[0]: https://travis-ci.com/dib-lab/sourmash
[1]: https://codecov.io/gh/dib-lab/sourmash/
[2]: https://github.com/dib-lab/sourmash/actions

Expand Down
15 changes: 12 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ envlist =
package_description
py38,
py37,
# fix_lint,
fix_lint,
minversion = 3.12
isolated_build = true
skip_missing_interpreters = true
Expand Down Expand Up @@ -48,6 +48,16 @@ deps =
pip >= 19.3.1
psutil <= 5.6.7

[testenv:asv]
description = run asv for benchmarking (compare current commit with latest)
deps =
asv==0.4.2
virtualenv==16.7.9
changedir = {toxinidir}
commands =
asv machine --yes
asv continuous latest HEAD

[testenv:docs]
description = invoke sphinx-build to build the HTML docs
basepython = python3.8
Expand Down Expand Up @@ -144,7 +154,7 @@ source = src/sourmash/
python =
3.7: py37, docs, package_description, coverage, codecov
3.8: py38, coverage, codecov
3.9: py39, coverage, codecov
3.9: py39, coverage, codecov, fix_lint
[flake8]
max-complexity = 22
Expand All @@ -158,7 +168,6 @@ max-line-length = 99
description = dev environment with all deps at {envdir}
extras =
test
10x
storage
doc
deps = {[testenv]deps}
Expand Down

0 comments on commit 8f1388b

Please sign in to comment.