-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-windows-pip.bat
More file actions
73 lines (64 loc) · 2.03 KB
/
build-windows-pip.bat
File metadata and controls
73 lines (64 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@echo off
REM Build script for creating Windows executable with Nuitka
REM Run this on Windows (or in VirtualBox Windows VM)
echo ========================================
echo Building dbf_to_sqlserver.exe with Nuitka
echo ========================================
echo.
REM Check if Python is available
python --version >nul 2>&1
if errorlevel 1 (
echo ERROR: Python is not installed or not in PATH
exit /b 1
)
echo Step 1: Checking dependencies...
python -c "import nuitka" >nul 2>&1
if errorlevel 1 (
echo ERROR: Nuitka is not installed
echo Please run: pip install -r requirements.txt -r requirements-build.txt
exit /b 1
)
echo Step 2: Cleaning previous build artifacts...
if exist "dbf_to_sqlserver.dist" rmdir /s /q dbf_to_sqlserver.dist
if exist "dbf_to_sqlserver.build" rmdir /s /q dbf_to_sqlserver.build
if exist "dbf_to_sqlserver.onefile-build" rmdir /s /q dbf_to_sqlserver.onefile-build
if exist "dbf_to_sqlserver.exe" del /f /q dbf_to_sqlserver.exe
echo Step 3: Running Nuitka compilation...
echo This may take several minutes...
echo.
python -m nuitka ^
--standalone ^
--onefile ^
--no-deployment-flag=self-execution ^
--windows-console-mode=force ^
--enable-plugin=anti-bloat ^
--assume-yes-for-downloads ^
--follow-imports ^
--include-package=sqlalchemy.dialects.mssql ^
--include-package=dbfread ^
--include-module=pymssql ^
--include-module=pyodbc ^
--nofollow-import-to=pytest ^
--nofollow-import-to=setuptools ^
--nofollow-import-to=distutils ^
--nofollow-import-to=sqlalchemy.testing ^
--output-filename=dbf_to_sqlserver.exe ^
dbf_to_sqlserver.py
if errorlevel 1 (
echo.
echo ERROR: Build failed!
exit /b 1
)
echo.
echo ========================================
echo Build completed successfully!
echo ========================================
echo.
echo Executable location: dbf_to_sqlserver.exe
echo File size:
dir dbf_to_sqlserver.exe | findstr "dbf_to_sqlserver.exe"
echo.
echo Test the executable with:
echo dbf_to_sqlserver.exe --help
echo.
pause