Explorar o código

Use the actively maintained pathlib2 backport

Closes gh-116
Thomas Kluyver %!s(int64=8) %!d(string=hai) anos
pai
achega
6e3ca785fd
Modificáronse 7 ficheiros con 23 adicións e 8 borrados
  1. 2 2
      .travis.yml
  2. 1 1
      flit.ini
  3. 4 1
      nsist/__init__.py
  4. 4 1
      nsist/pypi.py
  5. 4 1
      nsist/tests/test_commands.py
  6. 4 1
      nsist/tests/test_pypi.py
  7. 4 1
      nsist/util.py

+ 2 - 2
.travis.yml

@@ -10,8 +10,8 @@ script: nosetests
 # Ensure dependencies are installed
 install:
   - pip install requests requests_download jinja2 yarg win_cli_launchers testpath
-  - if [[ ${TRAVIS_PYTHON_VERSION} == '2.7' ]]; then pip install configparser pathlib; fi
-  - if [[ ${TRAVIS_PYTHON_VERSION} == '3.3' ]]; then pip install pathlib; fi
+  - if [[ ${TRAVIS_PYTHON_VERSION} == '2.7' ]]; then pip install configparser pathlib2; fi
+  - if [[ ${TRAVIS_PYTHON_VERSION} == '3.3' ]]; then pip install pathlib2; fi
 
 # Enable new Travis stack, should speed up builds
 sudo: false

+ 1 - 1
flit.ini

@@ -11,7 +11,7 @@ requires = requests
     yarg
     win_cli_launchers
     configparser; python_version == '2.7'
-    pathlib; python_version == '2.7' or python_version == '3.3'
+    pathlib2; python_version == '2.7' or python_version == '3.3'
 dev-requires = testpath
 classifiers = License :: OSI Approved :: MIT License
     Intended Audience :: Developers

+ 4 - 1
nsist/__init__.py

@@ -6,7 +6,10 @@ import logging
 import ntpath
 import operator
 import os
-from pathlib import Path
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path  # Backport
 import re
 import shutil
 from subprocess import call

+ 4 - 1
nsist/pypi.py

@@ -2,7 +2,10 @@ from distutils.version import LooseVersion
 import errno
 import hashlib
 import logging
-from pathlib import Path
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path  # Backport
 import re
 import shutil
 from tempfile import mkdtemp

+ 4 - 1
nsist/tests/test_commands.py

@@ -1,6 +1,9 @@
 import io
 from nose.tools import *
-from pathlib import Path
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path  # Backport
 from testpath.tempdir import TemporaryDirectory
 from testpath import assert_isfile
 

+ 4 - 1
nsist/tests/test_pypi.py

@@ -1,6 +1,9 @@
 from nose.tools import *
 from os.path import join as pjoin
-from pathlib import Path
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path  # Backport
 from testpath import assert_isfile, assert_isdir
 from testpath.tempdir import TemporaryDirectory
 

+ 4 - 1
nsist/util.py

@@ -1,7 +1,10 @@
 import os
 import errno
 import logging
-from pathlib import Path
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path  # Backport
 import requests
 import sys