Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove requirement for separate Qt installation #677

Conversation

jonathanperret
Copy link
Contributor

@jonathanperret jonathanperret commented Jul 12, 2024

The only reason to require a standalone Qt installation was the lrelease tool used to convert the translation files.

It turns out PySide6, which we install through pip, already includes this tool under the name pyside6-lrelease.

This PR changes the call from lrelease to pyside6-lrelease, and removes the installation of Qt from the GitHub Actions workflow and from the development setup instructions.

Except on Linux, where the Qt libraries which are bundled in PySide6 have themselves dependencies on system libraries such as libgl1 and a dozen others. In that case it seemed simpler to keep installing a system Qt 6 package to pull these system dependencies in, even though none of the Qt components installed system-wide will be used.

Summary by CodeRabbit

  • New Features

    • Upgraded Python environment setup to the latest version, enhancing compatibility and performance.
    • Streamlined installation process for Qt6 system dependencies for better efficiency.
  • Documentation

    • Improved clarity and conciseness of the installation instructions in the README, focusing on essential steps for users.
  • Chores

    • Updated command for generating binary files to ensure compatibility with newer versions of the PySide6 framework.

Copy link
Contributor

coderabbitai bot commented Jul 12, 2024

Walkthrough

The changes involve updates across various configuration files to enhance the Python environment setup, optimize package installation processes, and clarify dependency management. Key updates include transitioning to setup-python@v5, refining system dependencies for qt6, and simplifying setup instructions. Additionally, modifications have been made to the translation file generation process to ensure compatibility with pyside6.

Changes

File Path Change Summary
.github/actions/init-environment/action.yml Updated setup-python action from version 4 to version 5.
.github/workflows/build-multi-os.yml Removed qt package installation, refined qt6 dependency setup, and improved clarity in installation steps.
README.md Enhanced dependency and setup instructions for Qt 6, removing redundancy and clarifying essential steps.
src/main/resources/base/ayab/translations/ayab_trans.pl Updated to use pyside6-lrelease for generating binary .qm files for better compatibility.

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d836857 and 2f47e49.

Files selected for processing (5)
  • .github/actions/init-environment/action.yml (1 hunks)
  • .github/workflows/build-multi-os.yml (14 hunks)
  • README.md (4 hunks)
  • setup-environment.ps1 (1 hunks)
  • src/main/resources/base/ayab/translations/ayab_trans.pl (1 hunks)
Files skipped from review due to trivial changes (3)
  • .github/actions/init-environment/action.yml
  • README.md
  • setup-environment.ps1
Additional comments not posted (26)
src/main/resources/base/ayab/translations/ayab_trans.pl (2)

90-90: Comment update is accurate.

The comment now correctly reflects the usage of pyside6-lrelease instead of lrelease.


92-92: Update to pyside6-lrelease is correct.

The update from lrelease to pyside6-lrelease is correct and aligns with the PR objectives.

Ensure that the pyside6-lrelease command works as intended and produces the expected .qm files.

.github/workflows/build-multi-os.yml (24)

30-30: Update to actions/checkout@v4 is correct.

The update from actions/checkout@v3 to @v4 ensures compatibility with the latest features and fixes.


51-51: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


57-57: Using apt-get is appropriate.

Switching to sudo apt-get update avoids warnings and is more suitable for scripts.


66-66: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


72-72: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


78-78: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


84-84: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


90-90: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


96-96: Update to actions/cache@v4 is correct.

The update from actions/cache@v3 to @v4 ensures compatibility with the latest features and fixes.


110-110: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


116-116: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


122-122: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


128-128: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


134-134: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


140-140: Update to actions/cache/save@v4 is correct.

The update from actions/cache/save@v3 to @v4 ensures compatibility with the latest features and fixes.


150-150: Update to actions/checkout@v4 is correct.

The update from actions/checkout@v3 to @v4 ensures compatibility with the latest features and fixes.


177-177: Update to actions/checkout@v4 is correct.

The update from actions/checkout@v3 to @v4 ensures compatibility with the latest features and fixes.


193-193: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


201-201: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


209-209: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


217-217: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


225-225: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


233-233: Update to actions/cache/restore@v4 is correct.

The update from actions/cache/restore@v3 to @v4 ensures compatibility with the latest features and fixes.


