Browse Source

Change version of wheel

Bo Yang 7 years ago
parent
commit
19bf53c25a
4 changed files with 18 additions and 1 deletions
  1. 1 0
      .travis.yml
  2. 3 1
      appveyor.bat
  3. 1 0
      appveyor.yml
  4. 13 0
      config.sh

+ 1 - 0
.travis.yml

@@ -2,6 +2,7 @@ env:
   global:
   global:
       - REPO_DIR=protobuf
       - REPO_DIR=protobuf
       - BUILD_COMMIT=v3.5.1
       - BUILD_COMMIT=v3.5.1
+      - BUILD_VERSION=3.5.1.dev1
       - PLAT=x86_64
       - PLAT=x86_64
       - UNICODE_WIDTH=32
       - UNICODE_WIDTH=32
       - WHEELHOUSE_UPLOADER_USERNAME=travis-worker
       - WHEELHOUSE_UPLOADER_USERNAME=travis-worker

+ 3 - 1
appveyor.bat

@@ -45,6 +45,9 @@ REM ======================
 
 
 cd python
 cd python
 
 
+REM Modify Build Version
+sed -i '/__version__/c\__version__ = \'%BUILD_VERSION%\'' google/protobuf/__init__.py
+
 REM https://github.com/Theano/Theano/issues/4926
 REM https://github.com/Theano/Theano/issues/4926
 sed -i '/Wno-sign-compare/a \ \ \ \ extra_compile_args.append(\'-D_hypot=hypot\')' setup.py
 sed -i '/Wno-sign-compare/a \ \ \ \ extra_compile_args.append(\'-D_hypot=hypot\')' setup.py
 sed -i 's/\'-DPYTHON_PROTO2_CPP_IMPL_V2\'/\'-DPYTHON_PROTO2_CPP_IMPL_V2\',\'-D_hypot=hypot\'/g' setup.py
 sed -i 's/\'-DPYTHON_PROTO2_CPP_IMPL_V2\'/\'-DPYTHON_PROTO2_CPP_IMPL_V2\',\'-D_hypot=hypot\'/g' setup.py
@@ -68,6 +71,5 @@ sed -i '/-Wno-invalid-offsetof/d' setup.py
 sed -i '/-Wno-sign-compare/d' setup.py
 sed -i '/-Wno-sign-compare/d' setup.py
 :msvc_remove_flags_end
 :msvc_remove_flags_end
 
 
-cat setup.py
 python setup.py bdist_wheel --cpp_implementation --compile_static_extension
 python setup.py bdist_wheel --cpp_implementation --compile_static_extension
 cd ..\..
 cd ..\..

+ 1 - 0
appveyor.yml

@@ -7,6 +7,7 @@ environment:
     REPO_DIR: protobuf
     REPO_DIR: protobuf
     PACKAGE_NAME: protobuf
     PACKAGE_NAME: protobuf
     BUILD_COMMIT: v3.5.1
     BUILD_COMMIT: v3.5.1
+    BUILD_VERSION: 3.5.1.dev1
     MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
     MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
     MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
     MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin
     BUILD_DLL: OFF
     BUILD_DLL: OFF

+ 13 - 0
config.sh

@@ -29,6 +29,19 @@ function bdist_wheel_cmd {
     # fixed with bdist_wheel:
     # fixed with bdist_wheel:
     # https://github.com/warner/python-versioneer/issues/121
     # https://github.com/warner/python-versioneer/issues/121
     local abs_wheelhouse=$1
     local abs_wheelhouse=$1
+
+    # Modify build version
+    pwd
+    ls
+    echo $abs_wheelhouse
+    echo $BUILD_VERSION
+    if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
+        sed -i.bu "s/^__version__.*/__version__ = '$BUILD_VERSION'/" google/protobuf/__init__.py
+    else
+        sed -i "s/^__version__.*/__version__ = '3.5.1.dev1'/" google/protobuf/__init__.py
+    fi
+    cat google/protobuf/__init__.py
+    
     python setup.py bdist_wheel --cpp_implementation --compile_static_extension
     python setup.py bdist_wheel --cpp_implementation --compile_static_extension
     cp dist/*.whl $abs_wheelhouse
     cp dist/*.whl $abs_wheelhouse
 }
 }