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
0be536e5
Commit
0be536e5
authored
Oct 01, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.23.x'
parents
ec9058e6
a7f25584
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
45 deletions
+59
-45
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+1
-1
appveyor.yml
appveyor.yml
+3
-2
appveyor/install.ps1
appveyor/install.ps1
+55
-42
No files found.
Cython/Compiler/Optimize.py
View file @
0be536e5
...
...
@@ -1739,7 +1739,7 @@ class EarlyReplaceBuiltinCalls(Visitor.EnvTransform):
if
len
(
args
)
<=
1
:
if
len
(
args
)
==
1
and
args
[
0
].
is_sequence_constructor
:
args
=
args
[
0
].
args
else
:
if
len
(
args
)
<
1
:
# leave this to Python
return
node
...
...
appveyor.yml
View file @
0be536e5
# https://ci.appveyor.com/project/cython/cython
version
:
{
branch
}
-{build}
environment
:
global
:
...
...
@@ -81,5 +79,8 @@ test_script:
artifacts
:
-
path
:
dist\*
cache
:
-
C:\Downloads\Cython -> appveyor\install.ps1
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
appveyor/install.ps1
View file @
0be536e5
...
...
@@ -2,64 +2,76 @@
# Authors: Olivier Grisel and Kyle Kastner
# 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_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
+
"\"
$filepath
=
$basedir
+
$filename
if
(
Test-Path
$filename
)
{
Write-Host
"Reusing"
$filepath
function
Download
(
$url
,
$filename
,
$destdir
)
{
if
(
$destdir
)
{
$item
=
New-Item
$destdir
-ItemType
directory
-Force
$destdir
=
$item
.
FullName
}
else
{
$destdir
=
$pwd
.
Path
}
$filepath
=
Join-Path
$destdir
$filename
if
(
Test-Path
$filepath
)
{
Write-Host
"Reusing"
$filename
"from"
$destdir
return
$filepath
}
# Download and retry up to 5 times in case of network transient errors.
Write-Host
"Downloading"
$filename
"from"
$url
$
retry_attempts
=
3
for
(
$i
=
0
;
$i
-lt
$retry_attempts
;
$i
++
)
{
$
webclient
=
New-Object
System.Net.WebClient
for
each
(
$i
in
1
..
3
)
{
try
{
$webclient
.
DownloadFile
(
$url
,
$filepath
)
break
Write-Host
"File saved at"
$filepath
return
$filepath
}
Catch
[
Exception
]{
Catch
[
Exception
]
{
Start-Sleep
1
}
}
Write-Host
"File saved at"
$filepath
return
$filepath
Write-Host
"Failed to download"
$filename
"from"
$url
return
$null
}
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
)
{
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"
)
{
$platform_suffix
=
""
$url
=
$PYTHON_BASE_URL
+
$python_version
+
"/"
+
$filename
$filepath
=
Download
$url
$filename
$DOWNLOADS
Write-Host
"Installing"
$filename
"to"
$python_home
if
(
$installer_exe
)
{
$prog
=
"
$filepath
"
$args
=
"/quiet TargetDir=
$python_home
"
}
else
{
$platform_suffix
=
".amd64"
$prog
=
"msiexec.exe"
$args
=
"/quiet /qn /i
$filepath
TARGETDIR=
$python_home
"
}
$filepath
=
DownloadPython
$python_version
$platform_suffix
Write-Host
"Installing"
$filepath
"to"
$python_home
$args
=
"/qn /i
$filepath
TARGETDIR=
$python_home
"
Write-Host
"msiexec.exe"
$args
Start-Process
-FilePath
"msiexec.exe"
-ArgumentList
$args
-Wait
Write-Host
"Python
$python_version
(
$architecture
) installation complete"
return
$true
Write-Host
$prog
$args
Start-Process
-FilePath
$prog
-ArgumentList
$args
-Wait
Write-Host
"Python
$python_version
(
$architecture
-bit) installation complete"
}
function
InstallPip
(
$python_home
)
{
$p
ip_path
=
$python_home
+
"\Scripts\pip
.exe"
$p
ython_path
=
$python_home
+
"\python
.exe"
$p
ython_path
=
Join-Path
$python_home
"python
.exe"
$p
ip_path
=
Join-Path
$python_home
"Scripts\pip
.exe"
if
(
Test-Path
$pip_path
)
{
Write-Host
"Upgrading pip"
$args
=
"-m pip.__main__ install --upgrade pip"
...
...
@@ -71,24 +83,25 @@ function InstallPip ($python_home) {
$webclient
=
New-Object
System.Net.WebClient
$webclient
.
DownloadFile
(
$GET_PIP_URL
,
$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
"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"
&
$pip_path
install
$pkg
function
InstallPipPackage
(
$python_home
,
$package
)
{
$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
()
{
InstallPython
$
env
:
PYTHON_VERSION
$
env
:
PYTHON_ARCH
$
env
:
PYTHON
InstallPip
$
env
:
PYTHON
InstallPipPackage
$
env
:
PYTHON
setuptools
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