From 298769cdf328423994a00ae6b6e0c1615059867e Mon Sep 17 00:00:00 2001 From: maxirmx Date: Mon, 12 Oct 2015 23:01:37 +0300 Subject: [PATCH] Appveyor clean build Cleaned temporary stuff --- .win-build.yml => .appveyor.yml | 0 README-MSVC.txt | 13 ++++++++++ appveyor/install.ps1 | 8 ++++-- appveyor/run_with_env.cmd | 4 ++- build-Python27.bat | 45 --------------------------------- test-Python27.bat | 33 ------------------------ 6 files changed, 22 insertions(+), 81 deletions(-) rename .win-build.yml => .appveyor.yml (100%) create mode 100644 README-MSVC.txt delete mode 100644 build-Python27.bat delete mode 100644 test-Python27.bat diff --git a/.win-build.yml b/.appveyor.yml similarity index 100% rename from .win-build.yml rename to .appveyor.yml diff --git a/README-MSVC.txt b/README-MSVC.txt new file mode 100644 index 000000000..db64d16c5 --- /dev/null +++ b/README-MSVC.txt @@ -0,0 +1,13 @@ +Python 2.7 Windows build has been tested with the following toolchain: + - Python 2.7.10 :) + - Microsoft Visual C++ Compiler Package for Python 2.7 http://www.microsoft.com/en-us/download/details.aspx?id=44266 + - C99 compliant stdint.h for MSVC http://msinttypes.googlecode.com/svn/trunk/stdint.h + (C99 complian stdint.h header which is not supplied with Microsoft Visual C++ compiler prior to MSVC 2010) + +Build steps: + - pip install --upgrade setuptools + - pip install cython fabric fabtools + - pip install -r requirements.txt + - python setup.py build_ext --inplace + + \ No newline at end of file diff --git a/appveyor/install.ps1 b/appveyor/install.ps1 index 3b701dd0e..ea9adbdf2 100644 --- a/appveyor/install.ps1 +++ b/appveyor/install.ps1 @@ -9,6 +9,7 @@ $BASE_URL = "https://www.python.org/ftp/python/" $GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py" $GET_PIP_PATH = "C:\get-pip.py" $STDINT_H_URL = "http://msinttypes.googlecode.com/svn/trunk/stdint.h" +$STDINT_RELATIVE_PATH = "include" $PYTHON_PRERELEASE_REGEX = @" (?x) @@ -227,8 +228,11 @@ function InstallMinicondaPip ($python_home) { function InstallStdintH ($python_version) { $major, $minor, $micro, $prerelease = ParsePythonVersion $python_version if ($major -le 2) { - md -Name "..\include" - Download "..\include\stdint.h" $STDINT_H_URL + if((Test-Path $STDINT_RELATIVE_PATH) -eq 0) + { + mkdir $STDINT_RELATIVE_PATH; + } + Download $STDINT_RELATIVE_PATH + "\stdint.h" $STDINT_H_URL } else { Write-Host $python_version " uses C99 compliant Microsoft compiler. stdint.h download is not required." } diff --git a/appveyor/run_with_env.cmd b/appveyor/run_with_env.cmd index c09e3865f..cd15a2ce9 100644 --- a/appveyor/run_with_env.cmd +++ b/appveyor/run_with_env.cmd @@ -49,10 +49,12 @@ IF "%PYTHON_VERSION:~3,1%" == "." ( :: Based on the Python version, determine what SDK version to use, and whether :: to set the SDK for 64-bit. +:: For Python 2.x INCLUDE environment variable is supplemented by local include directory +:: which is supposed to contain C99 compliant stdint.h IF %MAJOR_PYTHON_VERSION% == 2 ( SET WINDOWS_SDK_VERSION="v7.0" SET SET_SDK_64=Y - SET INCLUDE=C:\projects\include;%INCLUDE% + SET INCLUDE=%CD%\include;%INCLUDE% SET INCLUDE ) ELSE ( IF %MAJOR_PYTHON_VERSION% == 3 ( diff --git a/build-Python27.bat b/build-Python27.bat deleted file mode 100644 index 36694e58b..000000000 --- a/build-Python27.bat +++ /dev/null @@ -1,45 +0,0 @@ -@echo off -rem Python 2.7 x86-64 spaCy Windows build -rem Toolchain: -rem Python 2.7.10 :) -rem Microsoft Visual C++ Compiler Package for Python 2.7: -rem http://www.microsoft.com/en-us/download/details.aspx?id=44266 -rem C99 compliant stdint.h for MSVC: -rem http://msinttypes.googlecode.com/svn/trunk/stdint.h - -IF "%1"=="32" GOTO x86-32 -IF "%1"=="64" GOTO x86-64 - -@echo Usage: build-Python27 32/64 -EXIT /B - -:x86-32 -PATH = D:\Python27-32\;D:\Python27-32\Scripts;%PATH% -GOTO run - -:x86-64 -PATH = D:\Python27\;D:\Python27\Scripts;%PATH% - -:run - -IF NOT EXIST "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" COPY D:\local\include\stdint.h "%LOCALAPPDATA%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\stdint.h" - -pip install --upgrade setuptools -pip install cython fabric fabtools -pip install -r requirements.txt -python setup.py build_ext --inplace -python setup.py install - -rem mkdir corpora -rem cd corpora -rem mkdir en -rem cd en - -rem powershell -Command "(New-Object Net.WebClient).DownloadFile('http://wordnetcode.princeton.edu/3.0/WordNet-3.0.tar.gz', 'WordNet-3.0.tar.gz')" - -rem set PYTHONPATH = %~dp0 -rem python bin\init_model.py en lang_data\ corpora\ spacy\en\data - -rem python setup.py test -rem python setup.py install -rem python tests\conftest.py \ No newline at end of file diff --git a/test-Python27.bat b/test-Python27.bat deleted file mode 100644 index fc44c7223..000000000 --- a/test-Python27.bat +++ /dev/null @@ -1,33 +0,0 @@ -@echo off -rem Python 2.7 x86-64 spaCy Windows test - -IF "%1"=="32" GOTO x86-32 -IF "%1"=="64" GOTO x86-64 - -@echo Usage: test-Python27 32/64 -EXIT /B - -:x86-32 -PATH = D:\Python27-32\;D:\Python27-32\Scripts;%PATH% -GOTO run - -:x86-64 -PATH = D:\Python27\;D:\Python27\Scripts;%PATH% - -:run - -@echo This shall be fast ... -python tests\test_basic_create.py - -@echo Patience ... -python tests\test_basic_load.py - -rem py.test tests/ -x - -rem python -m spacy.en.download - -rem python -c "import spacy.en; nlp = spacy.en.English(); print([w.text for w in nlp(u'I would like to be a dog')])" -rem python examples\information_extraction.py -@echo Patience ... -rem python examples\matcher_example.py -