Bellow are steps and setups you need to follow all features.
The basic goal of the project, is to reach clean, bugs free code.
Game has been developed using python OOP. The way to approach clean code with no (unaware dimensions) has been reach by writing unittest for classes used in project.
I am expecting you to have make installed
Have Make on your environment (in case you want to enter short command lines)
www.chocolatey.org/packages/makeCheck pip by running:
on mac:
pip3 --versionon win:
pip --versionand finally
To be able to try all features, it is preferred to create Virtual Environment.
To get advance of using make easily:
-
Open Makefile
-
On Windows:
- comment line 4 and uncommnet line 5
-
On Mac:
- comment line 5 and uncommnet line 4
-
Navigate into repo if you are a windows user, use always python insteade of python3
.venv is the name of the VE you are going to create
make venvTo activate it VE in mac:
. .venv/bin/activateTo activate it on windows:
. .venv/Scripts/activateTo deactivate it on both operating system:
deactivateNotice that if you are a windows user, use GIT-bash.
If you want to avoid creating VE. You may use command line mentioned in section bellow.
After activating enter the following command:
make installcheck libs list
pip3 listIf the list does not have more that three lines. Then your installation faild.
You need to upgrade your pip using the following command
pip3 install pip --upgradepip if you are on windows
python main.pyNotice that you enter another terminal, and you would not exit it unless you enter q or other exit commands.
You can always press ? or help to get the introductions within game terminal.
After you are done with the game, let us trying tests some code.
Enter:
To run unittest and get the report about testing.
make coverageTo get a visual report about which lines have been covered and which not.
make htmlA new folder is created htmlcov. You find the reports in it
Run flake8, code cleaner.
make flake8Run code analysis.
make pylintRun both tests.
make testCreate uml for whole the package.
make pyreverseFollow doc/ where you can find separate subfolders, each include UMLs
You can read the Documentation from here
Also, you can create the documentation locally, navigate to dice_game/docs/ and enter
make htmlAnd by now, the documentation for the project has been created to open it:
cd _build/htmlyou need to open index.html
If you are on windows:
start index.htmlmac:
open index.htmlIf you do not have choco
Inside dice_game folder:
To test all module within the pachage:
coverage run -m unittest discover . “test_*.py”Create report AFTER running tests:
coverage report -mCreate HTML report:
coverage htmlRun flake8:
flake8To run pylint on all file:
pylint *.py

