Metadata-Version: 2.4
Name: maketool
Version: 0.8.35
Summary: Python Automation tool for building PySide6 UI and PyInstaller EXE.
Author-email: Alan Lilly <panofish@gmail.com>
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: psutil

# maketool

**maketool** is a command-line utility and helper module that simplifies execution and building PySide6 Python 3.7+ applications into executables using PyInstaller 5.8.0.  Note: Windows only

It's especially useful for GUI projects that need embedded resources (e.g., .ui, .qrc) and aim to produce portable .exe builds with minimal setup.

---

## Why Use maketool?

If you build windows desktop apps using PySide6, maketool:

- Saves time when converting `.ui` and `.qrc` files
- Simplifies PyInstaller builds
- Packages your application with minimal commands
- Automates repetitive tasks like building and cleanup
- Integrates easily with `.bat` scripts or shell commands
- Is great for both beginners and advanced developers using PySide6

---

## Commands

### 1. run

Purpose: Compile .ui and .qrc files recursively (using pyside6-uic.exe and pyside6-rcc.exe), then run the Python program using pythonw.exe.

Note: it will ONLY rebuild pyside components that are out of date, so that execution is fast as possible, yet always includes any changes.  
FYI: python program is run with pythonw.exe so that the terminal window does not appear.

```
Usage:
    maketool-run [-h] file

Parameters:
    file        python file to run
    -h, --help  show this help message and exit
```

---

### 2. clean

Purpose: Remove build artifacts, caches, generated UI files, PyInstaller output, and spec files.

Removes:
- __pycache__ folders
- *_ui.py, *_rc.py, *.pyc, *.pyo
- PyInstaller build/ and dist/ folders
- .spec files in the current directory

Usage:
    maketool-clean

---

### 3. compile

Purpose: Build an executable using PyInstaller, including UI/QRC compilation, icon embedding, version stamping, and resource embedding.

Features:
- Supports onefile/onedir/console modes
- Auto-generates a PyInstaller .spec file
- Handles .ui/.qrc compilation automatically
- Supports embedding arbitrary files (DLLs, images, data assets, etc.)
- Updates __version__ in the Python file when --version is provided

PyInstaller is conservative and often bundles Qt/OpenSSL DLLs that a given app never actually touches at runtime. This is a well-known PySide6/PyInstaller pain point, so stripping known-unused ones is a common technique to minimize final exe size.

By default, maketool-compile uses an internal list of commonly unused PySide6/Qt/OpenSSL DLLs and excludes them from the final build. This can dramatically shrink the size of the generated exe.

PySide6 DLL Exclusion:

- default
      Uses the internal default exclusion list (recommended for most apps and keeps exe small).

- --exclude=""  
      Exclude nothing; keep all DLLs that PyInstaller bundles for PySide6.

- --exclude=Qt6Svg.dll,Qt6Qml.dll,...  
      Exclude exactly the DLLs you specify.

If your exe crashes or is strangely missing functionality that otherwise appears when you run the .py file, you may need to reduce or remove exclusions.

Usage:
    maketool-compile [-h] --file FILE --type {onefile,onedir,console}
                     [--icon ICON] [--embed EMBED]
                     [--exclude EXCLUDE]
                     [--version VERSION]

Parameters:
    -h, --help            show this help message and exit
    --file FILE           python file to compile to exe
    --type {onefile,onedir,console}
                          type of exe to build
    --icon ICON           ico file
    --embed EMBED         comma delimited list of files to embed
    --exclude EXCLUDE     comma-delimited list of DLLs to exclude.
                          "" means exclude nothing.
                          If omitted, maketool uses its internal default list.
    --version VERSION     program version (otherwise use __version__ in py source)

---

### 4. sublime

WARNING: This will overwrite existing custom key bindings at that path  
Purpose: Install custom Sublime Text 4 shortcuts and commands.  
Future: plan for support of vscode editor.

Shortcuts installed:
- CTRL+BACKSPACE - delete line
- CTRL+ALT+E - open windows explorer where current file is located
- CTRL+0 - reset font size
- F1 - insert print statement for variable where cursor is located
- F5 - run pyflakes on current python source
- F6 - maketool-refscan - scan for unused/orphan files in the project
- F7 - build (runs maketool-run on current script via the build system)
- F10 - insert current date/day

Usage:
    maketool-sublime [-h] --path PATH

Parameters:
    -h, --help            show this help message and exit
    --path PATH           sublime text - data/package/user path

---

### 5. refscan

Purpose: Scan for unused/orphan files using string-based heuristics.
This is especially useful for catching forgotten assets like `.ui`, `.qss`, `.ico`, images, etc.
"Unused" means "no string reference found anywhere in .py files".

Default behavior:
    maketool-refscan

Show both used and unused:
    maketool-refscan --show-used

Write a CSV report:
    maketool-refscan --csv refscan-report.csv

Notes:
- This is heuristic (string-based). It may miss dynamically constructed paths/imports and may produce false positives.
- For best results, run it from your project root.

---

## Features

- Simple command-line interface for `.bat` or `.sh` workflows 
- Converts all `.ui` and `.qrc` files recursively
- Cleans up Python build artifacts
- Packages apps using PyInstaller 
- Supports custom `.ico` icons  
- Supports optional resource embedding

---

## Requirements

- Python 3.7+
- PySide6
- Tested with PyInstaller 5.8

---

## Installation

Install maketool helper from PyPI with following command:

    pip install maketool

---

## License

MIT License  
Copyright 2026 Alan Lilly
