Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
226d33d2
Commit
226d33d2
authored
Oct 01, 2015
by
Lisandro Dalcin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AppVeyor: Update config file and install script
parent
b91d7c74
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
44 deletions
+58
-44
appveyor.yml
appveyor.yml
+3
-2
appveyor/install.ps1
appveyor/install.ps1
+55
-42
No files found.
appveyor.yml
View file @
226d33d2
# https://ci.appveyor.com/project/cython/cython
# https://ci.appveyor.com/project/cython/cython
version
:
{
branch
}
-{build}
environment
:
environment
:
global
:
global
:
...
@@ -81,5 +79,8 @@ test_script:
...
@@ -81,5 +79,8 @@ test_script:
artifacts
:
artifacts
:
-
path
:
dist\*
-
path
:
dist\*
cache
:
-
C:\Downloads\Cython -> appveyor\install.ps1
#on_success:
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
# - TODO: upload the content of dist/*.whl to a public wheelhouse
appveyor/install.ps1
View file @
226d33d2
...
@@ -2,64 +2,76 @@
...
@@ -2,64 +2,76 @@
# Authors: Olivier Grisel and Kyle Kastner
# Authors: Olivier Grisel and Kyle Kastner
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
$BASE_URL
=
"https://www.python.org/ftp/python/"
$
PYTHON_
BASE_URL
=
"https://www.python.org/ftp/python/"
$GET_PIP_URL
=
"https://bootstrap.pypa.io/get-pip.py"
$GET_PIP_URL
=
"https://bootstrap.pypa.io/get-pip.py"
$GET_PIP_PATH
=
"C:\get-pip.py"
$GET_PIP_PATH
=
"C:\get-pip.py"
$DOWNLOADS
=
"C:\Downloads\Cython"
function
DownloadPython
(
$python_version
,
$platform_suffix
)
{
$webclient
=
New-Object
System.Net.WebClient
$filename
=
"python-"
+
$python_version
+
$platform_suffix
+
".msi"
$url
=
$BASE_URL
+
$python_version
+
"/"
+
$filename
$basedir
=
$pwd
.
Path
+
"\"
function
Download
(
$url
,
$filename
,
$destdir
)
{
$filepath
=
$basedir
+
$filename
if
(
$destdir
)
{
if
(
Test-Path
$filename
)
{
$item
=
New-Item
$destdir
-ItemType
directory
-Force
Write-Host
"Reusing"
$filepath
$destdir
=
$item
.
FullName
}
else
{
$destdir
=
$pwd
.
Path
}
$filepath
=
Join-Path
$destdir
$filename
if
(
Test-Path
$filepath
)
{
Write-Host
"Reusing"
$filename
"from"
$destdir
return
$filepath
return
$filepath
}
}
# Download and retry up to 5 times in case of network transient errors.
Write-Host
"Downloading"
$filename
"from"
$url
Write-Host
"Downloading"
$filename
"from"
$url
$
retry_attempts
=
3
$
webclient
=
New-Object
System.Net.WebClient
for
(
$i
=
0
;
$i
-lt
$retry_attempts
;
$i
++
)
{
for
each
(
$i
in
1
..
3
)
{
try
{
try
{
$webclient
.
DownloadFile
(
$url
,
$filepath
)
$webclient
.
DownloadFile
(
$url
,
$filepath
)
break
Write-Host
"File saved at"
$filepath
return
$filepath
}
}
Catch
[
Exception
]{
Catch
[
Exception
]
{
Start-Sleep
1
Start-Sleep
1
}
}
}
}
Write-Host
"File saved at"
$filepath
Write-Host
"Failed to download"
$filename
"from"
$url
return
$filepath
return
$null
}
}
function
InstallPython
(
$python_version
,
$architecture
,
$python_home
)
{
function
InstallPython
(
$python_version
,
$architecture
,
$python_home
)
{
Write-Host
"Installing Python
"
$python_version
"for"
$architecture
"bit architecture to"
$python_home
Write-Host
"Installing Python
$python_version
(
$architecture
-bit) to
$python_home
"
if
(
Test-Path
$python_home
)
{
if
(
Test-Path
$python_home
)
{
Write-Host
$python_home
"already exists, skipping."
Write-Host
$python_home
"already exists, skipping."
return
$false
return
}
$py_major
=
$python_version
[
0
];
$py_minor
=
$python_version
[
2
]
$installer_exe
=
(
$py_major
+
$py_minor
)
-as
[
int
]
-ge
35
if
(
$installer_exe
)
{
$arch_suffix
=
@{
"32"
=
""
;
"64"
=
"-amd64"
}[
$architecture
]
$filename
=
"python-"
+
$python_version
+
$arch_suffix
+
".exe"
}
else
{
$arch_suffix
=
@{
"32"
=
""
;
"64"
=
".amd64"
}[
$architecture
]
$filename
=
"python-"
+
$python_version
+
$arch_suffix
+
".msi"
}
}
if
(
$architecture
-eq
"32"
)
{
$url
=
$PYTHON_BASE_URL
+
$python_version
+
"/"
+
$filename
$platform_suffix
=
""
$filepath
=
Download
$url
$filename
$DOWNLOADS
Write-Host
"Installing"
$filename
"to"
$python_home
if
(
$installer_exe
)
{
$prog
=
"
$filepath
"
$args
=
"/quiet TargetDir=
$python_home
"
}
else
{
}
else
{
$platform_suffix
=
".amd64"
$prog
=
"msiexec.exe"
$args
=
"/quiet /qn /i
$filepath
TARGETDIR=
$python_home
"
}
}
$filepath
=
DownloadPython
$python_version
$platform_suffix
Write-Host
$prog
$args
Write-Host
"Installing"
$filepath
"to"
$python_home
Start-Process
-FilePath
$prog
-ArgumentList
$args
-Wait
$args
=
"/qn /i
$filepath
TARGETDIR=
$python_home
"
Write-Host
"Python
$python_version
(
$architecture
-bit) installation complete"
Write-Host
"msiexec.exe"
$args
Start-Process
-FilePath
"msiexec.exe"
-ArgumentList
$args
-Wait
Write-Host
"Python
$python_version
(
$architecture
) installation complete"
return
$true
}
}
function
InstallPip
(
$python_home
)
{
function
InstallPip
(
$python_home
)
{
$p
ip_path
=
$python_home
+
"\Scripts\pip
.exe"
$p
ython_path
=
Join-Path
$python_home
"python
.exe"
$p
ython_path
=
$python_home
+
"\python
.exe"
$p
ip_path
=
Join-Path
$python_home
"Scripts\pip
.exe"
if
(
Test-Path
$pip_path
)
{
if
(
Test-Path
$pip_path
)
{
Write-Host
"Upgrading pip"
Write-Host
"Upgrading pip"
$args
=
"-m pip.__main__ install --upgrade pip"
$args
=
"-m pip.__main__ install --upgrade pip"
...
@@ -71,24 +83,25 @@ function InstallPip ($python_home) {
...
@@ -71,24 +83,25 @@ function InstallPip ($python_home) {
$webclient
=
New-Object
System.Net.WebClient
$webclient
=
New-Object
System.Net.WebClient
$webclient
.
DownloadFile
(
$GET_PIP_URL
,
$GET_PIP_PATH
)
$webclient
.
DownloadFile
(
$GET_PIP_URL
,
$GET_PIP_PATH
)
Write-Host
"Executing:"
$python_path
$GET_PIP_PATH
Write-Host
"Executing:"
$python_path
$GET_PIP_PATH
Start-Process
-FilePath
"
$python_path
"
-ArgumentList
"
$GET_PIP_PATH
"
Start-Process
-FilePath
$python_path
-ArgumentList
"
$GET_PIP_PATH
"
-Wait
Write-Host
"pip installation complete"
Write-Host
"pip installation complete"
}
}
Write-Host
"Upgrading setuptools"
$args
=
"install --upgrade setuptools"
Write-Host
"Executing:"
$pip_path
$args
Start-Process
-FilePath
$pip_path
-ArgumentList
$args
-Wait
Write-Host
"setuptools upgrade complete"
}
}
function
InstallPipPackage
(
$python_home
,
$pkg
)
{
$pip_path
=
$python_home
+
"\Scripts\pip.exe"
function
InstallPipPackage
(
$python_home
,
$package
)
{
&
$pip_path
install
$pkg
$pip_path
=
Join-Path
$python_home
"Scripts\pip.exe"
Write-Host
"Installing/Upgrading
$package
"
$args
=
"install --upgrade
$package
"
Write-Host
"Executing:"
$pip_path
$args
Start-Process
-FilePath
$pip_path
-ArgumentList
$args
-Wait
Write-Host
"
$package
install/upgrade complete"
}
}
function
main
()
{
function
main
()
{
InstallPython
$
env
:
PYTHON_VERSION
$
env
:
PYTHON_ARCH
$
env
:
PYTHON
InstallPython
$
env
:
PYTHON_VERSION
$
env
:
PYTHON_ARCH
$
env
:
PYTHON
InstallPip
$
env
:
PYTHON
InstallPip
$
env
:
PYTHON
InstallPipPackage
$
env
:
PYTHON
setuptools
InstallPipPackage
$
env
:
PYTHON
wheel
InstallPipPackage
$
env
:
PYTHON
wheel
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment