Running this project:
- Clone this repository by running the following command in the terminal:
git clone https://github.com/estebanpuyanas/StockPortFolioManager.git
Alternatively, you can clone the repository by inserting the repository's .git
url in your IDE's repository cloning option.
- Open the project in VS Code
Create the virtual enviornment by executing the following command in the root folder of the project:
python3 -m venv .venv
After this, look for the .code-workspace
file. This file configures the virtual environment to activate automatically when you open a terminal in VSCode. If you are working from a Mac/Linux machine make sure the following line in the .code-workspace
file is uncommented:
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
.
Otherwise, if working from a Windows make sure the following line is uncommented and comment out the Mac/Linux line:
"python.defaultInterpreterPath": "${workspaceFolder}\\.venv\\Scripts\\python.exe"
Afterwards, save the file, and click on the open workspace
button to allow the automatic venv activation configuration.
If for any reason the virtual environment is not activated automatically, you can activate it manually:
- Windows:
\.venv\Scripts\activate
- Mac/Linux:
source .venv/bin/activate
Note: If the project will not be ran from VS Code the venv will have to be manually activated every single time the project is opened/ran
Once activated, the terminal should show: (.venv) username$
Commiting to this project:
- Go to develop branch:
git checkout develop
- Fetch & pull:
git fetch
&git pull origin develop
- Make a new branch from develop:
git checkout -b <feature-name>
Once you have finished working on your feature and you have successfully tested it, commit and push it to be able to create a pull request (PR) to merge into develop branch once approved:
- Fetch & pull:
git fetch
&git pull origin develop
- Stage files to commit:
git add .
- Commit files:
git commit -m "commit message"
. In commit messages please give a brief general overview of the commit. - Push the commit:
git push -u origin <branch-name>
Now, in GitHub, create a PR to merge the branch into develop. Make sure you title the PR appropriately and be as detailed as possible in the description box of the PR. Once the PR has been approved and merged, the branch will be automatically deleted remotely, so ensure it is deleted locally as well. That can be done manually or by doing the following:
- Fetch:
git fetch
- Pull:
git pull origin develop
When creating branches from develop
to edit/fix/add features, please ensure that the branch name follows this convention:
feat:<project-folder-name branch-work>
.
For example, If you were to create a branch to create tests for backend API calls, the branch should be called: feat:backend-API-Calls-Tests
Similarly, if you were creating the frotend UI for user login, the branch should be called: feat:frontend-User-login-UI
Not all PR branches will have a clear cut name that follows this format, but follow this convetion whenever possible. It helps mantain a neat commit history and understanding of the project's progress/state.
Created by Qin Davis & Esteban Puyana.