Skip to content

Commit 615ccb3

Browse files
committed
Add yapf, flake8, mypy
1 parent d9686c8 commit 615ccb3

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ install:
1111
- pip install -r requirements-dev.txt
1212

1313
script:
14+
- flake8 pystac
15+
- flake8 tests
16+
- yapf -dpr pystac
17+
- yapf -dpr tests
18+
- mypy -m pystac
1419
- python -m unittest discover tests/
1520

1621
deploy:

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,52 @@ To ensure development libraries are installed, install everything in `requiremen
4949
> pip install -r requirements-dev.txt
5050
```
5151

52+
### Unit Tests
53+
5254
Unit tests are in the `tests` folder. To run unit tests, use `unittest`:
5355

5456
```
5557
> python -m unittest discover tests
5658
```
5759

60+
### Code quality checks
61+
62+
PySTAC uses [flake8](), [yapf](), and [mypy]() for code formatting and type checking.
63+
64+
To run the style checks:
65+
66+
```
67+
> flake8 pystac
68+
> flake8 tests
69+
```
70+
71+
To format code:
72+
73+
```
74+
> yapf -ipr pystac
75+
> yapf -ipr tests
76+
```
77+
78+
To run the mypy static checker:
79+
80+
```
81+
> mypy -m pystac
82+
```
83+
84+
### Documentation
85+
86+
To build and develop the documentation locally, make sure sphinx is available (which is installed with `requirementts-dev.txt`), and use the Makefile in the docs folder:
87+
88+
```
89+
> cd docs
90+
> make html
91+
> make livehtml
92+
```
93+
94+
Use 'make' without arguments to see a list of available commands.
95+
96+
97+
5898
## Running the tutorials
5999

60100
There are tutorials written as jupyter notebooks in the `tutorials` folder. To run them, run a jupyter notebook with the `tutorials` directory as the notebook directory:

requirements-dev.txt

+4
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ pylint==1.9.1
33
Sphinx==1.8.0
44
sphinx-autobuild==0.7.1
55
sphinxcontrib-fulltoc==1.2.0
6+
sphinxcontrib-napoleon==0.7
7+
mypy==0.740
8+
flake8==3.7.*
9+
yapf==0.28.*

0 commit comments

Comments
 (0)