Skip to content

Commit 94cad5e

Browse files
committed
Merge remote-tracking branch 'upstream/upstream' into add_stetmann
2 parents 87ee21e + 71d0903 commit 94cad5e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3999
-2527
lines changed

.circleci/config.yml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
11
version: 2.0
22

3-
my-steps: &steps
3+
build_and_test: &build_and_test_steps
44
- checkout
55
- run: sudo pip install -r requirements.txt
6-
- run: sudo pip install flake8 pytest
6+
- run: pip install --user .
7+
- run: sudo pip install pytest
78
- run: python --version ; pip --version ; pwd ; ls -l
8-
# stop the build if there are Python syntax errors or undefined names
9-
- run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
10-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
11-
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
12-
#- run: pytest # test_s2gs test_replays
13-
- run: python -m unittest discover test_s2gs
14-
- run: python -m unittest discover test_replays
9+
- run: pytest
10+
1511

1612
jobs:
13+
StyleCheck:
14+
docker:
15+
- image: circleci/python:3.7
16+
steps:
17+
- checkout
18+
- run: sudo pip install flake8 black
19+
- run: python --version ; pip --version ; pwd ; ls -l
20+
# stop the build if there are Python syntax errors or undefined names
21+
- run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
22+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
23+
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
24+
- run: black . --check
25+
26+
1727
Python2:
1828
docker:
1929
- image: circleci/python:2.7.15
20-
steps: *steps
30+
steps: *build_and_test_steps
2131

2232
Python3:
2333
docker:
2434
- image: circleci/python:3.7
25-
steps: *steps
35+
steps: *build_and_test_steps
36+
2637

2738
workflows:
2839
version: 2
2940
build:
3041
jobs:
42+
- StyleCheck
3143
- Python2
3244
- Python3

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
============
33

4+
1.3.1 - November 29, 2018
5+
-------------------------
6+
* Parse backup if data is missing #69
7+
48
1.3.0 - November 16, 2018
59
-------------------------
610
* Added support for protocol 70154 (StarCraft 4.7.0)

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,18 @@ Please submit patches by pull request where possible. Patches should add a test
1818

1919
If you are having trouble running/add/fixing tests for your patch let me know and I'll see if I can help.
2020

21+
22+
Coding Style
23+
==============
24+
25+
We'd like our code to follow PEP8 coding style in this project.
26+
We use [python/black](https://github.com/python/black) in order to make our lives easier.
27+
We propose you do the same within this project, otherwise you might be asked to
28+
reformat your pull requests.
29+
30+
It's really simple just:
31+
32+
pip install black
33+
black .
34+
35+
And [there are plugins for many editors](https://black.readthedocs.io/en/stable/editor_integration.html).

README.rst

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,21 +259,36 @@ Please review the `CONTRIBUTING.md`_ file and get in touch with us before doing
259259
Testing
260260
-------------------
261261

262-
We use the built in ``unittest`` module for testing. If you are still on Python 2.6 you will need to install ``unittest2`` because our test suite requires newer features than are included in the main distribution.
262+
We use ``pytest`` for testing. If you don't have it just ``pip install pytest``.
263263

264-
To run the tests just use::
264+
To run the tests, just do::
265265

266-
python test_replays/test_all.py
267-
python test_s2gs/test_all.py
266+
pytest
268267

269-
When repeatedly running tests it can be very helpful to make sure you've set a local cache directory to prevent long fetch times from battle.net::
270268

271-
SC2READER_CACHE_DIR=local_cache PYTHONPATH=. python -m unittest test_replays.test_all
269+
When repeatedly running tests it can be very helpful to make sure you've set a local cache directory to prevent long fetch times from battle.net.
270+
So make some local cache folder::
271+
272+
mkdir cache
273+
274+
And then run the tests like this::
275+
276+
SC2READER_CACHE_DIR=./cache pytest
272277

273278
To run just one test:
274279

275-
SC2READER_CACHE_DIR=local_cache PYTHONPATH=. python -m unittest test_replays.test_all.TestReplays.test_38749
280+
SC2READER_CACHE_DIR=./cache pytest test_replays/test_replays.py::TestReplays::test_38749
281+
282+
If you'd like to see which are the 10 slowest tests (to find performance issues maybe)::
283+
284+
pytest --durations=10
285+
286+
If you want ``pytest`` to stop after the first failing test::
287+
288+
pytest -x
289+
276290

291+
Have a look at the very fine ``pytest`` docs for more information.
277292

278293
Good luck, have fun!
279294

0 commit comments

Comments
 (0)