feat: added installers for cross-platform#13
Conversation
…eScrobbler class Enhance MovieScrobbler class to send notifications on scrobble updates and improve logging for watched status Improve asset path resolution in tray_app.py for frozen applications and enhance icon loading logic with multiple fallbacks Implement update checking and installation logic in tray_app.py, including platform-specific handling for Windows, macOS, and Linux Add PowerShell updater script for Windows to manage application updates, including version checking and installation Create updater script for macOS and Linux to handle updates, including downloading and installing the latest version
There was a problem hiding this comment.
Hello @kavinthangavel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request introduces platform-specific installers for Windows, macOS, and Linux, along with update mechanisms. It includes a PowerShell updater script for Windows, shell scripts for macOS and Linux, and enhancements to the tray application for update checking and icon loading. The changes also incorporate improvements to the MovieScrobbler class for notifications and logging.
Highlights
- Cross-Platform Installers: Adds platform-specific handling for Windows, macOS, and Linux, including scripts and configurations for creating installers.
- Windows PowerShell Updater: Implements a PowerShell script for managing application updates on Windows, including version checking and installation.
- macOS and Linux Updater Scripts: Creates shell scripts for handling updates on macOS and Linux, including downloading and installing the latest version.
- Tray Application Enhancements: Improves asset path resolution and icon loading logic in the tray application, and implements update checking and installation logic.
- MovieScrobbler Improvements: Enhances the MovieScrobbler class to send notifications on scrobble updates and improves logging for watched status.
Changelog
Click here to see the changelog
- build_installer.bat
- Added a batch script to build the Windows installer using PyInstaller and Inno Setup.
- The script checks for Python and PyInstaller, cleans previous builds, builds executables, generates an Inno Setup script with the correct version, and compiles the installer.
- create_icns.py
- Added a Python script to create macOS .icns files from PNG images.
- The script uses Pillow to resize and convert images, and attempts to use iconutil or png2icns to generate the .icns file.
- get_version.py
- Added a Python script to extract the version number from pyproject.toml.
- This script is used by build scripts to ensure version consistency.
- setup.iss
- Added an Inno Setup script for creating the Windows installer.
- The script defines application metadata, specifies files to include, creates icons, and sets up registry entries for uninstall and auto-update.
- simkl-mps.spec
- Modified the PyInstaller spec file to include data files for guessit and babelfish, and updater scripts.
- The spec file now handles platform-specific hidden imports and creates separate executables for the main application and the tray application.
- simkl_mps/init.py
- Updated imports to use absolute imports instead of relative imports.
- simkl_mps/cli.py
- Improved the tray application launch process to use the dedicated tray executable if available.
- Added a check for updates on application start, respecting user preferences.
- Added check_for_updates function to check for updates to the application.
- simkl_mps/monitor.py
- Updated imports to use absolute imports instead of relative imports.
- simkl_mps/movie_scrobbler.py
- Added notification callback to MovieScrobbler to send notifications on scrobble updates.
- Removed marking as watched due to completion threshold.
- simkl_mps/tray_app.py
- Improved asset path resolution for frozen applications, checking multiple locations for assets.
- Enhanced icon loading logic with multiple fallbacks to ensure an icon is always displayed.
- Added auto-update setup logic to run on first launch, configuring update checks for macOS and Linux.
- simkl_mps/utils/updater.ps1
- Added a PowerShell script for checking and installing updates on Windows.
- The script downloads the latest installer from GitHub Releases, stops running applications, and runs the installer silently.
- simkl_mps/utils/updater.sh
- Added a shell script for checking and installing updates on macOS and Linux.
- The script downloads the latest release, extracts the application, and replaces the existing installation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Installers arise,
Across platforms, code compiles,
Updates now flow free.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
There was a problem hiding this comment.
Code Review
This pull request introduces installers for cross-platform support, including Windows, macOS, and Linux. It also includes enhancements to the MovieScrobbler class and improvements to asset path resolution. Overall, the changes seem well-structured and address the intended functionality. However, there are a few areas that could benefit from further review and refinement.
Summary of Findings
- Error Handling in create_icns.py: The script
create_icns.pyusessys.exit(1)in several places, which can abruptly terminate the program. Consider using exceptions or returning error codes to allow for more graceful handling. - Inno Setup Script Versioning: The
setup.issfile has hardcoded version information. Ensure that the version defined here is dynamically updated during the build process to maintain consistency. - Updater Script Logic: The updater scripts (
updater.ps1,updater.sh) lack robust error handling and logging for update failures. Implement comprehensive error reporting and logging to diagnose issues during updates.
Merge Readiness
The pull request introduces significant new functionality and cross-platform support. While the changes appear to be well-structured, the identified issues related to error handling, versioning, and updater script logic should be addressed before merging. I am unable to directly approve this pull request, and recommend that the author address the issues raised in the review comments before merging, and that other reviewers also review and approve this code before merging.
- Create `create-release.yml` for automated GitHub releases with versioning and artifact uploads. - Implement `linux-build.yml` for building Linux installers, including AppImage and Debian packages, with auto-update scripts. - Add `macos-build.yml` for building macOS installers, including DMG and PKG formats, with icon generation and auto-update setup. - Introduce `publish-pypi.yml` for publishing the Python package to PyPI with injected credentials. - Create `windows-build.yml` for building Windows installers using PyInstaller and Inno Setup, including artifact uploads.
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Type of Change
Description
platform-specific handling for Windows, macOS, and Linux
Add PowerShell updater script for Windows to manage application updates, including version checking and installation
Create updater script for macOS and Linux to handle updates, including downloading and installing the latest version
Enhance MovieScrobbler class to send notifications on scrobble updates and improve logging for watched status
Improve asset path resolution in tray_app.py for frozen applications and enhance icon loading logic with multiple fallbacks
Implement update checking and installation logic in tray_app.py