diff --git a/.gitignore b/.gitignore index ebea779..d5fa9c2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ # Logs logs/ +# Caches +node_modules/ + # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/README.md b/README.md index a19c2fb..18bddb0 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,7 @@ [![GitHub last commit](https://img.shields.io/github/last-commit/Bilbottom/daily-tracker)](https://shields.io/) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) -[![code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) -[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/) +[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Bilbottom/daily-tracker/main.svg)](https://results.pre-commit.ci/latest/github/Bilbottom/daily-tracker/main) [![Sourcery](https://img.shields.io/badge/Sourcery-enabled-brightgreen)](https://sourcery.ai) @@ -75,3 +74,19 @@ This has been tested and confirmed to work on an M1 Mac with version `8.6.13` of More details available at: - https://tkdocs.com/tutorial/install.html#install-macos + +### 💽 Building the executable + +> [!ERROR] +> +> This doesn't work yet. + +This project uses [PyInstaller](https://www.pyinstaller.org/) to build the executable; run: + +```bash +poetry run pyinstaller daily_tracker/__main__.py \ + --name daily-tracker \ + --icon=daily_tracker/resources/clock-icon.ico \ + --onefile \ + --windowed +``` diff --git a/daily_tracker/__main__.py b/daily_tracker/__main__.py index f1b1c0b..f2c787a 100644 --- a/daily_tracker/__main__.py +++ b/daily_tracker/__main__.py @@ -2,7 +2,20 @@ Entry point into the application. """ +import argparse + from daily_tracker import main if __name__ == "__main__": - main.main(debug_mode=True) + parser = argparse.ArgumentParser( + prog="daily-tracker", + description="An application for keeping track of tasks throughout the day.", + ) + parser.add_argument( + "--debug", + action="store_true", + help="Run the application in debug mode.", + ) + args = parser.parse_args() + + main.main(debug_mode=args.debug) diff --git a/daily_tracker/main.py b/daily_tracker/main.py index 941a636..fcf1eeb 100644 --- a/daily_tracker/main.py +++ b/daily_tracker/main.py @@ -39,6 +39,7 @@ def main(debug_mode: bool = False) -> None: _in_debug_mode = " in debug mode" if debug_mode else "" logging.info(f"Starting tracker{_in_debug_mode}...") + logging.info(f"Logging level: {logging.getLevelName(logging.getLogger().getEffectiveLevel())}") logging.debug(f"Setting root directory to {utils.ROOT}") logging.debug(f"Setting source directory to {utils.SRC}") diff --git a/daily_tracker/resources/clock-icon.ico b/daily_tracker/resources/clock-icon.ico new file mode 100644 index 0000000..b022e2c Binary files /dev/null and b/daily_tracker/resources/clock-icon.ico differ diff --git a/pyproject.toml b/pyproject.toml index 91f40c8..ab975a6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ packages = [ daily-tracker = "daily_tracker.main:main" [tool.poetry.dependencies] -python = "^3.11" +python = "~3.11" Pillow = ">=9.4.0" python-dotenv = ">=0.21.1" pyyaml = ">=6.0" @@ -44,6 +44,7 @@ test.optional = true coverage-badge = "^1.1.0" pre-commit = "^3.6.2" pylint = "3.1.0" +pyinstaller = "^6.9.0" [tool.poetry.group.test.dependencies] pytest = "^8.0.2"