diff --git a/.travis.yml b/.travis.yml index 83b04fc74..0c7c066eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ language: objective-c env: matrix: - - CONDA_PY=35 + - CONDA_PY=27 global: # The BINSTAR_TOKEN secure variable. This is defined canonically in conda-forge.yml. - secure: "nkZ1RWSP1PIRI6OqCwqeLrib7nXeBzX7PJg+P72RH1LQ56SZCdzqmvr3IoC2gxayZBzDnFsq7bU1ypy/gNtKDfWaXJvUQVKcKrbWF6dQxVXP/X5go+y9stSjI/WGXMbBr8ZwePR3lDmEPifEKdpgOaMWosqnK+ThtRNdxqKbnzRB6cOJSCcRGIMexauJg+IkPyQ5MFh59VHLdvfxfqNXa1Kdv2WkgfKX+apjLlCJoDP34zUcGFyIccbbq130AW0aYiJV3ZJIIVfcAgJqS7Ons0X3biA7/Fp6AWQKx91Ew/aoN3xb878CVr5ygKqjDdVkZClW2JEaSW9w+WG7RWomPJIPvmAuoKg50S4D07iBZf89Hjg+oybZ17ct+OA1UdW8EK8c/gaPFQsBuN1sRG2DNAJug+ViPPl7hnoAfRhRcPnUEuLcPJ6kyEcpYZgPE3MMRtjIiRRyNRzccinjxjPbojFTkiCHM9U9krFVGwIKNHp6623rttriu9YGU7yd6wRGbD09AUajT8r9iPn2OJ1+ibzCIbzJx6Nb7290+Fs4UbU29m1bAiabBTnN6EVim20tMtqCxA6HNbji30SBB/C+lQ/pf9D16Nxy+FCEdQXb193iqBxhjzEpJZHkFY/g8b1C6yJGi6dzbNDKT63HbGduQUZ99rKMmI8XaAf3ANRm/Vs=" diff --git a/appveyor.yml b/appveyor.yml index c5d03ebea..9134b18d8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,10 +20,10 @@ environment: matrix: - TARGET_ARCH: x86 - CONDA_PY: 35 + CONDA_PY: 27 - TARGET_ARCH: x64 - CONDA_PY: 35 + CONDA_PY: 27 # We always use a 64-bit machine, but can build x86 distributions diff --git a/ci_support/run_docker_build.sh b/ci_support/run_docker_build.sh index 6bef066f0..36ec4f890 100755 --- a/ci_support/run_docker_build.sh +++ b/ci_support/run_docker_build.sh @@ -43,7 +43,7 @@ source run_conda_forge_build_setup # Embarking on 1 case(s). set -x - export CONDA_PY=35 + export CONDA_PY=27 set +x conda build /recipe_root --quiet || exit 1 /feedstock_root/ci_support/upload_or_check_non_existence.py /recipe_root conda-forge --channel=main || exit 1 diff --git a/recipe/bld.bat b/recipe/bld.bat index 5e2ec3b6d..4081e6979 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -7,27 +7,31 @@ REM Compile python, extensions and external libraries if "%ARCH%"=="64" ( set PLATFORM=x64 set VC_PATH=x64 - set BUILD_PATH=amd64 + set PCB=%SRC_DIR%\PCbuild\amd64 + :: Next line is only for local builds + call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat" ) else ( set PLATFORM=Win32 set VC_PATH=x86 - set BUILD_PATH=win32 + set PCB=%SRC_DIR%\PCbuild + call "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat" ) cd PCbuild +dir call build.bat -e -p %PLATFORM% if errorlevel 1 exit 1 cd .. REM Populate the root package directory -for %%x in (python35.dll python.exe pythonw.exe) do ( - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% +for %%x in (python27.dll python.exe pythonw.exe) do ( + copy /Y %PCB%\%%x %PREFIX% if errorlevel 1 exit 1 ) -for %%x in (python.pdb python35.pdb pythonw.pdb) do ( - copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\%%x %PREFIX% +for %%x in (python.pdb python27.pdb pythonw.pdb) do ( + copy /Y %PCB%\%%x %PREFIX% if errorlevel 1 exit 1 ) @@ -37,13 +41,13 @@ if errorlevel 1 exit 1 REM Populate the DLLs directory mkdir %PREFIX%\DLLs -xcopy /s /y %SRC_DIR%\PCBuild\%BUILD_PATH%\*.pyd %PREFIX%\DLLs\ +xcopy /s /y %PCB%\*.pyd %PREFIX%\DLLs\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\sqlite3.dll %PREFIX%\DLLs\ +copy /Y %PCB%\sqlite3.dll %PREFIX%\DLLs\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\tcl86t.dll %PREFIX%\DLLs\ +copy /Y %PCB%\tcl85.dll %PREFIX%\DLLs\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\tk86t.dll %PREFIX%\DLLs\ +copy /Y %PCB%\tk85.dll %PREFIX%\DLLs\ if errorlevel 1 exit 1 copy /Y %SRC_DIR%\PC\py.ico %PREFIX%\DLLs\ @@ -54,35 +58,23 @@ if errorlevel 1 exit 1 REM Populate the Tools directory mkdir %PREFIX%\Tools -xcopy /s /y /i %SRC_DIR%\Tools\demo %PREFIX%\Tools\demo +xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\Scripts if errorlevel 1 exit 1 xcopy /s /y /i %SRC_DIR%\Tools\i18n %PREFIX%\Tools\i18n if errorlevel 1 exit 1 -xcopy /s /y /i %SRC_DIR%\Tools\parser %PREFIX%\Tools\parser -if errorlevel 1 exit 1 xcopy /s /y /i %SRC_DIR%\Tools\pynche %PREFIX%\Tools\pynche if errorlevel 1 exit 1 -xcopy /s /y /i %SRC_DIR%\Tools\scripts %PREFIX%\Tools\scripts -if errorlevel 1 exit 1 - -del %PREFIX%\Tools\demo\README -if errorlevel 1 exit 1 -del %PREFIX%\Tools\pynche\README -if errorlevel 1 exit 1 -del %PREFIX%\Tools\pynche\pynche +xcopy /s /y /i %SRC_DIR%\Tools\versioncheck %PREFIX%\Tools\versioncheck if errorlevel 1 exit 1 -del %PREFIX%\Tools\scripts\README -if errorlevel 1 exit 1 -del %PREFIX%\Tools\scripts\dutree.doc -if errorlevel 1 exit 1 -del %PREFIX%\Tools\scripts\idle3 +xcopy /s /y /i %SRC_DIR%\Tools\webchecker %PREFIX%\Tools\webchecker if errorlevel 1 exit 1 -move /y %PREFIX%\Tools\scripts\2to3 %PREFIX%\Tools\scripts\2to3.py +del %PREFIX%\Tools\Scripts\idle if errorlevel 1 exit 1 -move /y %PREFIX%\Tools\scripts\pydoc3 %PREFIX%\Tools\scripts\pydoc3.py +del %PREFIX%\Tools\Scripts\pydoc if errorlevel 1 exit 1 -move /y %PREFIX%\Tools\scripts\pyvenv %PREFIX%\Tools\scripts\pyvenv.py + +move /y %PREFIX%\Tools\Scripts\2to3 %PREFIX%\Tools\Scripts\2to3.py if errorlevel 1 exit 1 @@ -109,7 +101,7 @@ IF NOT exist %SCRIPTS% (mkdir %SCRIPTS%) if errorlevel 1 exit 1 for %%x in (idle pydoc) do ( - copy /Y %SRC_DIR%\Tools\scripts\%%x3 %SCRIPTS%\%%x + copy /Y %SRC_DIR%\Tools\scripts\%%x %SCRIPTS%\%%x if errorlevel 1 exit 1 ) @@ -119,22 +111,21 @@ if errorlevel 1 exit 1 REM Populate the libs directory mkdir %PREFIX%\libs -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python35.lib %PREFIX%\libs\ +copy /Y %PCB%\python27.lib %PREFIX%\libs\ if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\python3.lib %PREFIX%\libs\ -if errorlevel 1 exit 1 -copy /Y %SRC_DIR%\PCbuild\%BUILD_PATH%\_tkinter.lib %PREFIX%\libs\ +::copy /Y %PCB%\python.lib %PREFIX%\libs\ +::if errorlevel 1 exit 1 +copy /Y %PCB%\_tkinter.lib %PREFIX%\libs\ if errorlevel 1 exit 1 -REM Populate the Lib directory +::REM Populate the Lib directory del %PREFIX%\libs\libpython*.a xcopy /s /y %SRC_DIR%\Lib %PREFIX%\Lib\ if errorlevel 1 exit 1 REM bytecode compile the standard library - rd /s /q %STDLIB_DIR%\lib2to3\tests\ if errorlevel 1 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index 9f38221a5..dda7b5efa 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -9,13 +9,13 @@ if [ `uname` == Darwin ]; then ./configure \ --enable-ipv6 \ --enable-shared \ + --enable-unicode=ucs2 \ --prefix=$PREFIX \ - --with-ensurepip=no \ --with-tcltk-includes="-I$PREFIX/include" \ --with-tcltk-libs="-L$PREFIX/lib -ltcl8.5 -ltk8.5" fi if [ `uname` == Linux ]; then - ./configure --enable-shared --enable-ipv6 --with-ensurepip=no \ + ./configure --enable-shared --enable-ipv6 --enable-unicode=ucs4 \ --prefix=$PREFIX \ --with-tcltk-includes="-I$PREFIX/include" \ --with-tcltk-libs="-L$PREFIX/lib -ltcl8.5 -ltk8.5" \ @@ -25,5 +25,3 @@ fi make make install -ln -s $PREFIX/bin/python3.5 $PREFIX/bin/python -ln -s $PREFIX/bin/pydoc3.5 $PREFIX/bin/pydoc diff --git a/recipe/meta.yaml b/recipe/meta.yaml index a50f2fd94..33f1060cf 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,11 +1,11 @@ package: name: python - version: 3.5.2 + version: 2.7.12 source: - fn: Python-3.5.2.tgz - url: https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz - sha256: 1524b840e42cf3b909e8f8df67c1724012c7dc7f9d076d4feef2d3eff031e8a0 + fn: Python-2.7.12.tgz + url: https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz + sha256: 3cb522d17463dfa69a155ab18cffa399b358c966c0363d6c8b5b3bf1384da4b6 patches: - omit-local-site-packages.patch # [osx] - osx64-dist.patch # [osx and x86_64] @@ -13,31 +13,29 @@ source: - win-library_bin.patch # [win] build: - number: 2 + number: 0 # Windows has issues updating python if conda is using files itself. # Copy rather than link. no_link: - DLLs/_ctypes.pyd # [win] - bin/python3.5 # [unix] track_features: - - vc14 # [win] + - vc9 # [win] requirements: build: - bzip2 1.0.* # [unix] - openssl 1.0.* # [unix] - readline 6.2* # [unix] - - sqlite 3.13.* # [unix] + - sqlite 3.9.* # [unix] - tk 8.5.* # [unix] - - xz 5.2.* # [unix] - zlib 1.2.* # [unix] - ncurses 5.9* # [linux] run: - openssl 1.0.* # [unix] - readline 6.2* # [unix] - - sqlite 3.13.* # [unix] + - sqlite 3.9.* # [unix] - tk 8.5.* # [unix] - - xz 5.2.* # [unix] - zlib 1.2.* # [unix] - ncurses 5.9* # [linux] - vs2015_runtime # [win] @@ -45,10 +43,9 @@ requirements: test: commands: - python -V - - python3 -V # [unix] - - 2to3 -h - pydoc -h - - python3-config --help # [unix] + - python-config --help # [unix] + - idle -h about: home: http://www.python.org/ diff --git a/recipe/run_test.py b/recipe/run_test.py index 556ca22c6..deca33ded 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -1,23 +1,39 @@ +# make sure Grammar pickle files are present +import os +from os.path import dirname, isfile, join +for fn in ('Grammar2.7.12.final.0.pickle', + 'PatternGrammar2.7.12.final.0.pickle'): + assert isfile(join(dirname(os.__file__), 'lib2to3', fn)) + import platform import sys import subprocess +from pprint import pprint + +# it is important to run the test for the 2to3 command *after* the existance +# of the Grammar pickle files has been checked (because running 2to3) will +# create them +subprocess.check_call([join(sys.prefix, + 'Scripts/2to3.exe' if sys.platform == 'win32' else 'bin/2to3'), '-h']) -armv6l = bool(platform.machine() == 'armv6l') armv7l = bool(platform.machine() == 'armv7l') ppc64le = bool(platform.machine() == 'ppc64le') -if sys.platform == 'darwin': - osx105 = b'10.5.' in subprocess.check_output('sw_vers') -else: - osx105 = False +debug = int(os.getenv('DEBUG', 0)) -print('sys.version:', sys.version) -print('sys.platform:', sys.platform) -print('tuple.__itemsize__:', tuple.__itemsize__) +print('Python version:', platform.python_version()) +assert platform.python_version() == '2.7.12' +assert sys.version_info[:3] == (2, 7, 12) if sys.platform == 'win32': - assert 'MSC v.1900' in sys.version -print('sys.maxunicode:', sys.maxunicode) -print('platform.architecture:', platform.architecture()) -print('platform.python_version:', platform.python_version()) + assert 'MSC v.1500' in sys.version +print('max unicode:', sys.maxunicode) +print('architecture:', platform.architecture()) +print('sys.version:', sys.version) +print('platform.machine():', platform.machine()) +print('DEBUG:', debug) + +assert hasattr(sys, 'gettotalrefcount') == bool(debug) +if debug: + print('sys.gettotalrefcount:', sys.gettotalrefcount()) import _bisect import _codecs_cn @@ -30,16 +46,15 @@ import _csv import _ctypes import _ctypes_test -import _decimal import _elementtree import _functools import _hashlib import _heapq +import _hotshot import _io import _json import _locale import _lsprof -import _lzma import _multibytecodec import _multiprocessing import _random @@ -52,23 +67,34 @@ import audioop import binascii import bz2 +import cPickle +import cStringIO import cmath import datetime +import future_builtins import itertools -import lzma import math import mmap import operator import parser import pyexpat import select +import ssl +import strop import time import unicodedata import zlib +import gzip from os import urandom -t = 100 * b'Foo ' -assert lzma.decompress(lzma.compress(t)) == t +a = 20 * 'Ilan' +b = 'x\x9c\xf3\xccI\xcc\xf3\xa4"\x06\x00\xc8L\x1eQ' +assert zlib.compress(a) == b +assert zlib.decompress(b) == a +with gzip.open('x.gz', 'wb') as fo: + fo.write(a) +with open('x.gz', 'rb') as fi: + assert len(fi.read()) == 29 if sys.platform != 'win32': if not (ppc64le or armv7l): @@ -87,20 +113,27 @@ for var_name in 'LDSHARED', 'CC': value = sysconfig.get_config_var(var_name) assert value.split()[0] == 'gcc', value - for var_name in 'LDCXXSHARED', 'CXX': - value = sysconfig.get_config_var(var_name) - assert value.split()[0] == 'g++', value + value = sysconfig.get_config_var('CXX') + assert value.split()[0] == 'g++', value + readline.clear_history() -if not (armv6l or armv7l or ppc64le or osx105): - import tkinter - import turtle +if not (armv7l or ppc64le): import _tkinter - print('TK_VERSION: %s' % _tkinter.TK_VERSION) - print('TCL_VERSION: %s' % _tkinter.TCL_VERSION) - TCLTK_VER = '8.6' if sys.platform == 'win32' else '8.5' - assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == TCLTK_VER + import Tkinter + import turtle + print('TK_VERSION:', _tkinter.TK_VERSION) + print('TCL_VERSION:', _tkinter.TCL_VERSION) + assert _tkinter.TK_VERSION == _tkinter.TCL_VERSION == '8.5' -import ssl print('OPENSSL_VERSION:', ssl.OPENSSL_VERSION) if sys.platform != 'win32': assert '1.0.2h' in ssl.OPENSSL_VERSION + +pprint(platform._sys_version()) +# This is in the anaconda-recipes test file but is not working... +#sys.version = ('2.7.6 (#1, Jan 9 2013, 06:47:03)\n' +# '[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2') +#pprint(platform._sys_version()) + +if int(os.getenv('GUI_TEST', 0)): + turtle.forward(100)