| 1 |
@echo off |
| 2 |
REM This script was copied from PythonQwt project |
| 3 |
REM ====================================================== |
| 4 |
REM Package build script |
| 5 |
REM ====================================================== |
| 6 |
REM Licensed under the terms of the MIT License |
| 7 |
REM Copyright (c) 2020 Pierre Raybaut |
| 8 |
REM (see PythonQwt LICENSE file for more details) |
| 9 |
REM ====================================================== |
| 10 |
call %~dp0utils GetScriptPath SCRIPTPATH |
| 11 |
call %FUNC% GetLibName LIBNAME |
| 12 |
call %FUNC% GetModName MODNAME |
| 13 |
call %FUNC% SetPythonPath |
| 14 |
call %FUNC% UsePython |
| 15 |
call %FUNC% GetVersion DATALAB_VERSION |
| 16 |
|
| 17 |
set REPODIR=%SCRIPTPATH%\.. |
| 18 |
|
| 19 |
@REM Clone repository in a temporary directory |
| 20 |
set CLONEDIR=%REPODIR%\..\%LIBNAME%-tempdir |
| 21 |
if exist %CLONEDIR% ( rmdir /s /q %CLONEDIR% ) |
| 22 |
git clone -l -s . %CLONEDIR% |
| 23 |
|
| 24 |
pushd %CLONEDIR% |
| 25 |
@REM Compile translations |
| 26 |
%PYTHON% -m guidata.utils.translations compile --name datalab --directory . |
| 27 |
@REM Build source package |
| 28 |
%PYTHON% -m build --sdist |
| 29 |
@REM Build wheel package with PDF documentation embedded |
| 30 |
mkdir %MODNAME%\data\doc |
| 31 |
copy %REPODIR%\%MODNAME%\data\doc\*.pdf %MODNAME%\data\doc |
| 32 |
%PYTHON% -m build --wheel |
| 33 |
popd |
| 34 |
|
| 35 |
if not exist %REPODIR%\dist ( mkdir %REPODIR%\dist ) |
| 36 |
copy %CLONEDIR%\dist\*.whl %REPODIR%\dist |
| 37 |
copy %CLONEDIR%\dist\*.tar.gz %REPODIR%\dist |
| 38 |
|
| 39 |
rmdir /s /q %CLONEDIR% |
| 40 |
call %FUNC% EndOfScript |