Skip to content

Commit

Permalink
Use pytest-flake8 (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Jul 22, 2019
1 parent ae1e117 commit a9b593c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 55 deletions.
33 changes: 17 additions & 16 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
and one of the `docs/*-api.rst` files for new API


<details> <summary>
Howto run test cases and lint the code base </summary>
```bash
$ py.test -v -s tricolour
```
If the pep8 tests fail, the quickest way to correct
this is to run `autopep8` and then `flake8` and
`pycodestyle` to fix the remaining issues.
<details>
<summary> Howto run test cases and lint the code base </summary>

```bash
$ py.test --flake8 -v -s tricolour
```

If you encounter flake8 failures, a quick way to correct
this is to run `autopep8` and `flake8` again.

```bash
$ pip install -U autopep8 flake8 pycodestyle
$ pip install -U autopep8
$ autopep8 -r -i tricolour
$ flake8 tricolour
$ pycodestyle tricolour
```

</details>
Expand All @@ -25,11 +25,12 @@ $ pycodestyle tricolour
<details>
<summary> Howto build the documentation </summary>

To build the docs locally:
To build the docs locally:

```bash
$ pip install -r requirements.readthedocs.txt
$ cd docs
$ READTHEDOCS=True make html
```

```
pip install -r requirements.readthedocs.txt
cd docs
READTHEDOCS=True make html
```
</details>
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
language: python
python:
- 3.6
- 3.5

# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install: pip install -U tox-travis
Expand Down
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ History
0.1.3 (YYYY-MM-DD)
------------------

* Use pytest-flake8 when running test cases (:pr:`56`)
* Fix polarisation flagging for uncalibrated data (:pr:`55`)
* Add ability to flag on total power (:pr:`55`)
* Baseline statistics (:pr:`55`)
Expand Down
9 changes: 3 additions & 6 deletions docker/python36.docker
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@ FROM kernsuite/base:5

# Install base requirements
RUN docker-apt-install python3-pip
RUN pip3 install --upgrade pip setuptools flake8
RUN pip3 install --upgrade pip setuptools
ADD . /code
WORKDIR /code

# Install base + testing packages
RUN pip3 install .[testing]

# Run tests
RUN py.test -s -vvv .

# Flake the repository
RUN flake8 .
# Run tests and flake at the same time
RUN py.test --flake8 -s -vvv .
6 changes: 3 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.1.2
commit = True
tag = True
tag_name = {current_version}
tag_name = {new_version}


[bumpversion:file:setup.py]
Expand All @@ -25,4 +25,4 @@ test = pytest

[tool:pytest]
collect_ignore = ['setup.py']

norecursedirs = docs
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'zarr >= 2.3.1'
]

extras_require = {'testing': ['pytest', 'requests']}
extras_require = {'testing': ['pytest', 'pytest-flake8', 'requests']}

setup(
author="Simon Perkins",
Expand Down
28 changes: 0 additions & 28 deletions tox.ini

This file was deleted.

0 comments on commit a9b593c

Please sign in to comment.