Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Test both Python and legacy Python on Circle CI 2.0
  • Loading branch information
cclauss committed Apr 13, 2018
commit f2ce3958484f1de7021e4ce983d99c73749e245f
32 changes: 32 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: 2.0

my-steps: &steps
- checkout
- run: sudo pip install -r requirements.txt
- run: sudo pip install flake8 pytest
- run: python --version ; pip --version ; pwd ; ls
# stop the build if there are Python syntax errors or undefined names
- run: flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
- run: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
#- run: pytest # test_s2gs test_replays
- run: python -m unittest discover test_s2gs
- run: python -m unittest discover test_replays

jobs:
Python_2.7:
docker:
- image: circleci/python:2.7
steps: *steps

Python_3.6:
docker:
- image: circleci/python:3.6
steps: *steps

workflows:
version: 2
build:
jobs:
- Python_2.7
- Python_3.6
27 changes: 0 additions & 27 deletions circle.yml

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
hacking
mpyq
Pillow
6 changes: 3 additions & 3 deletions sc2reader/scripts/sc2parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def main():
if not args.one_each or replay.is_ladder:
replay = sc2reader.load_replay(path, debug=True)

human.pids = set([human.pid for human in replay.humans])
human_pids = set([human.pid for human in replay.humans])
event_pids = set([event.player.pid for event in replay.events if getattr(event, 'player', None)])
player_pids = set([player.pid for player in replay.players if player.is_human])
ability_pids = set([event.player.pid for event in replay.events if 'CommandEvent' in event.name])
if human.pids != event_pids:
print('Event Pid problem! pids={pids} but event pids={event_pids}'.format(pids=human.pids, event_pids=event_pids))
if human_pids != event_pids:
print('Event Pid problem! pids={pids} but event pids={event_pids}'.format(pids=human_pids, event_pids=event_pids))
print(' with {path}: {build} - {real_type} on {map_name} - Played {start_time}'.format(path=path, **replay.__dict__))
elif player_pids != ability_pids:
print('Ability Pid problem! pids={pids} but event pids={event_pids}'.format(pids=player_pids, event_pids=ability_pids))
Expand Down
4 changes: 2 additions & 2 deletions test_replays/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,13 @@ def test_33_shift_click_calldown_mule(self):
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue48.SC2Replay")
def efilter(e):
return hasattr(e, "ability") and e.ability_name == "CalldownMULE"
self.assertEqual(len(filter(efilter, replay.events)), 29)
self.assertEqual(len(list(filter(efilter, replay.events))), 29)

def test_33_shift_click_spawn_larva(self):
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue49.SC2Replay")
def efilter(e):
return hasattr(e, "ability") and e.ability_name == "SpawnLarva"
self.assertEqual(len(filter(efilter, replay.events)), 23)
self.assertEqual(len(list(filter(efilter, replay.events))), 23)

def test_34(self):
replay = sc2reader.load_replay("test_replays/3.4.0/issueYY.SC2Replay")
Expand Down