diff --git a/project.clj b/project.clj index 1fd447a21aef794ec8a0c2cb0df08eae96f8a339..4c2739441439f45f962aa7efd380a532700832c6 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject python/lein-template "0.20.1" +(defproject python/lein-template "0.20.2" :description "lein template for a python project" :repositories [["snapshots" {:url "http://devserv.game.yy.com/nexus/content/repositories/snapshots" diff --git a/src/leiningen/new/python.clj b/src/leiningen/new/python.clj index 7a8fdb73632f21e7b2474189491174c375b057fb..5bcc6428f8705206b4cf57cb0c0274b6b0226662 100644 --- a/src/leiningen/new/python.clj +++ b/src/leiningen/new/python.clj @@ -57,12 +57,12 @@ "git-hooks/pre-commit" ".gitignore"] plain-files ["utils/choose_default_python.py" - "utils/virtualenv-15.0.2/virtualenv.py" - "utils/virtualenv-15.0.2/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl" - "utils/virtualenv-15.0.2/virtualenv_support/setuptools-21.2.1-py2.py3-none-any.whl" - "utils/virtualenv-15.0.2/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl" - "utils/virtualenv-15.0.2/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl" - "utils/virtualenv-15.0.2/virtualenv_support/__init__.py" + "utils/virtualenv-15.1.0/virtualenv.py" + "utils/virtualenv-15.1.0/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl" + "utils/virtualenv-15.1.0/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl" + "utils/virtualenv-15.1.0/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl" + "utils/virtualenv-15.1.0/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl" + "utils/virtualenv-15.1.0/virtualenv_support/__init__.py" ] empty-files ["{{name}}/__init__.py"] package-files ["logger.conf" diff --git a/src/leiningen/new/python/Makefile b/src/leiningen/new/python/Makefile index 1f51c522fe8e856389bcae53256714267f3fa3bd..bc2cbe3e6537c2ef0a67370ccc2bb6e974851cbc 100644 --- a/src/leiningen/new/python/Makefile +++ b/src/leiningen/new/python/Makefile @@ -8,7 +8,7 @@ PYTHON := env PYTHONPATH=$(PYTHONPATH) $(VENV)/bin/python PIP := $(VENV)/bin/pip DEFAULT_PYTHON := $(shell ./utils/choose_default_python.py) -VIRTUALENV := ./utils/virtualenv-15.0.2/virtualenv.py +VIRTUALENV := ./utils/virtualenv-15.1.0/virtualenv.py REQUIREMENTS := -r requirements.txt DEV_REQUIREMENTS := -r requirements-dev.txt diff --git a/src/leiningen/new/python/config.py b/src/leiningen/new/python/config.py index 7ddd820351da509db73b7b74bb1ece8b93d05982..5304f2b46c8868147ebf91eddaa654345da570ec 100644 --- a/src/leiningen/new/python/config.py +++ b/src/leiningen/new/python/config.py @@ -19,6 +19,7 @@ logger = logging.getLogger(__name__) TESTING = os.getenv("PYTEST") == "1" +DEBUGGING = os.getenv("DEBUG") == "1" # set root logger level to ERROR when running unit test. if TESTING: diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl b/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl deleted file mode 100644 index cc49227a0c7e13757f4863a9b7ace1eb56c3ce61..0000000000000000000000000000000000000000 Binary files a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/pip-8.1.2-py2.py3-none-any.whl and /dev/null differ diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/AUTHORS.txt b/src/leiningen/new/python/utils/virtualenv-15.1.0/AUTHORS.txt similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/AUTHORS.txt rename to src/leiningen/new/python/utils/virtualenv-15.1.0/AUTHORS.txt diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/LICENSE.txt b/src/leiningen/new/python/utils/virtualenv-15.1.0/LICENSE.txt similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/LICENSE.txt rename to src/leiningen/new/python/utils/virtualenv-15.1.0/LICENSE.txt diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/README.rst b/src/leiningen/new/python/utils/virtualenv-15.1.0/README.rst similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/README.rst rename to src/leiningen/new/python/utils/virtualenv-15.1.0/README.rst diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv.py b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv.py similarity index 99% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv.py rename to src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv.py index fb9337f3478f61c22bab1575b00957ca5e45222c..42cd1f4b01f297714e53c9b0a766dc1915151be7 100755 --- a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv.py +++ b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv.py @@ -36,7 +36,7 @@ try: except ImportError: import configparser as ConfigParser -__version__ = "15.0.2" +__version__ = "15.1.0" virtualenv_version = __version__ # legacy if sys.version_info < (2, 6): @@ -155,6 +155,8 @@ elif majver == 3: '_collections_abc', '_bootlocale', ]) + if minver >= 6: + REQUIRED_MODULES.extend(['enum']) if is_pypy: # these are needed to correctly display the exceptions that may happen @@ -889,7 +891,6 @@ def install_wheel(project_names, py_executable, search_dirs=None, "PIP_FIND_LINKS": findlinks, "PIP_USE_WHEEL": "1", "PIP_ONLY_BINARY": ":all:", - "PIP_PRE": "1", "PIP_USER": "0", } @@ -1067,14 +1068,14 @@ def copy_required_modules(dst_prefix, symlink): def copy_tcltk(src, dest, symlink): """ copy tcl/tk libraries on Windows (issue #93) """ - if majver == 2: - libver = '8.5' - else: - libver = '8.6' - for name in ['tcl', 'tk']: - srcdir = src + '/tcl/' + name + libver - dstdir = dest + '/tcl/' + name + libver - copyfileordir(srcdir, dstdir, symlink) + for libversion in '8.5', '8.6': + for libname in 'tcl', 'tk': + srcdir = join(src, 'tcl', libname + libversion) + destdir = join(dest, 'tcl', libname + libversion) + # Only copy the dirs from the above combinations that exist + if os.path.exists(srcdir) and not os.path.exists(destdir): + copyfileordir(srcdir, destdir, symlink) + def subst_path(prefix_path, prefix, home_dir): prefix_path = os.path.normpath(prefix_path) @@ -1370,12 +1371,6 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy else: copyfile(py_executable, full_pth, symlink) - if is_win and ' ' in py_executable: - # There's a bug with subprocess on Windows when using a first - # argument that has a space in it. Instead we have to quote - # the value: - py_executable = '"%s"' % py_executable - # NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks cmd = [py_executable, '-c', 'import sys;out=sys.stdout;' 'getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))'] logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) @@ -1553,6 +1548,7 @@ def resolve_interpreter(exe): """ # If the "executable" is a version number, get the installed executable for # that version + orig_exe = exe python_versions = get_installed_pythons() if exe in python_versions: exe = python_versions[exe] @@ -1564,16 +1560,16 @@ def resolve_interpreter(exe): exe = join(path, exe) break if not os.path.exists(exe): - logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) + logger.fatal('The path %s (from --python=%s) does not exist' % (exe, orig_exe)) raise SystemExit(3) if not is_executable(exe): - logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) + logger.fatal('The path %s (from --python=%s) is not an executable file' % (exe, orig_exe)) raise SystemExit(3) return exe def is_executable(exe): """Checks a file is executable""" - return os.access(exe, os.X_OK) + return os.path.isfile(exe) and os.access(exe, os.X_OK) ############################################################ ## Relocating the environment: diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/__init__.py b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/__init__.py similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/__init__.py rename to src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/__init__.py diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl rename to src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl diff --git a/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..4b8ecc69db7e37fc6dd7b6dd8f690508f42866a1 Binary files /dev/null and b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl differ diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/setuptools-21.2.1-py2.py3-none-any.whl b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl similarity index 51% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/setuptools-21.2.1-py2.py3-none-any.whl rename to src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl index fe36464f79ba87960c33f3bdff817deb9e4e5f7c..502e3cb418c154872ad6e677ef8b63557b38ec35 100644 Binary files a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/setuptools-21.2.1-py2.py3-none-any.whl and b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl differ diff --git a/src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl b/src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl similarity index 100% rename from src/leiningen/new/python/utils/virtualenv-15.0.2/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl rename to src/leiningen/new/python/utils/virtualenv-15.1.0/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl