DailyPlanner is an automatic scheduling application. Using user created activties the application creates a schedule based on the users needs.
- DailyPlanner
- Run unttests without coverage
- Run unittests with coverage
- Run the linters and the unittests with coverage
- Run a testfile
- Run a test method, in a class, in a testfile
- Remove files generated for tests or caching
- Do also remove all you have installed
This is how you can work with the development environment.
Check what version of Python you have. The Makefile uses PYTHON=python
as default.
# Check you Python installation
make version
If you have another naming of the Python executable then you can solve that using an environment variable. This is common on Mac and Linux.
# Set the environment variable to be your python executable
export PYTHON=python3
make version
Read more on GNU make.
Install a Python virtual environment and activate it.
# Create the virtual environment
make venv
# Activate on Windows
. .venv/Scripts/activate
# Activate on Linx/Mac
. .venv/bin/activate
When you are done you can leave the venv using the command deactivate
.
Read more on Python venv.
Install the PIP packages that are dependencies to the project and/or the development environment. The dependencies are documented in the requirements.txt
.
Do not forget to check that you have an active venv.
# Do install them
make install
# Check what is installed
make installed
Read more on Python PIP.
Before running the application, make sure you export your PYTHONPATH. The path used here is the path to the root project folder on your machine
# Export PYTHONPATH (using example path)
export PYTHONPATH="C:/ExampleUser/Development/Agile-Development-DailyPlanner"
The application also needs a MySQL database in order to work. If it is your first time running the application, please checkout db/SETUP.md to install and setup the database correctly.
The application can be started like this.
# Execute the main program
python planner/main.py
All code is stored below the directory planner/
.
You can run the static code validator like this. It check the sourcecode and exclude the testcode.
make pylint
You might need to update the Makefile if you change the name of the source directory currently named `planner/`.
Read more on:
* [pylint](https://pylint.org/)
### Run the unittests
You can run the unittests like this. The testfiles are stored in the `test/` directory.
make unittest
make coverage
make test
You can open a web browser to inspect the code coverage as a generated HTML report.
firefox htmlcov/index.html
Read more on:
* [unittest](https://docs.python.org/3/library/unittest.html)
* [coverage](https://coverage.readthedocs.io/)
### Run parts of the testsuite
You can also run parts of the testsuite, for examples files or methods in files.
You can run all tests from a testfile.
python -m unittest test.test_interface
You can also run a single testcase from a file.
python -m unittest test.test_interface.TestInterface.test_display_menu
### Remove generated files
You can remove all generated files by this.
make clean
make clean-all
More targets
--------------------------
The Makefile contains more targets, they are however not yet tested on this directory structure.