Skip to content

Commit 3614968

Browse files
xadupreshauheen
authored andcommitted
enable Python 2.7 on travis, fix two AttributeError issues (#10)
1 parent 914d7a0 commit 3614968

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ install:
1919
- "%PYTHON%\\python -m pip install --upgrade pip"
2020
- "%PYTHON%\\Scripts\\pip install -r requirements.txt"
2121
- "%PYTHON%\\Scripts\\pip install git+https://github.com/apple/coremltools"
22-
- "%PYTHON%\\Scripts\\pip install https://github.com/xadupre/xgboost/releases/download/0.7/xgboost-0.7-cp36-cp36m-win_amd64.whl"
22+
- "if %PYTHON%==C:\\Python36-x64 %PYTHON%\\Scripts\\pip install https://github.com/xadupre/xgboost/releases/download/0.7/xgboost-0.7-cp36-cp36m-win_amd64.whl"
2323
- "%PYTHON%\\Scripts\\pip install -r requirements-dev.txt"
2424
- set PYTHONPATH=%~dp0
2525

@@ -34,7 +34,6 @@ after_test:
3434
- if not exist dist\htmlcov mkdir dist\htmlcov
3535
- xcopy htmlcov dist\htmlcov
3636
- copy *.xml dist\htmlcov
37-
- if %APPVEYOR_ACCOUNT_NAME%==xadupre %PYTHON%\Scripts\codecov -f coverage.xml -t 2c916354-0f91-46b4-a577-f80b0031c941
3837

3938
artifacts:
4039
- path: dist

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
dist: trusty
22
language: python
33
python:
4+
- "2.7"
45
- "3.5"
56
- "3.6"
67
install:

onnxmltools/convert/common/ConvertContext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ def add_output(self, output):
5959
self._outputs.append(output)
6060

6161
def clear_outputs(self):
62-
self._outputs.clear()
62+
del self._outputs[:]

tests/utils/test_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def test_save_text(self):
3939
json_file = os.path.join(this, "models", "coreml_OneHotEncoder_BikeSharing.json")
4040
json_file_new = os.path.join(this, "models", "coreml_OneHotEncoder_BikeSharing_new.json")
4141
save_text(onnx_model, json_file_new)
42-
filecmp.clear_cache()
42+
try:
43+
filecmp.clear_cache()
44+
except AttributeError:
45+
# Only available in Python 3
46+
pass
4347
content1 = self._parseEOL(json_file)
4448
content2 = self._parseEOL(json_file_new)
4549
self.assertTrue(content1 == content2,

0 commit comments

Comments
 (0)