diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 401c927d..b217ab07 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -6,6 +6,8 @@ phases: name: Windows buildScript: build.cmd buildMatrix: + Py37: + _configuration: RlsWinPy3.7 Py36: _configuration: RlsWinPy3.6 Py35: @@ -21,8 +23,8 @@ phases: name: Mac buildScript: ./build.sh buildMatrix: - Py36: - _configuration: RlsMacPy3.6 + Py37: + _configuration: RlsMacPy3.7 buildQueue: name: Hosted macOS @@ -34,8 +36,10 @@ phases: buildScript: ./build.sh testDistro: ubuntu16 buildMatrix: - Py35: - _configuration: RlsLinPy3.5 + Py37: + _configuration: RlsLinPy3.7 + Py36: + _configuration: RlsLinPy3.6 buildQueue: name: Hosted Ubuntu 1604 # Run tests on CentOS7 diff --git a/README.md b/README.md index 14c03df2..d56c9764 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Documentation can be found [here](https://docs.microsoft.com/en-us/NimbusML/over `nimbusml` runs on Windows, Linux, and macOS. -`nimbusml` requires Python **2.7**, **3.5**, or **3.6**, 64 bit version only. Python 3.7 is not yet supported. +`nimbusml` requires Python **2.7**, **3.5**, **3.6**, or **3.7**, 64 bit version only. Install `nimbusml` using `pip` with: diff --git a/build.cmd b/build.cmd index 42c07695..1f98b3c4 100644 --- a/build.cmd +++ b/build.cmd @@ -8,18 +8,18 @@ set __currentScriptDir=%~dp0 set DependenciesDir=%__currentScriptDir%dependencies\ if not exist "%DependenciesDir%" (md "%DependenciesDir%") -:: Default configuration if no arguents passed to build.cmd (DbgWinPy3.6) +:: Default configuration if no arguents passed to build.cmd (DbgWinPy3.7) set __BuildArch=x64 set __VCBuildArch=x86_amd64 -set Configuration=DbgWinPy3.6 +set Configuration=DbgWinPy3.7 set DebugBuild=True set BuildOutputDir=%__currentScriptDir%x64\ -set PythonUrl=https://pythonpkgdeps.blob.core.windows.net/python/python-3.6.5-mohoov-amd64.zip -set PythonRoot=%DependenciesDir%Python3.6 -set BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/debug/windows/Boost-3.6-1.64.0.0.zip -set BoostRoot=%DependenciesDir%BoostDbg3.6 -set PythonVersion=3.6 -set PythonTag=cp36 +set PythonUrl=https://pythonpkgdeps.blob.core.windows.net/python/python-3.7.3-amd64.zip +set PythonRoot=%DependenciesDir%Python3.7 +set BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/debug/windows/Boost-3.7-1.69.0.0.zip +set BoostRoot=%DependenciesDir%BoostDbg3.7 +set PythonVersion=3.7 +set PythonTag=cp37 set RunTests=False set BuildDotNetBridgeOnly=False set SkipDotNetBridge=False @@ -53,6 +53,17 @@ echo " --skipDotNetBridge Build everything except DotNetBridge" goto :Exit_Success :Configuration +if /i [%1] == [RlsWinPy3.7] ( + set DebugBuild=False + set Configuration=RlsWinPy3.7 + set PythonUrl=https://pythonpkgdeps.blob.core.windows.net/python/python-3.7.3-amd64.zip + set PythonRoot=%DependenciesDir%Python3.7 + set BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/release/windows/Boost-3.7-1.69.0.0.zip + set BoostRoot=%DependenciesDir%BoostRls3.7 + set PythonVersion=3.7 + set PythonTag=cp37 + shift && goto :Arg_Loop +) if /i [%1] == [RlsWinPy3.6] ( set DebugBuild=False set Configuration=RlsWinPy3.6 @@ -86,6 +97,17 @@ if /i [%1] == [RlsWinPy2.7] ( set PythonTag=cp27 shift && goto :Arg_Loop ) +if /i [%1] == [DbgWinPy3.7] ( + set DebugBuild=True + set Configuration=DbgWinPy3.7 + set PythonUrl=https://pythonpkgdeps.blob.core.windows.net/python/python-3.7.3-amd64.zip + set PythonRoot=%DependenciesDir%Python3.7 + set BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/debug/windows/Boost-3.7-1.69.0.0.zip + set BoostRoot=%DependenciesDir%BoostDbg3.7 + set PythonVersion=3.7 + set PythonTag=cp37 + shift && goto :Arg_Loop +) if /i [%1] == [DbgWinPy3.6] ( set DebugBuild=True set Configuration=DbgWinPy3.6 @@ -240,7 +262,7 @@ if exist %libs% rd %libs% /S /Q md %libs% echo.>"%__currentScriptDir%src\python\nimbusml\internal\libs\__init__.py" -if %PythonVersion% == 3.6 ( +if %PythonVersion% == 3.7 ( :: Running the check in one python is enough. Entrypoint compiler doesn't run in py2.7. echo Generating low-level Python API from mainifest.json ... call "%PythonExe%" -m pip install --upgrade autopep8 autoflake isort jinja2 diff --git a/build.sh b/build.sh index 6ad95125..a4a57545 100755 --- a/build.sh +++ b/build.sh @@ -14,20 +14,20 @@ usage() echo "Usage: $0 --configuration [--runTests]" echo "" echo "Options:" - echo " --configuration Build Configuration (DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)" + echo " --configuration Build Configuration (DbgLinPy3.7,DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)" echo " --runTests Run tests after build" echo " --runTestsOnly Run tests on a wheel file in default build location (/target/)" echo " --buildNativeBridgeOnly Build only the native bridge code" - echo " --skipNativeBridge Build the DotNet bridge and python wheel but use existing native bridge binaries (e.g. /x64/DbgLinPy3.6/pybridge.so)" + echo " --skipNativeBridge Build the DotNet bridge and python wheel but use existing native bridge binaries (e.g. /x64/DbgLinPy3.7/pybridge.so)" exit 1 } # Parameter defaults if [ "$(uname -s)" = "Darwin" ] then - __configuration=DbgMacPy3.6 + __configuration=DbgMacPy3.7 else - __configuration=DbgLinPy3.6 + __configuration=DbgLinPy3.7 fi __runTests=false __buildNativeBridge=true @@ -65,6 +65,12 @@ while [ "$1" != "" ]; do done case $__configuration in +*LinPy3.7) + PythonUrl=https://pythonpkgdeps.blob.core.windows.net/anaconda-full/Anaconda3-Linux-2019.03.v2.tar.gz + BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/release/linux/Boost-3.7-1.69.0.0.tar.gz + PythonVersion=3.7 + PythonTag=cp37 + ;; *LinPy3.6) PythonUrl=https://pythonpkgdeps.blob.core.windows.net/anaconda-full/Anaconda3-Linux-5.0.1.v2.tar.gz BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/release/linux/Boost-3.6-1.64.0.0.tar.gz @@ -83,6 +89,12 @@ case $__configuration in PythonVersion=2.7 PythonTag=cp27 ;; +*MacPy3.7) + PythonUrl=https://pythonpkgdeps.blob.core.windows.net/anaconda-full/Anaconda3-Mac-2019.03.v2.tar.gz + BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/release/mac/Boost-3.7-1.69.0.0.tar.gz + PythonVersion=3.7 + PythonTag=cp37 + ;; *MacPy3.6) PythonUrl=https://pythonpkgdeps.blob.core.windows.net/anaconda-full/Anaconda3-Mac-5.0.1.tar.gz BoostUrl=https://pythonpkgdeps.blob.core.windows.net/boost/release/mac/Boost-3.6-1.64.0.0.tar.gz @@ -242,7 +254,7 @@ then exit 1 fi # Review: Adding "--upgrade" to pip install will cause problems when using Anaconda as the python distro because of Anaconda's quirks with pytest. - "${PythonExe}" -m pip install nose pytest graphviz pytest-cov==2.6.0 "jupyter_client>=4.4.0" "nbconvert>=4.2.0" + "${PythonExe}" -m pip install nose "pytest>=4.4.0" graphviz "pytest-cov>=2.6.1" "jupyter_client>=4.4.0" "nbconvert>=4.2.0" if [ ${PythonVersion} = 2.7 ] then "${PythonExe}" -m pip install --upgrade pyzmq diff --git a/build/signed_build_phase.yml b/build/signed_build_phase.yml index 2468a178..8f42dfe2 100644 --- a/build/signed_build_phase.yml +++ b/build/signed_build_phase.yml @@ -1,6 +1,6 @@ parameters: name: 'default_placeholder_for_name' - config: 'RlsWinPy3.6' + config: 'RlsWinPy3.7' phases: ######### Only Windows binaries need to be signed ############################## diff --git a/build/vsts-ci-nightly.yml b/build/vsts-ci-nightly.yml index 32fd8737..6e678411 100644 --- a/build/vsts-ci-nightly.yml +++ b/build/vsts-ci-nightly.yml @@ -6,6 +6,8 @@ phases: name: Windows buildScript: build.cmd buildMatrix: + Py37: + _configuration: RlsWinPy3.7 Py36: _configuration: RlsWinPy3.6 Py35: @@ -21,6 +23,8 @@ phases: name: Mac buildScript: ./build.sh buildMatrix: + Py37: + _configuration: RlsMacPy3.7 Py36: _configuration: RlsMacPy3.6 Py35: @@ -38,6 +42,8 @@ phases: buildScript: ./build.sh testDistro: ubuntu16 buildMatrix: + Py37: + _configuration: RlsLinPy3.7 Py36: _configuration: RlsLinPy3.6 Py35: @@ -53,6 +59,8 @@ phases: buildScript: ./build.sh testDistro: ubuntu14 buildMatrix: + Py37: + _configuration: RlsLinPy3.7 Py36: _configuration: RlsLinPy3.6 Py35: @@ -68,6 +76,8 @@ phases: buildScript: ./build.sh testDistro: centos7 buildMatrix: + Py37: + _configuration: RlsLinPy3.7 Py36: _configuration: RlsLinPy3.6 Py35: diff --git a/build/vsts-ci.yml b/build/vsts-ci.yml index e75baa09..596e48d2 100644 --- a/build/vsts-ci.yml +++ b/build/vsts-ci.yml @@ -1,4 +1,8 @@ phases: +- template: signed_build_phase.yml + parameters: + name: Build_windows_RlsWinPy3_7 + config: RlsWinPy3.7 - template: signed_build_phase.yml parameters: name: Build_windows_RlsWinPy3_6 @@ -20,6 +24,8 @@ phases: buildScript: ./build.sh testDistro: noTests buildMatrix: + Py37: + _configuration: RlsMacPy3.7 Py36: _configuration: RlsMacPy3.6 Py35: @@ -34,6 +40,8 @@ phases: buildScript: ./build.sh testDistro: noTests buildMatrix: + Py37: + _configuration: RlsLinPy3.7 Py36: _configuration: RlsLinPy3.6 Py35: diff --git a/docs/developers/developer-guide.md b/docs/developers/developer-guide.md index 83053655..4cfe4b3c 100644 --- a/docs/developers/developer-guide.md +++ b/docs/developers/developer-guide.md @@ -1,7 +1,7 @@ Developer Guide =============== -NimbusML runs on Windows, Linux, and macOS and supports Python 3.6, 3.5, and 2.7, 64 bit versions only. It has been tested on Windows 10, MacOS 10.13, Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, CentOS 7, and RHEL 7. +NimbusML runs on Windows, Linux, and macOS and supports Python 3.7, 3.6, 3.5, and 2.7, 64 bit versions only. It has been tested on Windows 10, MacOS 10.13, Ubuntu 14.04, Ubuntu 16.04, Ubuntu 18.04, CentOS 7, and RHEL 7. Building the repository ======================= diff --git a/docs/developers/linux-build.md b/docs/developers/linux-build.md index 5fb582e5..6ed681e8 100644 --- a/docs/developers/linux-build.md +++ b/docs/developers/linux-build.md @@ -12,7 +12,7 @@ Building NimbusML from source on Linux ## Build Run `./build.sh` -This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `./build.sh --configuration RlsLinPy3.6` for examle. +This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `./build.sh --configuration RlsLinPy3.7` for examle. For additional options including running tests and building components independently, see `./build.sh -h`. diff --git a/docs/developers/mac-build.md b/docs/developers/mac-build.md index f2e8b637..fe4e4939 100644 --- a/docs/developers/mac-build.md +++ b/docs/developers/mac-build.md @@ -7,7 +7,7 @@ Building NimbusML from source on Mac ## Build Run `./build.sh` -This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `./build.sh --configuration RlsMacPy3.6` for examle. +This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `./build.sh --configuration RlsMacPy3.7` for examle. For additional options including running tests and building components independently, see `./build.sh -h`. diff --git a/docs/developers/windows-build.md b/docs/developers/windows-build.md index 40dfd602..8dd0e4b8 100644 --- a/docs/developers/windows-build.md +++ b/docs/developers/windows-build.md @@ -7,6 +7,6 @@ Building NimbusML from source on Windows ## Build Run `build.cmd` -This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `build.cmd --configuration RlsWinPy3.6` for examle. +This downloads dependencies (.NET SDK, specific versions of Python and Boost), builds native code and managed code, and packages NimbusML into a pip-installable wheel. This produces debug binaries by default, and release versions can be specified by `build.cmd --configuration RlsWinPy3.7` for examle. For additional options including running tests and building components independently, see `build.cmd -?`. diff --git a/nimbusml.sln b/nimbusml.sln index 5c9c69cc..546014a9 100644 --- a/nimbusml.sln +++ b/nimbusml.sln @@ -25,76 +25,103 @@ Global DbgLinPy2.7|x64 = DbgLinPy2.7|x64 DbgLinPy3.5|x64 = DbgLinPy3.5|x64 DbgLinPy3.6|x64 = DbgLinPy3.6|x64 + DbgLinPy3.7|x64 = DbgLinPy3.7|x64 DbgWinPy2.7|x64 = DbgWinPy2.7|x64 DbgWinPy3.5|x64 = DbgWinPy3.5|x64 DbgWinPy3.6|x64 = DbgWinPy3.6|x64 + DbgWinPy3.7|x64 = DbgWinPy3.7|x64 RlsLinPy2.7|x64 = RlsLinPy2.7|x64 RlsLinPy3.5|x64 = RlsLinPy3.5|x64 RlsLinPy3.6|x64 = RlsLinPy3.6|x64 + RlsLinPy3.7|x64 = RlsLinPy3.7|x64 RlsMacPy3.6|x64 = RlsMacPy3.6|x64 + RlsMacPy3.7|x64 = RlsMacPy3.7|x64 RlsWinPy2.7|x64 = RlsWinPy2.7|x64 RlsWinPy3.5|x64 = RlsWinPy3.5|x64 RlsWinPy3.6|x64 = RlsWinPy3.6|x64 + RlsWinPy3.7|x64 = RlsWinPy3.7|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgLinPy2.7|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgLinPy3.5|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgLinPy3.6|x64.ActiveCfg = Debug|Any CPU + {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgLinPy3.7|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgWinPy2.7|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgWinPy3.5|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgWinPy3.6|x64.ActiveCfg = Debug|Any CPU + {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.DbgWinPy3.7|x64.ActiveCfg = Debug|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsLinPy2.7|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsLinPy3.5|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsLinPy3.6|x64.ActiveCfg = Release|Any CPU + {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsLinPy3.7|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsMacPy3.6|x64.ActiveCfg = Release|Any CPU + {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsMacPy3.7|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsWinPy2.7|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsWinPy3.5|x64.ActiveCfg = Release|Any CPU {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsWinPy3.6|x64.ActiveCfg = Release|Any CPU + {8DFF150B-E1C6-4EB4-90C7-9D69E9E7CCA1}.RlsWinPy3.7|x64.ActiveCfg = Release|Any CPU {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy2.7|x64.ActiveCfg = DbgLinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy2.7|x64.Build.0 = DbgLinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.5|x64.ActiveCfg = DbgLinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.5|x64.Build.0 = DbgLinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.6|x64.ActiveCfg = DbgLinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.7|x64.ActiveCfg = DbgLinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.6|x64.Build.0 = DbgLinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgLinPy3.7|x64.Build.0 = DbgLinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy2.7|x64.ActiveCfg = DbgWinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy2.7|x64.Build.0 = DbgWinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.5|x64.ActiveCfg = DbgWinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.5|x64.Build.0 = DbgWinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.6|x64.ActiveCfg = DbgWinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.7|x64.ActiveCfg = DbgWinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.6|x64.Build.0 = DbgWinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.DbgWinPy3.7|x64.Build.0 = DbgWinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy2.7|x64.ActiveCfg = RlsLinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy2.7|x64.Build.0 = RlsLinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.5|x64.ActiveCfg = RlsLinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.5|x64.Build.0 = RlsLinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.6|x64.ActiveCfg = RlsLinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.7|x64.ActiveCfg = RlsLinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.6|x64.Build.0 = RlsLinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsLinPy3.7|x64.Build.0 = RlsLinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsMacPy3.6|x64.ActiveCfg = RlsMacPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsMacPy3.7|x64.ActiveCfg = RlsMacPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsMacPy3.6|x64.Build.0 = RlsMacPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsMacPy3.7|x64.Build.0 = RlsMacPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy2.7|x64.ActiveCfg = RlsWinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy2.7|x64.Build.0 = RlsWinPy2.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.5|x64.ActiveCfg = RlsWinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.5|x64.Build.0 = RlsWinPy3.5|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.6|x64.ActiveCfg = RlsWinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.7|x64.ActiveCfg = RlsWinPy3.7|x64 {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.6|x64.Build.0 = RlsWinPy3.6|x64 - {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy2.7|x64.ActiveCfg = DbgWinPy3.6|x64 - {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy3.5|x64.ActiveCfg = DbgWinPy3.6|x64 + {EC58F2CF-A1D5-4E28-97F9-69B1E46F6F63}.RlsWinPy3.7|x64.Build.0 = RlsWinPy3.7|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy2.7|x64.ActiveCfg = DbgWinPy2.7|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy3.5|x64.ActiveCfg = DbgWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy3.6|x64.ActiveCfg = DbgWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgLinPy3.7|x64.ActiveCfg = DbgWinPy3.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy2.7|x64.ActiveCfg = DbgWinPy2.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy2.7|x64.Build.0 = DbgWinPy2.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.5|x64.ActiveCfg = DbgWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.5|x64.Build.0 = DbgWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.6|x64.ActiveCfg = DbgWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.7|x64.ActiveCfg = DbgWinPy3.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.6|x64.Build.0 = DbgWinPy3.6|x64 - {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy2.7|x64.ActiveCfg = RlsWinPy3.6|x64 - {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy3.5|x64.ActiveCfg = RlsWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.DbgWinPy3.7|x64.Build.0 = DbgWinPy3.7|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy2.7|x64.ActiveCfg = RlsWinPy2.7|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy3.5|x64.ActiveCfg = RlsWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy3.6|x64.ActiveCfg = RlsWinPy3.6|x64 - {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsMacPy3.6|x64.ActiveCfg = DbgWinPy3.5|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsLinPy3.7|x64.ActiveCfg = RlsWinPy3.7|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsMacPy3.6|x64.ActiveCfg = DbgWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsMacPy3.7|x64.ActiveCfg = DbgWinPy3.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy2.7|x64.ActiveCfg = RlsWinPy2.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy2.7|x64.Build.0 = RlsWinPy2.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.5|x64.ActiveCfg = RlsWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.5|x64.Build.0 = RlsWinPy3.5|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.6|x64.ActiveCfg = RlsWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.7|x64.ActiveCfg = RlsWinPy3.7|x64 {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.6|x64.Build.0 = RlsWinPy3.6|x64 + {3DA0AF32-A05B-4ECF-8010-83B14612FBB3}.RlsWinPy3.7|x64.Build.0 = RlsWinPy3.7|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/CommonCpp.props b/src/CommonCpp.props index 5c5d5814..94ec4d69 100644 --- a/src/CommonCpp.props +++ b/src/CommonCpp.props @@ -48,10 +48,18 @@ $(MSBuildThisFileDirectory)..\dependencies\BoostRls3.6 $(MSBuildThisFileDirectory)..\dependencies\Python3.6 + + $(MSBuildThisFileDirectory)..\dependencies\BoostRls3.7 + $(MSBuildThisFileDirectory)..\dependencies\Python3.7 + $(MSBuildThisFileDirectory)..\dependencies\BoostDbg3.6 $(MSBuildThisFileDirectory)..\dependencies\Python3.6 + + $(MSBuildThisFileDirectory)..\dependencies\BoostDbg3.7 + $(MSBuildThisFileDirectory)..\dependencies\Python3.7 + $(SolutionDir)\bin\$(Configuration)\Win\ diff --git a/src/DotNetBridge/DotNetBridge.csproj b/src/DotNetBridge/DotNetBridge.csproj index 4e851de7..e9ecab39 100644 --- a/src/DotNetBridge/DotNetBridge.csproj +++ b/src/DotNetBridge/DotNetBridge.csproj @@ -8,7 +8,7 @@ DotNetBridge false ..\$(Platform)\$(Configuration)\ - DbgWinPy3.6;DbgWinPy3.5;DbgWinPy2.7;RlsWinPy3.6;RlsWinPy3.5;RlsWinPy2.7;DbgLinPy3.6;DbgLinPy3.5;DbgLinPy2.7;RlsLinPy3.6;RlsLinPy3.5;RlsLinPy2.7;RlsMacPy3.6 + DbgWinPy3.7;DbgWinPy3.6;DbgWinPy3.5;DbgWinPy2.7;RlsWinPy3.7;RlsWinPy3.6;RlsWinPy3.5;RlsWinPy2.7;DbgLinPy3.7;DbgLinPy3.6;DbgLinPy3.5;DbgLinPy2.7;RlsLinPy3.7;RlsLinPy3.6;RlsLinPy3.5;RlsLinPy2.7;RlsMacPy3.7;RlsMacPy3.6 0.10.0 Microsoft Corporation (c) Microsoft Corporation. All rights reserved. diff --git a/src/NativeBridge/CMakeLists.txt b/src/NativeBridge/CMakeLists.txt index 605f0815..2ceaf838 100644 --- a/src/NativeBridge/CMakeLists.txt +++ b/src/NativeBridge/CMakeLists.txt @@ -47,11 +47,11 @@ MESSAGE( STATUS "BOOST_DIR: " ${BOOST_DIR} ) MESSAGE( STATUS "PYTHON_DIR: " ${PYTHON_DIR} ) MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} ) -include_directories(${PYTHON_DIR}/include/python2.7 ${PYTHON_DIR}/include/python3.5m ${PYTHON_DIR}/include/python3.6m ${BOOST_DIR}/Include) +include_directories(${PYTHON_DIR}/include/python2.7 ${PYTHON_DIR}/include/python3.5m ${PYTHON_DIR}/include/python3.6m ${PYTHON_DIR}/include/python3.7m ${BOOST_DIR}/Include) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=unused-variable -Wno-error=attributes -Wno-error=unused-value") if (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,'/Library/Frameworks/Python.framework/Versions/3.6/lib'" ) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,'/Library/Frameworks/Python.framework/Versions/3.7/lib'" ) else () set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,'\${ORIGIN}'" ) endif() @@ -73,6 +73,8 @@ add_library(PyBridge SHARED $) # Define lib dependencies to be used as target link libraries if (${PYTHON_VER} STREQUAL "2.7") set(BOOST_LIBS ${BOOST_DIR}/lib/libboost_python.a ${BOOST_DIR}/lib/libboost_numpy.a) +elseif (${PYTHON_VER} STREQUAL "3.7") + set(BOOST_LIBS ${BOOST_DIR}/lib/libboost_python37.a ${BOOST_DIR}/lib/libboost_numpy37.a) else() set(BOOST_LIBS ${BOOST_DIR}/lib/libboost_python3.a ${BOOST_DIR}/lib/libboost_numpy3.a) endif() diff --git a/src/NativeBridge/NativeBridge.vcxproj b/src/NativeBridge/NativeBridge.vcxproj index c1b2560e..f9cf674c 100644 --- a/src/NativeBridge/NativeBridge.vcxproj +++ b/src/NativeBridge/NativeBridge.vcxproj @@ -14,6 +14,10 @@ DbgWinPy3.6 x64 + + DbgWinPy3.7 + x64 + RlsWinPy2.7 x64 @@ -26,6 +30,10 @@ RlsWinPy3.6 x64 + + RlsWinPy3.7 + x64 + @@ -40,12 +48,18 @@ DynamicLibrary + + DynamicLibrary + DynamicLibrary DynamicLibrary + + DynamicLibrary + DynamicLibrary @@ -61,12 +75,18 @@ + + + + + + @@ -86,6 +106,12 @@ pybridge ..\..\$(Platform)\$(Configuration)\ + + false + .pyd + pybridge + ..\..\$(Platform)\$(Configuration)\ + false .pyd @@ -98,6 +124,12 @@ pybridge ..\..\$(Platform)\$(Configuration)\ + + false + .pyd + pybridge + ..\..\$(Platform)\$(Configuration)\ + false .pyd @@ -151,6 +183,28 @@ $(Boostroot)\lib;$(PythonRoot)\libs;$(OutDir) + + + Level3 + Use + Disabled + true + false + CORECLR;_DEBUG;_WINDOWS;_USRDLL;PYBRIDGE_EXPORTS;BOOST_USE_STATIC_LIBS;BOOST_PYTHON_STATIC_LIB;BOOST_ALL_NO_LIB;BOOST_NUMPY_STATIC_LIB;_HAS_ITERATOR_DEBUGGING;%(PreprocessorDefinitions) + $(BoostRoot)\Include;$(PythonRoot)\include + true + MultiThreadedDebugDLL + + + Windows + true + true + true + true + libboost_numpy37-vc140-mt-gd-1_69.lib;libboost_python37-vc140-mt-gd-1_69.lib + $(Boostroot)\lib;$(PythonRoot)\libs;$(OutDir) + + Level3 @@ -233,6 +287,26 @@ $(Boostroot)\lib;$(PythonRoot)\libs;$(OutDir) + + + Level3 + Use + MaxSpeed + true + true + CORECLR;NDEBUG;_WINDOWS;_USRDLL;PYBRIDGE_EXPORTS;BOOST_USE_STATIC_LIBS;BOOST_PYTHON_STATIC_LIB;BOOST_ALL_NO_LIB;BOOST_NUMPY_STATIC_LIB;%(PreprocessorDefinitions) + $(BoostRoot)\Include;$(PythonRoot)\include + + + Windows + true + true + true + true + libboost_python37-vc140-mt-1_69.lib;libboost_numpy37-vc140-mt-1_69.lib + $(Boostroot)\lib;$(PythonRoot)\libs;$(OutDir) + + @@ -250,8 +324,10 @@ Create Create + Create Create Create + Create Create Create diff --git a/src/NativeBridge/build.sh b/src/NativeBridge/build.sh index e3e759bd..f5d38868 100644 --- a/src/NativeBridge/build.sh +++ b/src/NativeBridge/build.sh @@ -7,8 +7,8 @@ usage() echo "Usage: $0 --configuration " echo "" echo "Options:" - echo " --configuration Build Configuration (DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)" - echo " --pythonver Python version number (3.6, 3.5, 2.7)" + echo " --configuration Build Configuration (DbgLinPy3.7,DbgLinPy3.6,DbgLinPy3.5,DbgLinPy2.7,RlsLinPy3.7,RlsLinPy3.6,RlsLinPy3.5,RlsLinPy2.7,DbgMacPy3.7,DbgMacPy3.6,DbgMacPy3.5,DbgMacPy2.7,RlsMacPy3.7,RlsMacPy3.6,RlsMacPy3.5,RlsMacPy2.7)" + echo " --pythonver Python version number (3.7, 3.6, 3.5, 2.7)" echo " --pythonpath Path to python library." echo " --boostpath Path to boost library." exit 1 @@ -23,8 +23,8 @@ done DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" RootRepo="$DIR/../.." -__configuration=DbgLinPy3.6 -__pythonver=3.6 +__configuration=DbgLinPy3.7 +__pythonver=3.7 __rootBinPath="$RootRepo/x64" __pythonpath="" __boostpath="" diff --git a/src/Platforms/build.csproj b/src/Platforms/build.csproj index 1a86c28e..f68369d9 100644 --- a/src/Platforms/build.csproj +++ b/src/Platforms/build.csproj @@ -5,7 +5,7 @@ Exe netcoreapp2.0 x64 - DbgWinPy3.6;DbgWinPy3.5;DbgWinPy2.7;RlsWinPy3.6;RlsWinPy3.5;RlsWinPy2.7;DbgLinPy3.6;DbgLinPy3.5;DbgLinPy2.7;RlsLinPy3.6;RlsLinPy3.5;RlsLinPy2.7;RlsMacPy3.6 + DbgWinPy3.7;DbgWinPy3.6;DbgWinPy3.5;DbgWinPy2.7;RlsWinPy3.7;RlsWinPy3.6;RlsWinPy3.5;RlsWinPy2.7;DbgLinPy3.7;DbgLinPy3.6;DbgLinPy3.5;DbgLinPy2.7;RlsLinPy3.7;RlsLinPy3.6;RlsLinPy3.5;RlsLinPy2.7;RlsMacPy3.7;RlsMacPy3.6 $(ProjectDir)..\..\x64\$(Configuration)\Platform\ false diff --git a/src/python/docs/sphinx/ci_script/update_all_toc_yml.py b/src/python/docs/sphinx/ci_script/update_all_toc_yml.py index f50efcbb..156d2a22 100644 --- a/src/python/docs/sphinx/ci_script/update_all_toc_yml.py +++ b/src/python/docs/sphinx/ci_script/update_all_toc_yml.py @@ -415,7 +415,8 @@ |:-------------------------:|:-------:|:-----:|:-----:| | 2.7 | Yes | Yes | Yes | | 3.5 | Yes | Yes | Yes | -| 3.6 | Yes | Yes | Yes |""" +| 3.6 | Yes | Yes | Yes | +| 3.7 | Yes | Yes | Yes |""" file_w.write(version_table) writeline = 0 if "../modules/data/FileDataStream.md#readcsv" in line: diff --git a/src/python/docs/sphinx/make.bat b/src/python/docs/sphinx/make.bat index 3864446a..248fa3fe 100644 --- a/src/python/docs/sphinx/make.bat +++ b/src/python/docs/sphinx/make.bat @@ -1,7 +1,7 @@ @ECHO OFF pushd %~dp0 -set PYTHONINTERPRETER=%~dp0..\..\..\..\dependencies\Python3.6\python.exe +set PYTHONINTERPRETER=%~dp0..\..\..\..\dependencies\Python3.7\python.exe set PYTHONPATH=%~dp0..\..\..\..\Python\ set SPHINXOPTS=-j 4 diff --git a/src/python/docs/sphinx/make_yaml.bat b/src/python/docs/sphinx/make_yaml.bat index ad18c09c..e427e150 100644 --- a/src/python/docs/sphinx/make_yaml.bat +++ b/src/python/docs/sphinx/make_yaml.bat @@ -1,6 +1,6 @@ @ECHO ON -set PY=%~dp0..\..\..\..\dependencies\Python3.6\python.exe -set PYS=%~dp0..\..\..\..\dependencies\Python3.6\Scripts +set PY=%~dp0..\..\..\..\dependencies\Python3.7\python.exe +set PYS=%~dp0..\..\..\..\dependencies\Python3.7\Scripts set PYTHONPATH=%~dp0..\..\..\..\python %PYS%\pip install sphinx==1.5.5 %PYS%\pip install sphinx-docfx-yaml diff --git a/src/python/nimbusml.pyproj b/src/python/nimbusml.pyproj index 6a1d221a..910b76ea 100644 --- a/src/python/nimbusml.pyproj +++ b/src/python/nimbusml.pyproj @@ -12,8 +12,8 @@ {888888a0-9f3d-457c-b088-3a5042f75d52} Standard Python launcher nimbusml - Global|VisualStudio|Py3.6 - ..\..\dependencies\Python3.6\python.exe + Global|VisualStudio|Py3.7 + ..\..\dependencies\Python3.7\python.exe False diff --git a/src/python/nimbusml/internal/utils/data_schema.py b/src/python/nimbusml/internal/utils/data_schema.py index 60717bda..5faa0f72 100644 --- a/src/python/nimbusml/internal/utils/data_schema.py +++ b/src/python/nimbusml/internal/utils/data_schema.py @@ -87,7 +87,7 @@ def __init__(self, scol=None, **kwargs): self.type = DataColumn.get_type_mapping().get(dtype, dtype) pos = kwargs.get('pos', 0) length = kwargs.get('length', None) - if isinstance(pos, int): + if isinstance(pos, six.integer_types): if length is None: self.pos = pos else: @@ -186,7 +186,7 @@ def Pos(self): @property def IsVector(self): - return not isinstance(self.pos, int) + return not isinstance(self.pos, six.integer_types) def __eq__(self, other): return self.name == other.name and \ @@ -194,7 +194,7 @@ def __eq__(self, other): self.type == other.type def format_pos(self): - if isinstance(self.pos, int): + if isinstance(self.pos, six.integer_types): return str(self.pos) else: begin = self.pos[0] @@ -235,7 +235,7 @@ def __str__(self): self.name_as_string, self.type, self.format_pos()) def __repr__(self): - if isinstance(self.pos, int): + if isinstance(self.pos, six.integer_types): rpos = self.pos elif len(self.pos) == 1: rpos = self.pos[0] @@ -279,8 +279,8 @@ def __lt__(self, o): """ So that lists of DataColumn can be sorted. """ - o1 = self.pos if isinstance(self.pos, int) else self.pos[0] # tuple - o2 = o.pos if isinstance(o.pos, int) else o.pos[0] # tuple + o1 = self.pos if isinstance(self.pos, six.integer_types) else self.pos[0] # tuple + o2 = o.pos if isinstance(o.pos, six.integer_types) else o.pos[0] # tuple return o1 < o2 @@ -434,7 +434,7 @@ def display_repr(v): subsequent_indent=' ')) def __getitem__(self, i): - if isinstance(i, int): + if isinstance(i, six.integer_types): # not efficient keys = list(self.columns.keys()) return self.columns[keys[i]] @@ -546,7 +546,7 @@ def _rename_columns(df, names): type(names))) columns = list(df.columns) for k, v in names.items(): - if isinstance(k, int): + if isinstance(k, six.integer_types): columns[k] = v elif isinstance(k, tuple): if len(k) != 2: @@ -727,7 +727,7 @@ def clean_name(col): elif isinstance(col, tuple): # multilevel index return col - elif isinstance(col, int): + elif isinstance(col, six.integer_types): # reads a file with no header return "c%d" % col else: @@ -781,7 +781,7 @@ def clean_name(col): names = options.get('names', None) if isinstance(names, dict): - names = set(_ for _ in names if isinstance(_, int)) + names = set(_ for _ in names if isinstance(_, six.integer_types)) elif isinstance(names, list): names = set(range(len(names))) else: @@ -894,7 +894,7 @@ def __init__(self, expr, to=None, cont=None): if not specified (None), the container is assumed to be the previous transform in the pipeline """ - if not isinstance(expr, (str, list, int)): + if not isinstance(expr, (str, list, six.integer_types)): raise TypeError( "expr must be a string, int or a list of string, int.".format( expr)) @@ -963,7 +963,7 @@ def get_cols(expr): self.expr)) else: cols = get_cols(self.expr) - elif isinstance(self.expr, int): + elif isinstance(self.expr, six.integer_types): cols = [str(self.expr)] elif isinstance(self.expr, list): cols = [] diff --git a/src/python/nimbusml/internal/utils/entrypoints.py b/src/python/nimbusml/internal/utils/entrypoints.py index bcdc325d..94510eb5 100644 --- a/src/python/nimbusml/internal/utils/entrypoints.py +++ b/src/python/nimbusml/internal/utils/entrypoints.py @@ -267,22 +267,22 @@ def run( """ code = "" if parallel is not None: - if isinstance(parallel, int): + if isinstance(parallel, six.integer_types): code += "parallel = {} ".format(parallel) else: raise TypeError("parallel is not of 'int' type.") if seed is not None: - if isinstance(seed, int): + if isinstance(seed, six.integer_types): code += "seed = {} ".format(seed) else: raise TypeError("seed is not of 'int' type.") if parallel is not None: - if isinstance(parallel, int): + if isinstance(parallel, six.integer_types): code += "parallel = {} ".format(parallel) else: raise TypeError("parallel is not of 'int' type.") if max_slots is not None: - if isinstance(max_slots, int): + if isinstance(max_slots, six.integer_types): code += "maxSlots = {} ".format(max_slots) else: raise TypeError("max_slots is not of 'int' type.") @@ -320,7 +320,7 @@ def _try_call_bridge( od = call_parameters["data"] vars = "type={0} keys={1}".format( type(od), ','.join(od)) - if isinstance(verbose, int) and verbose >= 2: + if isinstance(verbose, six.integer_types) and verbose >= 2: raise BridgeRuntimeError( "{0}.\n--CODE--\n{1}\n--GRAPH--\n{2}\n--DATA--\n{3}" "\n--\nconcatenated={4}".format( @@ -441,7 +441,7 @@ def remove_multi_level_index(c): nimbusml_path = os.path.join(os.path.dirname(__file__), "..", "libs") nimbusml_path = os.path.abspath(nimbusml_path) - call_parameters['verbose'] = try_set(verbose, False, int) + call_parameters['verbose'] = try_set(verbose, False, six.integer_types) call_parameters['graph'] = try_set( 'graph = {%s} %s' % (str(self), code), False, str) @@ -452,7 +452,7 @@ def remove_multi_level_index(c): call_parameters['dotnetClrPath'] = try_set(get_clr_path(), True, str) if random_state: - call_parameters['seed'] = try_set(random_state, False, int) + call_parameters['seed'] = try_set(random_state, False, six.integer_types) ret = self._try_call_bridge( px_call, call_parameters, diff --git a/src/python/nimbusml/internal/utils/utils.py b/src/python/nimbusml/internal/utils/utils.py index 848b76b8..a63452b6 100644 --- a/src/python/nimbusml/internal/utils/utils.py +++ b/src/python/nimbusml/internal/utils/utils.py @@ -160,7 +160,7 @@ def trace(func, *args, **kwargs): verbose = 0 if 'verbose' in kwargs: verbose = kwargs['verbose'] - if not isinstance(verbose, int): + if not isinstance(verbose, six.integer_types): raise TypeError( "Misaligned parameters. verbose must be int " "not '{0}': {1}".format( @@ -203,7 +203,7 @@ def wrapper(*args, **kwargs): verbose = 0 if 'verbose' in kwargs: verbose = kwargs['verbose'] - if not isinstance(verbose, int): + if not isinstance(verbose, six.integer_types): raise TypeError( "Misaligned parameters. verbose must be int " "not '{0}': {1}".format( diff --git a/src/python/nimbusml/model_selection/cv.py b/src/python/nimbusml/model_selection/cv.py index 746f8aee..532bed87 100644 --- a/src/python/nimbusml/model_selection/cv.py +++ b/src/python/nimbusml/model_selection/cv.py @@ -5,6 +5,7 @@ import inspect import time +import six from pandas import DataFrame @@ -319,7 +320,7 @@ def _process_split_start(self, split_start): 'String value for split_start should be either ' '"before_transforms" or "after_transforms"') - if isinstance(split_start, int): + if isinstance(split_start, six.integer_types): try: nodes[split_start] except IndexError: diff --git a/src/python/nimbusml/pipeline.py b/src/python/nimbusml/pipeline.py index 2ee42241..1d286a05 100644 --- a/src/python/nimbusml/pipeline.py +++ b/src/python/nimbusml/pipeline.py @@ -1589,7 +1589,7 @@ def __delitem__(self, index): "clone it and then modify.") if len(self) == 0: raise IndexError("Pipeline is empty.") - if isinstance(index, int): + if isinstance(index, six.integer_types): del self.steps[index] elif isinstance(index, str): res = [] @@ -1660,7 +1660,7 @@ def __getitem__(self, index): """ if len(self) == 0: raise IndexError("Pipeline is empty.") - if isinstance(index, int): + if isinstance(index, six.integer_types): return self.steps[index] elif isinstance(index, str): res = [] diff --git a/src/python/nimbusml/tests/ensemble/test_lightgbmclassifier.py b/src/python/nimbusml/tests/ensemble/test_lightgbmclassifier.py index ee1e7ad2..0c31c9ff 100644 --- a/src/python/nimbusml/tests/ensemble/test_lightgbmclassifier.py +++ b/src/python/nimbusml/tests/ensemble/test_lightgbmclassifier.py @@ -39,9 +39,9 @@ def test_lightgbmclassifier(self): X_train = texttransform.fit_transform(X_train, max_slots=5000) X_test = texttransform.transform(X_test, max_slots=5000) - mymodel = LightGbmClassifier().fit(X_train, y_train) + mymodel = LightGbmClassifier().fit(X_train, y_train, verbose=0) scores = mymodel.predict(X_test) - accuracy = np.mean(y_test == [i for i in scores])[0] + accuracy = np.mean(y_test.values.ravel() == scores.values) assert_greater( accuracy, 0.58, diff --git a/src/python/nimbusml/tests/naive_bayes/test_naivebayesclassifier.py b/src/python/nimbusml/tests/naive_bayes/test_naivebayesclassifier.py index 3aa288b7..4b414c38 100644 --- a/src/python/nimbusml/tests/naive_bayes/test_naivebayesclassifier.py +++ b/src/python/nimbusml/tests/naive_bayes/test_naivebayesclassifier.py @@ -40,7 +40,7 @@ def test_naivebayesclassifier(self): mymodel.fit(X_train, y_train) scores = mymodel.predict(X_test) - accuracy = np.mean(y_test == [i for i in scores])[0] + accuracy = np.mean(y_test.values.ravel() == scores.values) assert_greater( accuracy, 0.5, diff --git a/src/python/nimbusml/tests/scikit/test_uci_adult_scikit.py b/src/python/nimbusml/tests/scikit/test_uci_adult_scikit.py index 3a031443..380c1623 100644 --- a/src/python/nimbusml/tests/scikit/test_uci_adult_scikit.py +++ b/src/python/nimbusml/tests/scikit/test_uci_adult_scikit.py @@ -106,14 +106,14 @@ def test_pickle_predictor(self): ftree = FastTreesBinaryClassifier().fit(X_train, y_train) scores = ftree.predict(X_test) - accu1 = np.mean(y_test == [i for i in scores])[0] + accu1 = np.mean(y_test.values.ravel() == scores.values) # Unpickle model and score. We should get the exact same accuracy as # above s = pickle.dumps(ftree) ftree2 = pickle.loads(s) scores2 = ftree2.predict(X_test) - accu2 = np.mean(y_test == [i for i in scores2])[0] + accu2 = np.mean(y_test.values.ravel() == scores2.values) assert_equal( accu1, accu2, @@ -124,7 +124,7 @@ def test_pickle_transform(self): (X_train, y_train) = get_X_y(train_file, label_column, sep=',', features=selected_features) - cat = (OneHotVectorizer() << ['age']).fit(X_train) + cat = (OneHotVectorizer() << ['age']).fit(X_train, verbose=0) out1 = cat.transform(X_train) # Unpickle transform and generate output. @@ -153,14 +153,14 @@ def test_pickle_pipeline(self): pipe.fit(X_train, y_train) scores = pipe.predict(X_test) - accu1 = np.mean(y_test == [i for i in scores])[0] + accu1 = np.mean(y_test.values.ravel() == scores.values) # Unpickle model and score. We should get the exact same accuracy as # above s = pickle.dumps(pipe) pipe2 = pickle.loads(s) scores2 = pipe2.predict(X_test) - accu2 = np.mean(y_test == [i for i in scores2])[0] + accu2 = np.mean(y_test.values.ravel() == scores2.values) assert_equal( accu1, accu2, @@ -178,17 +178,17 @@ def test_pickle_pipeline_unnamed(self): cat = OneHotVectorizer() << 'age' ftree = FastTreesBinaryClassifier() pipe = nimbusmlPipeline([cat, ftree]) - pipe.fit(X_train, y_train) + pipe.fit(X_train, y_train, verbose=0) scores = pipe.predict(X_test) - accu1 = np.mean(y_test == [i for i in scores["PredictedLabel"]])[0] + accu1 = np.mean(y_test.values.ravel() == scores["PredictedLabel"].values) # Unpickle model and score. We should get the exact same accuracy as # above s = pickle.dumps(pipe) pipe2 = pickle.loads(s) scores2 = pipe2.predict(X_test) - accu2 = np.mean(y_test == [i for i in scores2["PredictedLabel"]])[0] + accu2 = np.mean(y_test.values.ravel() == scores2["PredictedLabel"].values) assert_equal( accu1, accu2, @@ -211,14 +211,14 @@ def test_pickle_pipeline_and_nimbusml_pipeline(self): skpipe.fit(X_train, y_train) scores = skpipe.predict(X_test) - accu1 = np.mean(y_test == [i for i in scores["PredictedLabel"]])[0] + accu1 = np.mean(y_test.values.ravel() == scores["PredictedLabel"].values) # Unpickle model and score. We should get the exact same accuracy as # above s = pickle.dumps(skpipe) pipe2 = pickle.loads(s) scores2 = pipe2.predict(X_test) - accu2 = np.mean(y_test == [i for i in scores2["PredictedLabel"]])[0] + accu2 = np.mean(y_test.values.ravel() == scores2["PredictedLabel"].values) assert_equal( accu1, accu2, diff --git a/src/python/setup.py b/src/python/setup.py index 8d12d11d..213acaa2 100644 --- a/src/python/setup.py +++ b/src/python/setup.py @@ -77,6 +77,7 @@ 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], # What does your project relate to? @@ -110,7 +111,7 @@ # $ pip install -e .[dev,test] extras_require={ 'tests': [ - 'nose>=1.3', 'pytest', + 'nose>=1.3', 'pytest>=4.4.0', 'graphviz', 'imageio', ], 'utils': ['graphviz', 'imageio'], @@ -130,10 +131,10 @@ 'jupyter_client>=4.4.0', 'nbconvert>=4.2.0', 'nose>=1.3', - 'pytest', + 'pytest>=4.4.0', ], - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.7.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.8.*', # If there are data files included in your packages that need to be # installed, specify them here. If using Python 2.6 or less, diff --git a/src/python/setup.py.in b/src/python/setup.py.in index b4cd512c..07f92fe1 100644 --- a/src/python/setup.py.in +++ b/src/python/setup.py.in @@ -77,6 +77,7 @@ setup( 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', ], # What does your project relate to? @@ -111,7 +112,7 @@ setup( # $ pip install -e .[dev,test] extras_require={ 'tests': [ - 'nose>=1.3', 'pytest', + 'nose>=1.3', 'pytest>=4.4.0', 'graphviz', 'imageio', ], 'utils': ['graphviz', 'imageio'], @@ -131,10 +132,10 @@ setup( 'jupyter_client>=4.4.0', 'nbconvert>=4.2.0', 'nose>=1.3', - 'pytest', + 'pytest>=4.4.0', ], - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.7.*', + python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <3.8.*', # If there are data files included in your packages that need to be # installed, specify them here. If using Python 2.6 or less,