Metadata-Version: 2.4
Name: xsetuper
Version: 1.0.0
Summary: Create standalone executables from Python scripts
Author-email: mmdrza <ifekri@users.noreply.github.com>, ifekri <devfekri@icloud.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ifekri/xsetuper
Project-URL: Documentation, https://github.com/ifekri/xsetuper#readme
Project-URL: Repository, https://github.com/ifekri/xsetuper
Project-URL: Issues, https://github.com/ifekri/xsetuper/issues
Project-URL: Changelog, https://github.com/ifekri/xsetuper/releases
Keywords: freeze,executable,standalone,packaging,xsetuper,build
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Software Distribution
Classifier: Topic :: Utilities
Requires-Python: <3.16,>=3.10
Description-Content-Type: text/markdown
Requires-Dist: freeze-core>=0.6.1
Requires-Dist: packaging>=25.0
Requires-Dist: setuptools<85.0,>=78.1.1
Requires-Dist: filelock>=3.20.3; sys_platform == "linux"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "x86_64"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "i686"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "aarch64"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "armv7l"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "ppc64le"
Requires-Dist: patchelf>=0.16.1; sys_platform == "linux" and platform_machine == "s390x"
Requires-Dist: dmgbuild>=1.6.1; sys_platform == "darwin"
Requires-Dist: lief<1.1.0,>=0.16.0; sys_platform == "win32"
Requires-Dist: python-msilib>=0.4.1; sys_platform == "win32" and python_version >= "3.13"

# xsetuper

**xsetuper** creates standalone executables from Python scripts, with the same performance as the original script. It is cross-platform and should work on any platform that Python runs on.

## Features

- Cross-platform: Windows, macOS, Linux
- **Built-in GUI** — manage, configure and build projects visually; no extra dependencies (uses tkinter from the standard library)
- Fast builds with optimized module discovery
- Simple CLI: `xsetuper --script myapp.py` to freeze
- `pyproject.toml` configuration support
- GUI and console application support
- MSI, DMG, AppImage, DEB, RPM installer generation
- Automatic dependency detection

## Graphical Interface

xsetuper ships with a full graphical interface — no extra packages to install:

```bash
xsetuper gui
# or
xsetuper-gui
# or open a specific project folder
xsetuper-gui /path/to/project
```

The GUI provides:

- **Project manager** — save/load projects (`.xsetuper.json`) and export `pyproject.toml`
- **Recent projects** list with one-click reopening
- **Multiple executables** per project, with icon, base (console/gui), manifest, shortcut and UAC options
- **Module control** — include/exclude lists, packages, build constants
- **Files & zip control** — extra data files, zip include/exclude packages, path replacement
- **Smart setup** — analyzes your script's imports and suggests include/exclude lists
- **Quickstart wizard** — two questions and your project is ready
- **One-click build** with live console output, cancel support, and post-build actions (run app / open output folder)
- **Installer creation** — MSI, DMG, AppImage, DEB, RPM toggles run automatically after build (per platform)
- **Dark / light themes** with automatic system detection

## Installation

```bash
pip install xsetuper
```

Or with conda:

```bash
conda install -c conda-forge xsetuper
```

## Quick Start

### CLI Usage

The simplest way to freeze your Python application:

```bash
xsetuper --script myapp.py
```

This creates a standalone executable in `build/exe.<platform>-<python-version>/`.

### Common CLI Options

```bash
# Specify output directory
xsetuper --script myapp.py --target-dir dist/

# Set custom executable name
xsetuper --script myapp.py --target-name MyApp

# Include an icon
xsetuper --script myapp.py --icon icon.ico

# GUI application (no console window on Windows)
xsetuper --script myapp.py --base gui

# Build with optimization
xsetuper build_exe --optimize=2
```

### pyproject.toml Configuration

Add your freeze configuration directly in `pyproject.toml`:

```toml
[tool.xsetuper.build_exe]
excludes = ["tkinter", "unittest"]
includes = ["my_package"]
optimize = 1
silent = false

[[tool.xsetuper.executables]]
script = "myapp.py"
base = "gui"
target_name = "MyApp"
icon = "icon.ico"
```

Then build with:

```bash
xsetuper build_exe
```

### Python API

```python
from xsetuper import setup, Executable

setup(
    name="MyApp",
    version="1.0",
    description="My Application",
    executables=[
        Executable(
            "myapp.py",
            base="gui",
            target_name="MyApp",
            icon="icon.ico",
        )
    ],
)
```

## Creating Installers

### Windows (MSI)

```bash
xsetuper bdist_msi
```

### macOS (DMG)

```bash
xsetuper bdist_dmg
```

### Linux (AppImage)

```bash
xsetuper bdist_appimage
```

### Linux (DEB)

```bash
xsetuper bdist_deb
```

## Advanced Usage

### Excluding Modules

```toml
[tool.xsetuper.build_exe]
excludes = [
    "tkinter",
    "unittest",
    "email",
    "xml",
    "pydoc",
]
```

### Including Data Files

```toml
[tool.xsetuper.build_exe]
include_files = [
    ("data/", "data/"),
    ("config.json", "config.json"),
]
```

### Optimizing the Build

```toml
[tool.xsetuper.build_exe]
optimize = 2  # Maximum optimization (removes docstrings)
no_compress = false
zip_include_packages = ["encodings"]
```

## Development

```bash
git clone https://github.com/ifekri/xsetuper.git
cd xsetuper
pip install -e ".[dev]"
```

### Running Tests

```bash
pytest tests/ -v
```

### Coverage

```bash
pytest tests/ --cov=xsetuper --cov-report=term-missing
```

## License

MIT License. See [LICENSE](LICENSE) for details.
