From eae32a99cd07ace01f6e10ae30c903e250d92419 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 3 May 2017 16:44:21 +0200 Subject: [PATCH 1/4] add appveyor --- appveyor.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..60059e2c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,29 @@ +build: false +matrix: + fast_finish: true # immediately finish build once one of the jobs fails. + +environment: + matrix: + - PYTHON: "C:\\Python36-x64" + PYTHON_VERSION: "3.6.x" + PYTHON_ARCH: "64" + + - PYTHON: "C:\\Python33" + PYTHON_VERSION: "3.3.x" + PYTHON_ARCH: "32" + + - PYTHON: "C:\\Python27-x64" + PYTHON_VERSION: "2.7.x" + PYTHON_ARCH: "64" + +init: + - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%" + +install: + - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + - "%CMD_IN_ENV% pip install --upgrade setuptools pip" + - "%CMD_IN_ENV% pip install .[test]" + - "%CMD_IN_ENV% mkdir results" + - "%CMD_IN_ENV% cd results" +test_script: + - "%CMD_IN_ENV% pytest --pyargs -v traitlets" From 1c42d6fdbc7eb42a6a9992f1a26c27be7ad2e7c5 Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 3 May 2017 17:04:56 +0200 Subject: [PATCH 2/4] only encode filenames with filesystemencoding on py2 + not windows Windows should get unicode even on Python 2, and fsencoding will be wrong, anyway --- traitlets/config/loader.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/traitlets/config/loader.py b/traitlets/config/loader.py index 68c0b68f..27345241 100644 --- a/traitlets/config/loader.py +++ b/traitlets/config/loader.py @@ -16,7 +16,7 @@ from ipython_genutils.path import filefind from ipython_genutils import py3compat from ipython_genutils.encoding import DEFAULT_ENCODING -from six import text_type, string_types +from six import text_type, string_types, PY3 from traitlets.traitlets import ( HasTraits, Container, List, Dict, Any, ) @@ -492,8 +492,12 @@ def get_config(): get_config=get_config, __file__=self.full_filename, ) - fs_encoding = sys.getfilesystemencoding() or 'ascii' - conf_filename = self.full_filename.encode(fs_encoding) + # encode filename to bytes only on py2 on non-Windows: + if PY3 or sys.platform.startswith('win'): + conf_filename = self.full_filename + else: + fs_encoding = sys.getfilesystemencoding() or 'ascii' + conf_filename = self.full_filename.encode(fs_encoding) py3compat.execfile(conf_filename, namespace) From 629fb40361989aa8a4acdcc0d2143b3b5e341e3d Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 3 May 2017 17:18:22 +0200 Subject: [PATCH 3/4] disable fast finish --- appveyor.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 60059e2c..2599b1a8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,4 @@ build: false -matrix: - fast_finish: true # immediately finish build once one of the jobs fails. environment: matrix: From aed9549914cb8869f09348599f8cdafe1b671f6b Mon Sep 17 00:00:00 2001 From: Min RK Date: Wed, 3 May 2017 17:18:53 +0200 Subject: [PATCH 4/4] test on py34 on appveyor --- appveyor.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 2599b1a8..8d996bfc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,8 +6,8 @@ environment: PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "64" - - PYTHON: "C:\\Python33" - PYTHON_VERSION: "3.3.x" + - PYTHON: "C:\\Python34-x64" + PYTHON_VERSION: "3.4.x" PYTHON_ARCH: "32" - PYTHON: "C:\\Python27-x64"