Skip to content

Commit 0131548

Browse files
committed
tox: add configuration
1 parent bc2ca11 commit 0131548

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ To get started developing `boostedblob`:
1212
## Running tests
1313

1414
Run `./test.sh` to run tests.
15+
If you like tox, `tox` should also work.
1516

1617
This will run tests with some hardcoded cloud locations, which you may not have access to. Instead,
1718
use `BBB_TEST_LOCATIONS` to tell tests what locations to use. E.g.,

test.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
set -ex
22

3+
# TODO: maybe get rid of this script in favour of tox
4+
35
black --diff --check --quiet .
46
isort --diff --check --quiet .
57
flake8

tox.ini

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
[tox]
2+
skipsdist = True
3+
envlist = py37, py39, py310, lint, mypy
4+
5+
[testenv]
6+
deps = pytest
7+
setenv = BBB_TEST_LOCATIONS = {env:BBB_TEST_LOCATIONS:az://shantanutest/container}
8+
allowlist_externals = bash
9+
commands_pre =
10+
bash -c 'poetry export --dev --without-hashes -f requirements.txt | pip install --quiet --no-deps -r /dev/stdin'
11+
commands =
12+
pytest --cov=boostedblob {posargs}
13+
coverage html
14+
15+
[testenv:lint]
16+
deps =
17+
flake8
18+
flake8-bugbear
19+
black
20+
isort>=5
21+
commands_pre =
22+
bash -c 'poetry export --dev --without-hashes -f requirements.txt | pip install --quiet --no-deps -r /dev/stdin'
23+
commands =
24+
flake8
25+
black --diff --check --quiet .
26+
isort --diff --check --quiet .
27+
28+
[testenv:mypy]
29+
deps = mypy
30+
commands =
31+
mypy boostedblob
32+
mypy tests --disable-error-code var-annotated
33+
134
[flake8]
235
max_line_length = 100
336
ignore = E203,E501,W503

0 commit comments

Comments
 (0)