Quality of life (#50)

* updated requirements.txt according to GRIMM's instructions

* added launch configuration and build tasks for VS Code

* updated build scripts and documentation
This commit is contained in:
David Pierron
2023-05-19 07:16:38 +02:00
committed by GitHub
parent bca47d63d6
commit e8bd6b2972
6 changed files with 110 additions and 2 deletions

View File

@@ -1,3 +1,40 @@
# Install a development environment
## Install VSCode
Download and install VSCode: https://code.visualstudio.com/
VS Code is a free, open source, cross-platform code editor. It is a great tool for editing and debugging python code. It also has a built-in terminal that can be used to run commands.
## Install python
If using VSCode, you can install the Python extension to get started: [VS Marketplace Link](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
If not, you may need to install python 3.8.5. If you are using Windows, you can download it here: https://www.python.org/downloads/release/python-385/
## Create a python virtual environment
If using VSCode, you can use the ">Python: create environment" command.
If not, run the following command in the root of the project: `python -m venv .\Generator\venv`
## Install python dependencies
If using VSCode, you can use the ">Run task: " command and choose the "Install the Python requirements" task.
If not, type `install-requirements.bat` in a terminal.
## Build the mission generator
If using VSCode, you can use the ">Run task: " command and choose the "Build the Mission Generator" task.
If not, type `build.bat` in a terminal.
## Run the mission generator
Using VS Code, you can use the provided launch configuration to run the mission generator.
Otherwise, you can run the following command in a terminal: `python .\Generator\MissionGenerator.py`
# Building the exe with build.bat
**Use build.bat to compile the UI files and build the exe.**

View File

@@ -1,4 +1,15 @@
call .\venv\Scripts\activate.bat
IF EXIST ".\venv" (
call .\venv\Scripts\activate.bat
) ELSE (
IF EXIST "..\.venv" (
rem try to activate venv from root directory (VS Code default)
call ..\.venv\Scripts\activate.bat
) ELSE (
echo "venv not found. Please create a virtual environment and activate it."
pause >nul
exit
)
)
echo activated python venv.
pyuic5 -x MissionGeneratorUI.ui -o MissionGeneratorUI.py
@@ -10,4 +21,6 @@ echo compiled ui resource files.
echo building exe with pyinstaller...
pyinstaller MissionGenerator.spec --distpath ..\ --clean
pause >nul
if not %1=="-nopause" (
pause >nul
)

View File

@@ -0,0 +1,20 @@
IF EXIST ".\venv" (
call .\venv\Scripts\activate.bat
) ELSE (
IF EXIST "..\.venv" (
rem try to activate venv from root directory (VS Code default)
call ..\.venv\Scripts\activate.bat
) ELSE (
echo "venv not found. Please create a virtual environment and activate it."
pause >nul
exit
)
)
echo activated python venv.
pip install -r requirements.txt
echo installed python requirements.
if not %1=="-nopause" (
pause >nul
)

Binary file not shown.