You'll need the following tools installed on your local machine:
- A machine with Windows 10. Alternatively, you can create a Windows 10 Virtual Machine on Azure.
- The Windows Subsystem for Linux (WSL).
- Visual Studio Code
- The VS Code Remote - WSL Extension for VS Code
- The Python extension for VS Code
- Ubuntu 18.04 for WSL from the Microsoft Store
- Open a WSL terminal window (from the start menu or by typing
wsl
from a Windows terminal). - Navigate (
cd
command) to a folder where you can clone a project in. - Clone this repo by typing:
git clone https://github.com/luabud/TheCatSaidNo.git
- Navigate to the folder (
cd TheCatSaidNo
) - Type
code .
to open this folder in VS Code - Open the
app.py
file to activate the Python extension
-
Open the terminal in VS Code (Ctrl + `)
-
Install python3-venv by typing:
sudo apt-get install python3-venv
-
Create a virtual environment by typing:
python3 -m venv env
-
If a notification prompt is displayed asking if you want to select this newly created environment, click on "Yes". Otherwise, click on the Python information displayed on the status bar, located on bottom left of the screen
-
Create a new terminal to activate the virtual environment (Ctrl + Shift + `)
-
Install the dependencies:
python -m pip install -r requirements.txt
- Press F5 to start a debug session, and select "Flask" from the configuration options.
- Ctrl + Click on the link that is displayed on the terminal to access the application.
- Open the Debug Console in VS Code (next to the Terminal) and enter:
import sys print(sys.platform)
- Open the command palette (Ctrl + Shift + P or Command + Shift + P if you're on macOS)
- Run the "Python: Configure Tests" command
- Select "pytest" and then "." (root directory)
- Click on the test beaker icon on the activity bar, on the left side.
- Click on the "Run All Tests" icon on the top left.