代码拉取完成,页面将自动刷新
@echo off
SETLOCAL
:: Set path variables
SET BACKTRADER_PATH=./backtrader
SET BUILD_DIR=build
SET EGG_INFO_DIR=backtrader.egg-info
SET BENCHMARKS_DIR=.benchmarks
:: Install dependencies from requirements.txt
echo Installing dependencies from requirements.txt...
pip install -U -r requirements.txt
IF %ERRORLEVEL% NEQ 0 (
echo Failed to install dependencies. Please check the requirements.txt file.
exit /b 1
)
:: Switch to the parent directory
echo Switching to the parent directory...
cd ..
IF %ERRORLEVEL% NEQ 0 (
echo Failed to switch directory.
exit /b 1
)
:: Install the backtrader package
echo Installing the backtrader package...
pip install -U --no-build-isolation %BACKTRADER_PATH%
IF %ERRORLEVEL% NEQ 0 (
echo Failed to install the backtrader package.
exit /b 1
)
:: Delete intermediate build and egg-info directories
echo Deleting intermediate files...
cd backtrader
IF EXIST %BUILD_DIR% (
rmdir /s /q %BUILD_DIR%
echo Deleted %BUILD_DIR% directory.
)
IF EXIST %EGG_INFO_DIR% (
rmdir /s /q %EGG_INFO_DIR%
echo Deleted %EGG_INFO_DIR% directory.
)
:: Run backtrader tests with 4 parallel processes
echo Running backtrader tests...
cd ..
pytest %BACKTRADER_PATH%/tests -n 4
IF %ERRORLEVEL% NEQ 0 (
echo Test cases failed.
exit /b 1
)
:: Delete the .benchmarks directory generated by pytest
IF EXIST %BENCHMARKS_DIR% (
rmdir /s /q %BENCHMARKS_DIR%
echo Deleted %BENCHMARKS_DIR% directory.
)
cd ./backtrader
:: Script completed
echo Script execution completed!
:: Pause to view the output
pause
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。