From 0e321a710524b29e0cfe18da86cb0307af62a0ab Mon Sep 17 00:00:00 2001 From: Henning Peters Date: Tue, 22 Dec 2015 23:25:38 +0100 Subject: [PATCH] get mingw32 to work --- spacy/en/download.py | 11 +++++++++-- venv.ps1 | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/spacy/en/download.py b/spacy/en/download.py index 42082ca1a..ea459b1b0 100644 --- a/spacy/en/download.py +++ b/spacy/en/download.py @@ -17,8 +17,15 @@ def migrate(path): def link(package, path): if os.path.exists(path): - os.unlink(path) - os.symlink(package.dir_path('data'), path) + if os.path.isdir(path): + shutil.rmtree(path) + else: + os.unlink(path) + + if not hasattr(os, 'symlink'): # not supported by win+py27 + shutil.copytree(package.dir_path('data'), path) + else: + os.symlink(package.dir_path('data'), path) @plac.annotations( diff --git a/venv.ps1 b/venv.ps1 index b5b05b9ca..e84822309 100644 --- a/venv.ps1 +++ b/venv.ps1 @@ -2,14 +2,21 @@ param ( [string]$python = $(throw "-python is required."), [string]$install_mode = $(throw "-install_mode is required."), [string]$pip_date + [string]$compiler ) $ErrorActionPreference = "Stop" - + if(!(Test-Path -Path ".build")) { - virtualenv .build --python $python + virtualenv .build --system-site-packages --python $python } + +if($compiler) +{ + "[build]`r`ncompiler=$compiler" | Out-File .\.build\Lib\distutils\distutils.cfg +} + .build\Scripts\activate.ps1 python build.py prepare $pip_date