Skip to content

Commit

Permalink
fixed patch-win task
Browse files Browse the repository at this point in the history
  • Loading branch information
tadeubas committed Apr 24, 2024
1 parent 80f121f commit 5becdbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
23 changes: 3 additions & 20 deletions .ci/patch-pyinstaller-kivy-hook.ps1
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
#Requires -Version 7.3

[String]$PATCHURL = "https://raw.githubusercontent.com/ikus060/kivy/21c7110ee79f355d6a42da0a274d2426b1e18665/kivy/tools/packaging/pyinstaller_hooks/__init__.py"
Write-Verbose "env PATCHURL=$PATCHURL"

[String]$PYENV_PATH = poetry env info --path
Write-Verbose "env PYENV_PATH=$PYENV_PATH"

[String]$PYENV_VERSION = python -c 'import sys; t= sys.version_info[:]; print(f"{t[0]}.{t[1]}")'
[String]$PYENV_VERSION = python -c "import sys; t= sys.version_info[:]; print(f'{t[0]}.{t[1]}')"
Write-Verbose "env PYENV_VERSION=$PYENV_VERSION"

[String]$PYHOOK_PATH = "site-packages/kivy/tools/packaging/pyinstaller_hooks/__init__.py"
[String]$FULL_PATH = "$PYENV_PATH/lib/python$PYENV_VERSION/$PYHOOK_PATH"
[String]$FULL_PATH = "$PYENV_PATH/Lib/site-packages/kivy/tools/packaging/pyinstaller_hooks"
Write-Verbose "env FULL_PATH=$FULL_PATH"

[String]$GIT_PATH = "C:\Program Files\Git\bin"
Write-Verbose "env GIT_PATH=$GIT_PATH"

Write-Verbose "RUN wget $PATCHURL -OutFile pyinstaller_hook_patch.py"
wget $PATCHURL -OutFile pyinstaller_hook_patch.py

Write-Verbose "RUN $GIT_PATH\diff.exe -u $FULL_PATH pyinstaller_hook_patch.py > pyinstaller_hook.patch"
$GIT_PATH\diff.exe -u $FULL_PATH pyinstaller_hook_patch.py > pyinstaller_hook.patch

Write-Verbose "RUN $GIT\patch.exe $FULL_PATH < pyinstaller_hook.patch"
$GIT_PATH\patch.exe $FULL_PATH < pyinstaller_hook.patch

Write-Verbose "RUN Remove-Item -Path pyinstaller_hook_patch.py"
Remove-Item -Path pyinstaller_hook_patch.py

Write-Verbose "RUN Remove-Item -Path pyinstaller_hook.patch"
Remove-Item -Path pyinstaller_hook.patch
Copy-Item pyinstaller_hook_patch.py -Destination "$FULL_PATH"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ coverage-unit = "pytest --cache-clear --cov=src/utils/constants --cov=src/utils/
coverage-e2e = "pytest --cov-append --cov=src/app --cov-report xml ./e2e"
coverage = ["coverage-unit", "coverage-e2e"]
patch-nix = "sh .ci/patch-pyinstaller-kivy-hook.sh"
patch-win = "pwsh .ci/patch-pyinstaller-kivy-hook.ps1"
patch-win = "powershell.exe '.ci/patch-pyinstaller-kivy-hook.ps1' "
build = "python scripts/build.py"
lint.sequence = [
{ cmd = "pylint --rcfile .pylint/src ./src" },
Expand Down

0 comments on commit 5becdbd

Please sign in to comment.