From 41c6062ff9d2faf0f059e26b8f22890b537875b8 Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:26:41 +0200 Subject: [PATCH 1/3] Added instructions to run tests for the project --- CONTRIBUTING.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1becb0b0a1..9e0c60f807 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ - Python 3.6 - Git CLI installed -- Python, pip and git are all available as command-line commands (add to path if needed) +- Python, pip and git are all available as command-line commands (add to the path if needed) Virtual environment will be created in *PyfaEnv* folder. Project will be cloned and run from the *PyfaDEV* folder. Separate virtual environment will be created so required libraries won't clutter the main python installation. @@ -17,12 +17,12 @@ Clone the repository git clone PyfaDEV ``` -Create virtual environment +Create the virtual environment ``` python -m venv PyfaEnv ``` -Activate virtual environment +Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat @@ -52,11 +52,11 @@ python PyfaDEV\pyfa.py Install PyCharm / Other IntelliJ product with Python plugin -After launching select *Check out from Version Control* -> *GIt* +After launching - select *Check out from Version Control* -> *GIt* ![welcome](https://user-images.githubusercontent.com/54093496/66862580-d8edab00-ef99-11e9-94e2-e93d7043e620.png) -Login to GitHub, paste repo URL and seect the folder to which to clone the project, press *Clone*. +Login to GitHub, paste the repo URL and select the folder to which to clone the project into, press *Clone*. ![Clone](https://user-images.githubusercontent.com/54093496/66862748-38e45180-ef9a-11e9-9f68-4903baf47385.png) @@ -68,7 +68,7 @@ Press on options and add new virtual environment. ![venv](https://user-images.githubusercontent.com/54093496/66862833-67622c80-ef9a-11e9-94fa-47cca0158d29.png) -Open project tree view and double-click on *requirements.txt*. Press *Install requirements*. Install all requirements. +Open project tree view and double-click on the *requirements.txt*. Press *Install requirements*. Install all requirements. ![Reqs](https://user-images.githubusercontent.com/54093496/66862870-7a74fc80-ef9a-11e9-9b18-e64be42c49b8.png) @@ -76,4 +76,27 @@ Create new *Run Configuration*. Set correct *Script path* and *Python interprete ![Run configuraion](https://user-images.githubusercontent.com/54093496/66862970-b4460300-ef9a-11e9-9fb4-20e24759904b.png) -Test that the project is starting properly. \ No newline at end of file +Check that the project is starting properly. + +## Running tests + +Switch to the proper virtual environment +``` +For cmd.exe: PyfaEnv\scripts\activate.bat +For bash: source /bin/activate +``` + +Install pytest +``` +pip install pytest +``` + +Switch to pyfa directory. + +Run tests (any will do) +``` +python -m pytest +py.test +``` + +More information on tests can be found on appropriate [Wiki page](https://github.com/pyfa-org/Pyfa/wiki/Developers:-Writing-Tests-for-Pyfa). \ No newline at end of file From c6c74be38dae509e87256f0dd6e4ed47123b534d Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:26:41 +0200 Subject: [PATCH 2/3] Added instructions to run tests for the project --- CONTRIBUTING.md | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1becb0b0a1..9e0c60f807 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ - Python 3.6 - Git CLI installed -- Python, pip and git are all available as command-line commands (add to path if needed) +- Python, pip and git are all available as command-line commands (add to the path if needed) Virtual environment will be created in *PyfaEnv* folder. Project will be cloned and run from the *PyfaDEV* folder. Separate virtual environment will be created so required libraries won't clutter the main python installation. @@ -17,12 +17,12 @@ Clone the repository git clone PyfaDEV ``` -Create virtual environment +Create the virtual environment ``` python -m venv PyfaEnv ``` -Activate virtual environment +Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat @@ -52,11 +52,11 @@ python PyfaDEV\pyfa.py Install PyCharm / Other IntelliJ product with Python plugin -After launching select *Check out from Version Control* -> *GIt* +After launching - select *Check out from Version Control* -> *GIt* ![welcome](https://user-images.githubusercontent.com/54093496/66862580-d8edab00-ef99-11e9-94e2-e93d7043e620.png) -Login to GitHub, paste repo URL and seect the folder to which to clone the project, press *Clone*. +Login to GitHub, paste the repo URL and select the folder to which to clone the project into, press *Clone*. ![Clone](https://user-images.githubusercontent.com/54093496/66862748-38e45180-ef9a-11e9-9f68-4903baf47385.png) @@ -68,7 +68,7 @@ Press on options and add new virtual environment. ![venv](https://user-images.githubusercontent.com/54093496/66862833-67622c80-ef9a-11e9-94fa-47cca0158d29.png) -Open project tree view and double-click on *requirements.txt*. Press *Install requirements*. Install all requirements. +Open project tree view and double-click on the *requirements.txt*. Press *Install requirements*. Install all requirements. ![Reqs](https://user-images.githubusercontent.com/54093496/66862870-7a74fc80-ef9a-11e9-9b18-e64be42c49b8.png) @@ -76,4 +76,27 @@ Create new *Run Configuration*. Set correct *Script path* and *Python interprete ![Run configuraion](https://user-images.githubusercontent.com/54093496/66862970-b4460300-ef9a-11e9-9fb4-20e24759904b.png) -Test that the project is starting properly. \ No newline at end of file +Check that the project is starting properly. + +## Running tests + +Switch to the proper virtual environment +``` +For cmd.exe: PyfaEnv\scripts\activate.bat +For bash: source /bin/activate +``` + +Install pytest +``` +pip install pytest +``` + +Switch to pyfa directory. + +Run tests (any will do) +``` +python -m pytest +py.test +``` + +More information on tests can be found on appropriate [Wiki page](https://github.com/pyfa-org/Pyfa/wiki/Developers:-Writing-Tests-for-Pyfa). \ No newline at end of file From c52170b7312fc39b427938d6896fd639ae885b6f Mon Sep 17 00:00:00 2001 From: Gochim <54093496+Gochim@users.noreply.github.com> Date: Thu, 7 Nov 2019 14:45:29 +0200 Subject: [PATCH 3/3] Fixed path for bash script call --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e0c60f807..b5132c16e2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,7 +26,7 @@ Activate the virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat -For bash: source /bin/activate +For bash: source /Scripts/activate ``` > For other OS check [Python documentation](https://docs.python.org/3/library/venv.html) @@ -83,7 +83,7 @@ Check that the project is starting properly. Switch to the proper virtual environment ``` For cmd.exe: PyfaEnv\scripts\activate.bat -For bash: source /bin/activate +For bash: source /Scripts/activate ``` Install pytest