107-107: Ensure setup-environment.ps1 runs correctly.

The script setup-environment.ps1 is used to convert UI and translation files.

Ensure the script runs correctly and performs the intended actions.

@jonathanperret
Copy link
Contributor Author

Since the Build workflow doesn’t trigger for PRs here’s a run on my fork on the same commit, to demonstrate everything works: https://github.com/jonathanperret/ayab-desktop/actions/runs/9908222560

Copy link
Member

@X-sam X-sam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break the changes out into multiple PRs? I'm ok removing QT, but I am less prepared for testing the updates to actions at the moment, and I added the type generation for a reason so I would rather we don't remove it without further discussions and testing.

@jonathanperret jonathanperret force-pushed the no-standalone-qt-required branch from 2f47e49 to fd0b2f3 Compare July 14, 2024 22:59
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2f47e49 and fd0b2f3.

Files selected for processing (3)
  • .github/workflows/build-multi-os.yml (2 hunks)
  • README.md (4 hunks)
  • src/main/resources/base/ayab/translations/ayab_trans.pl (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • .github/workflows/build-multi-os.yml
  • README.md
  • src/main/resources/base/ayab/translations/ayab_trans.pl

@jonathanperret
Copy link
Contributor Author

Can you break the changes out into multiple PRs? I'm ok removing QT, but I am less prepared for testing the updates to actions at the moment, and I added the type generation for a reason so I would rather we don't remove it without further discussions and testing.

You're right, I got a bit carried away there. I've pared down the PR to just the removal of Qt. As I added in the PR description, on Linux we need to somehow get Qt's system dependencies installed, so I left apt install -y qt6-base-dev qt6-tools-dev-tools in to get these.

@dl1com dl1com requested a review from X-sam July 15, 2024 20:23
@dl1com
Copy link
Contributor

dl1com commented Jul 21, 2024

@X-sam as @jonathanperret did some changes to the PR, do you think we can merge it now?

@jonathanperret jonathanperret force-pushed the no-standalone-qt-required branch from fd0b2f3 to d1e3066 Compare July 25, 2024 16:37
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between fd0b2f3 and d1e3066.

Files selected for processing (3)
  • .github/workflows/build-multi-os.yml (2 hunks)
  • README.md (4 hunks)
  • src/main/resources/base/ayab/translations/ayab_trans.pl (1 hunks)
Files skipped from review due to trivial changes (1)
  • README.md
Additional comments not posted (4)
src/main/resources/base/ayab/translations/ayab_trans.pl (2)

90-90: LGTM!

The comment accurately reflects the change to use pyside6-lrelease.


92-92: LGTM!

The command change to pyside6-lrelease ensures compatibility with PySide6.

.github/workflows/build-multi-os.yml (2)

107-107: LGTM!

The comment clarifies the purpose of installing Qt6 packages, improving documentation for future maintainers.


108-108: LGTM!

The command ensures that necessary system dependencies are installed without requiring a separate Qt installation.

The only reason to require a standalone Qt installation was the
`lrelease` tool used to convert the translation files.

It turns out PySide6, which we install through `pip`, already includes
this tool under the name `pyside6-lrelease`.

This changes the call from `lrelease` to `pyside6-lrelease`, and removes
the installation of Qt from the GitHub Actions workflow and from the
development setup instructions, except on Linux where we install Qt tools
just to bring in the required system libraries.
@jonathanperret jonathanperret force-pushed the no-standalone-qt-required branch from d1e3066 to b235841 Compare July 25, 2024 20:38
Copy link

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d1e3066 and b235841.

Files selected for processing (3)
  • .github/workflows/build-multi-os.yml (2 hunks)
  • README.md (4 hunks)
  • src/main/resources/base/ayab/translations/ayab_trans.pl (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/main/resources/base/ayab/translations/ayab_trans.pl
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/build-multi-os.yml
  • README.md

@dl1com dl1com merged commit 2e4adef into AllYarnsAreBeautiful:1.0.0-dev Jul 30, 2024
2 checks passed
@jonathanperret jonathanperret deleted the no-standalone-qt-required branch July 30, 2024 11:46
@coderabbitai coderabbitai bot mentioned this pull request Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants