Skip to content

Commit

Permalink
📦 build: adding executable generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilbottom committed Jul 26, 2024
1 parent b14ec6a commit f02465f
Show file tree
Hide file tree
Showing 8 changed files with 798 additions and 668 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# Logs
logs/

# Caches
node_modules/

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,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
```
4 changes: 2 additions & 2 deletions coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 14 additions & 1 deletion daily_tracker/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
1 change: 1 addition & 0 deletions daily_tracker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,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}")

Expand Down
Binary file added daily_tracker/resources/clock-icon.ico
Binary file not shown.
1,424 changes: 760 additions & 664 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -45,6 +45,7 @@ ide.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"
Expand Down

0 comments on commit f02465f

Please sign in to comment.