21 Star 83 Fork 47

云金杞/backtrader

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
install_win.bat 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
cloudQuant 提交于 2025-01-25 15:55 +08:00 . add install_win.bat
@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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yunjinqi/backtrader.git
git@gitee.com:yunjinqi/backtrader.git
yunjinqi
backtrader
backtrader
master

搜索帮助