Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Use environment markers instead of modifying _install_requires #238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ if /i [%1] == [DbgWinPy2.7] (

:Build
:: Install dotnet SDK version, see https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
echo Installing dotnet SDK ...
echo Installing dotnet SDK ...
powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Version 2.1.701 -InstallDir ./cli"

set _dotnetRoot=%__currentScriptDir%cli
Expand All @@ -188,10 +188,10 @@ echo "Building DotNet Bridge ... "
echo "#################################"
set _dotnet=%_dotnetRoot%\dotnet.exe

if "%SkipDotNetBridge%" == "False" (
if "%SkipDotNetBridge%" == "False" (
call "%_dotnet%" build -c %Configuration% -o "%BuildOutputDir%%Configuration%" --force "%__currentScriptDir%src\DotNetBridge\DotNetBridge.csproj"
)
if "%BuildDotNetBridgeOnly%" == "True" (
if "%BuildDotNetBridgeOnly%" == "True" (
exit /b %ERRORLEVEL%
)
call "%_dotnet%" build -c %Configuration% --force "%__currentScriptDir%src\Platforms\build.csproj"
Expand Down Expand Up @@ -235,19 +235,19 @@ echo "#################################"
:: Download & unzip Python
if not exist "%PythonRoot%\.done" (
md "%PythonRoot%"
echo Downloading python zip ...
echo Downloading python zip ...
powershell -command "& {$wc = New-Object System.Net.WebClient; $wc.DownloadFile('%PythonUrl%', '%DependenciesDir%python.zip');}"
echo Extracting python zip ...
echo Extracting python zip ...
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%DependenciesDir%python.zip', '%PythonRoot%'); }"
echo.>"%PythonRoot%\.done"
del %DependenciesDir%python.zip
)
:: Download & unzip Boost
if not exist "%BoostRoot%\.done" (
md "%BoostRoot%"
echo Downloading boost zip ...
echo Downloading boost zip ...
powershell -command "& {$wc = New-Object System.Net.WebClient; $wc.DownloadFile('%BoostUrl%', '%DependenciesDir%boost.zip');}"
echo Extracting boost zip ...
echo Extracting boost zip ...
powershell.exe -nologo -noprofile -command "& { Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('%DependenciesDir%boost.zip', '%BoostRoot%'); }"
echo.>"%BoostRoot%\.done"
del %DependenciesDir%boost.zip
Expand Down Expand Up @@ -336,7 +336,7 @@ if %PythonVersion% == 3.7 (
echo Generating low-level Python API from mainifest.json ...
call "%PythonExe%" -m pip install --upgrade autopep8 autoflake isort jinja2
cd "%__currentScriptDir%src\python"
call "%PythonExe%" tools\entrypoint_compiler.py --check_manual_changes
call "%PythonExe%" tools\entrypoint_compiler.py --check_manual_changes
if errorlevel 1 (
echo Codegen check failed. Try running tools/entrypoint_compiler.py --check_manual_changes to find the problem.
goto :Exit_Error
Expand Down Expand Up @@ -367,7 +367,7 @@ if "%DebugBuild%" == "True" (
copy "%BuildOutputDir%%Configuration%\pybridge.pdb" "%__currentScriptDir%src\python\nimbusml\internal\libs\"
)

call "%PythonExe%" -m pip install --upgrade "wheel>=0.31.0"
call "%PythonExe%" -m pip install --upgrade "wheel>=0.31.0" "setuptools>=44.0.0"
cd "%__currentScriptDir%src\python"
call "%PythonExe%" setup.py bdist_wheel --python-tag %PythonTag% --plat-name win_amd64
cd "%__currentScriptDir%"
Expand Down Expand Up @@ -400,7 +400,7 @@ if "%InstallPythonPackages%" == "True" (
call "%PythonExe%" -m pip install "scikit-learn==0.19.2"
)

if "%RunTests%" == "False" (
if "%RunTests%" == "False" (
goto :Exit_Success
)

Expand Down Expand Up @@ -463,4 +463,4 @@ set PrevErrorLevel=%ERRORLEVEL%
:: the build script was trying to replace the existing dotnet
:: binaries which were sometimes still in use.
call "%_dotnet%" build-server shutdown
exit /b %PrevErrorLevel%
exit /b %PrevErrorLevel%
14 changes: 5 additions & 9 deletions src/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,13 @@
'pandas>=0.22',
'scipy>=0.18',
'scikit-learn>0.19.0',
# dotnetcore2 package is available only for python 3.x
"dotnetcore2>=2.1.2;python_version>='3.0'",
"decorator;python_version<'3.0'",
"enum;python_version<'3.0'",
"funcsigs>=1.0.2;python_version<'3.0'",
]

# dotnetcore2 package is available only for python 3.x
if sys.version_info.major == 3:
_install_requires.append('dotnetcore2>=2.1.2')

if sys.version_info[0:2] == (2,7):
_install_requires.append('decorator')
_install_requires.append('enum')
_install_requires.append('funcsigs>=1.0.2')

setup(
name='nimbusml',

Expand Down