Skip to content

Commit f2ce395

Browse files
author
cclauss
committed
Test both Python and legacy Python on Circle CI 2.0
1 parent 155ae25 commit f2ce395

File tree

5 files changed

+38
-33
lines changed

5 files changed

+38
-33
lines changed

.circleci/config.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: 2.0
2+
3+
my-steps: &steps
4+
- checkout
5+
- run: sudo pip install -r requirements.txt
6+
- run: sudo pip install flake8 pytest
7+
- run: python --version ; pip --version ; pwd ; ls
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
15+
16+
jobs:
17+
Python_2.7:
18+
docker:
19+
- image: circleci/python:2.7
20+
steps: *steps
21+
22+
Python_3.6:
23+
docker:
24+
- image: circleci/python:3.6
25+
steps: *steps
26+
27+
workflows:
28+
version: 2
29+
build:
30+
jobs:
31+
- Python_2.7
32+
- Python_3.6

circle.yml

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

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
hacking
1+
mpyq
22
Pillow

sc2reader/scripts/sc2parse.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ def main():
4545
if not args.one_each or replay.is_ladder:
4646
replay = sc2reader.load_replay(path, debug=True)
4747

48-
human.pids = set([human.pid for human in replay.humans])
48+
human_pids = set([human.pid for human in replay.humans])
4949
event_pids = set([event.player.pid for event in replay.events if getattr(event, 'player', None)])
5050
player_pids = set([player.pid for player in replay.players if player.is_human])
5151
ability_pids = set([event.player.pid for event in replay.events if 'CommandEvent' in event.name])
52-
if human.pids != event_pids:
53-
print('Event Pid problem! pids={pids} but event pids={event_pids}'.format(pids=human.pids, event_pids=event_pids))
52+
if human_pids != event_pids:
53+
print('Event Pid problem! pids={pids} but event pids={event_pids}'.format(pids=human_pids, event_pids=event_pids))
5454
print(' with {path}: {build} - {real_type} on {map_name} - Played {start_time}'.format(path=path, **replay.__dict__))
5555
elif player_pids != ability_pids:
5656
print('Ability Pid problem! pids={pids} but event pids={event_pids}'.format(pids=player_pids, event_pids=ability_pids))

test_replays/test_all.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,13 +509,13 @@ def test_33_shift_click_calldown_mule(self):
509509
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue48.SC2Replay")
510510
def efilter(e):
511511
return hasattr(e, "ability") and e.ability_name == "CalldownMULE"
512-
self.assertEqual(len(filter(efilter, replay.events)), 29)
512+
self.assertEqual(len(list(filter(efilter, replay.events))), 29)
513513

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

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

0 commit comments

Comments
 (0)