summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-09-10 08:02:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-09-10 08:02:39 -0400
commit409ffb2aaa842867950722602126e4f335fc9691 (patch)
tree3a5f30293e33df92090735f21ccb1ef8cf64987c
parent9864cca9b5d0a4a7fd2d1d2517f1d09df33ab4cf (diff)
downloadpython-coveragepy-git-409ffb2aaa842867950722602126e4f335fc9691.tar.gz
This is like building a ship in a bottle
-rw-r--r--appveyor.yml6
-rw-r--r--ci/show_py.py31
2 files changed, 29 insertions, 8 deletions
diff --git a/appveyor.yml b/appveyor.yml
index 2add9171..f7a058ad 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -114,6 +114,10 @@ install:
# Install requirements.
- "%CMD_IN_ENV% pip install -r requirements/tox.pip -r requirements/wheel.pip"
+ # Make a python3.4.bat file in the current directory so that tox will find it
+ # and python3.4 will mean what we want it to.
+ - "python -c \"import os; toxenv = os.environ['TOXENV']; bat = open('python{0}.{1}.bat'.format(*toxenv[2:]), 'w'); bat.write(r'@C:\{0}\python %*'.format(os.environ['PYTHON']))\""
+
build_script:
# If not a metacov job, then build wheels and .exe installers.
- if NOT "%COVERAGE_COVERAGE%" == "yes" %CMD_IN_ENV% %PYTHON%\python setup.py bdist_wheel bdist_wininst
@@ -122,7 +126,7 @@ build_script:
- ps: if ( Test-Path 'dist' -PathType Container ) { Get-ChildItem dist\*.* | % { Push-AppveyorArtifact $_.FullName -FileName ('dist\' + $_.Name) } }
test_script:
- - "%CMD_IN_ENV% %PYTHON%\\Scripts\\tox --recreate"
+ - "%CMD_IN_ENV% %PYTHON%\\Scripts\\tox"
after_test:
- if "%COVERAGE_COVERAGE%" == "yes" 7z a metacov-win-%TOXENV%.zip %APPVEYOR_BUILD_FOLDER%\.metacov*
diff --git a/ci/show_py.py b/ci/show_py.py
index 4b7466a8..20259dba 100644
--- a/ci/show_py.py
+++ b/ci/show_py.py
@@ -4,25 +4,37 @@ import sys
def main():
+ show_version()
+ show_sizes()
+ show_encoding()
+ show_path()
+
+
+def show_version():
print("Python version:\n {0}".format(sys.version.replace("\n", "\n ")))
- print("Python prefix: {0}".format(sys.prefix))
+ print("Python executable: {0!r}".format(sys.executable))
+ print("Python prefix: {0!r}".format(sys.prefix))
if hasattr(sys, "real_prefix"):
- print("This is a virtualenv. The real prefix is: {0}".format(sys.real_prefix))
+ print("This is a virtualenv. The real prefix is: {0!r}".format(sys.real_prefix))
else:
print("This is not a virtualenv.")
+
+def show_sizes():
if sys.maxsize == 2**63-1:
indicates = "indicating 64-bit"
elif sys.maxsize == 2**31-1:
indicates = "indicating 32-bit"
else:
indicates = "not sure what that means"
- print("sys.maxsize: {0}, {1}".format(sys.maxsize, indicates))
+ print("sys.maxsize: {0!r}, {1}".format(sys.maxsize, indicates))
if hasattr(sys, "maxint"):
- print("sys.maxint: {0}".format(sys.maxint))
+ print("sys.maxint: {0!r}".format(sys.maxint))
else:
print("sys.maxint doesn't exist")
+
+def show_encoding():
if sys.version_info < (3, 0):
if sys.maxunicode == 1114111:
indicates = "indicating a wide Unicode build"
@@ -30,10 +42,15 @@ def main():
indicates = "indicating a narrow Unicode build"
else:
indicates = "as all Python 3 have"
- print("sys.maxunicode: {0}, {1}".format(sys.maxunicode, indicates))
+ print("sys.maxunicode: {0!r}, {1}".format(sys.maxunicode, indicates))
+
+ print("sys.getdefaultencoding(): {0!r}".format(sys.getdefaultencoding()))
+ print("sys.getfilesystemencoding(): {0!r}".format(sys.getfilesystemencoding()))
+
- print("sys.getdefaultencoding(): {0}".format(sys.getdefaultencoding()))
- print("sys.getfilesystemencoding(): {0}".format(sys.getfilesystemencoding()))
+def show_path():
+ print("sys.path:")
+ print("\n".join(" {0!r}".format(p) for p in sys.path))
if __name__ == "__main__":