-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #19. Issue when generating Maven package from Python as a script
- Loading branch information
Showing
11 changed files
with
128 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<# | ||
.Synopsis | ||
Sets up Python Virtual Environment. | ||
#> | ||
|
||
try { | ||
$p = python --version | ||
} catch { | ||
throw '**ERROR**: python is missing, please install it before running this build script' | ||
} | ||
|
||
try { | ||
$p = pip --version | ||
} catch { | ||
throw '**ERROR**: pip is missing, please install it before running this build script' | ||
} | ||
|
||
if (!(Test-Path -Path .venv)) { | ||
Write-Host "💻 Creating Python virtual environment" | ||
python -m venv .venv | ||
if($LASTEXITCODE -ne 0) { | ||
throw "**ERROR**: could not create Python Virtual Environment." | ||
} | ||
} | ||
|
||
Write-Host "💡 Making sure Python Virtual Environment is active" | ||
.\.venv\Scripts\Activate.ps1 | ||
if($LASTEXITCODE -ne 0) { | ||
throw "**ERROR**: could not activate Python Virtual Environment." | ||
} | ||
|
||
Write-Host "☁️ Installing requirements" | ||
pip install -r requirements-build.txt | ||
if($LASTEXITCODE -ne 0) { | ||
throw "**ERROR**: error installing required packages" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/sh | ||
|
||
# This script sets up the Python Virtual Environment to install dependencies | ||
|
||
if hash python3 | ||
then | ||
echo "🐍 python3 is installed" | ||
|
||
if hash pip3 | ||
then | ||
echo "📦 pip is installed" | ||
else | ||
echo "**ERROR**: python pip3 not found, please install pip3" && exit 1 | ||
fi | ||
|
||
if [ ! -f ".venv/bin/activate" ]; then | ||
echo "💻 Creating Python virtual environment" | ||
python3 -m venv .venv | ||
if [ $? -ne 0 ]; then | ||
echo "**ERROR**: could not create Python Virtual Environment." && exit 1 | ||
fi | ||
fi | ||
|
||
echo "💡 Making sure Python Virtual Environment is active" | ||
. .venv/bin/activate | ||
if [ $? -ne 0 ]; then | ||
echo "**ERROR**: could not activate Python Virtual Environment." && exit 1 | ||
fi | ||
|
||
echo "☁️ Installing requirements" | ||
python3 -m pip install -r requirements-build.txt | ||
if [ $? -ne 0 ]; then | ||
echo "**ERROR**: error installing required packages" && exit 1 | ||
fi | ||
exit 0 | ||
else | ||
echo "**ERROR**: python3 is missing, please install it before running this build script" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters