10000 Use AppVeyor to build windows wheel (#188) · yangkf1985/msgpack-python@ceb9635 · GitHub
[go: up one dir, main page]

Skip to content

Commit ceb9635

Browse files
committed
Use AppVeyor to build windows wheel (msgpack#188)
* Add AppVeyor support to build windows wheel * Fix test_limits on 32bit environments * Ignore Python35-x64 test fail for now Should be fixed in next version.
1 parent 6b113a6 commit ceb9635

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

appveyor.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
environment:
2+
3+
matrix:
4+
5+
# For Python versions available on Appveyor, see
6+
# http://www.appveyor.com/docs/installed-software#python
7+
# The list here is complete (excluding Python 2.6, which
8+
# isn't covered by this document) at the time of writing.
9+
10+
- PYTHON: "C:\\Python27"
11+
- PYTHON: "C:\\Python34"
12+
- PYTHON: "C:\\Python35"
13+
- PYTHON: "C:\\Python27-x64"
14+
- PYTHON: "C:\\Python34-x64"
15+
DISTUTILS_USE_SDK: "1"
16+
17+
# Python35-x64 test fails with MemoryError
18+
# TODO: investigate it
19+
#- PYTHON: "C:\\Python35-x64"
20+
21+
install:
22+
# We need wheel installed to build wheels
23+
- "%PYTHON%\\python.exe -m pip install -U pip wheel pytest cython"
24+
25+
build: off
26+
27+
test_script:
28+
# Put your test command here.
29+
# If you don't need to build C extensions on 64-bit Python 3.3 or 3.4,
30+
# you can remove "build.cmd" from the front of the command, as it's
31+
# only needed to support those cases.
32+
# Note that you must use the environment variable %PYTHON% to refer to
33+
# the interpreter you're using - Appveyor does not do anything special
34+
# to put the Python evrsion you want to use on PATH.
35+
- "build.cmd %PYTHON%\\python.exe setup.py build_ext -i"
36+
- "build.cmd %PYTHON%\\python.exe setup.py install"
37+
- "%PYTHON%\\python.exe -c \"import sys; print(hex(sys.maxsize))\""
38+
- "%PYTHON%\\python.exe -c \"from msgpack import _packer, _unpacker\""
39+
- "%PYTHON%\\Scripts\\py.test test"
40+
- "build.cmd %PYTHON%\\python.exe setup.py bdist_wheel"
41+
42+
after_test:
43+
# This step builds your wheels.
44+
# Again, you only need build.cmd if you're building C extensions for
45+
# 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct
46+
# interpreter
47+
48+
artifacts:
49+
# bdist_wheel puts your built wheel in the dist directory
50+
- path: dist\*
51+
52+
#on_success:
53+
# You can use this step to upload your artifacts to a public website.
54+
# See Appveyor's documentation for more details. Or you can simply
55+
# access your wheels from the Appveyor "artifacts" tab for your build.
56+
57+
# vim: set shiftwidth=2

build.cmd

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@echo off
2+
:: To build extensions for 64 bit Python 3, we need to configure environment
3+
:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
4+
:: MS Windows SDK for Windows 7 and .NET Framework 4
5+
::
6+
:: More details at:
7+
:: https://github.com/cython/cython/wiki/64BitCythonExtensionsOnWindows
8+
9+
IF "%DISTUTILS_USE_SDK%"=="1" (
10+
ECHO Configuring environment to build with MSVC on a 64bit architecture
11+
ECHO Using Windows SDK 7.1
12+
"C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -q -version:v7.1
13+
CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
14+
SET MSSdk=1
15+
REM Need the following to allow tox to see the SDK compiler
16+
SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
17+
) ELSE (
18+
ECHO Using default MSVC build environment
19+
)
20+
21+
CALL %*

msgpack/_packer.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ cdef class Packer(object):
271271
msgpack_pack_ext(&self.pk, typecode, len(data))
272272
msgpack_pack_raw_body(&self.pk, data, len(data))
273273

274-
def pack_array_header(self, size_t size):
274+
def pack_array_header(self, long long size):
275275
if size > (2**32-1):
276276
raise PackValueError
277277
cdef int ret = msgpack_pack_array(&self.pk, size)
@@ -284,7 +284,7 @@ cdef class Packer(object):
284284
self.pk.length = 0
285285
return buf
286286

287-
def pack_map_header(self, size_t size):
287+
def pack_map_header(self, long long size):
288288
if size > (2**32-1):
289289
raise PackValueError
290290
cdef int ret = msgpack_pack_map(&self.pk, size)

0 commit comments

Comments
 (0)
0