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

[FIX] Orange can be imported without Qt (fixed importing localization) #6955

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

janezd
Copy link
Contributor

@janezd janezd commented Dec 13, 2024

Issue

Fixes #6952. Requires biolab/orange-canvas-core#320 to be merged and released.

Description of changes

Import localization from a place that doesn't require Qt.

The most important change is the one in configuration of Trubar - this will allow running Orange without Qt.

The other two changes in [Orange/widgets/utils/localization/__init__.py](https://github.com/biolab/orange3/compare/master...janezd:fix-headless-orange?expand=1#diff-3bf6fd4d089b6924794714d11768d90dbac35b1b370e9cfc788c6cd6f216eece) are not strictly necessary, but prevent a warning about importing localization from a deprecated module.

Includes
  • Code changes
  • Tests
  • Documentation

@janezd janezd added the waiting for new dependency version Depends on unreleased orange-canvas-core/orange-widget-base content label Dec 13, 2024
@markotoplak
Copy link
Member

I tested these two PR (installed, so translated, at first I forgot about this) and they did fix the reported issue for me .

But then, when testing, if I only remove pyqt* in my environment, I still get complains from Orange's __init__.py:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/marko/dev/orange3/Orange/__init__.py", line 30, in <module>
    from AnyQt.QtCore import QObject
  File "/home/marko/venv312/lib/python3.12/site-packages/AnyQt/QtCore.py", line 274, in <module>
    from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5.QtCore'

I also had to remove AnyQt for them to disappear. Did you have to do that too?

@markotoplak markotoplak changed the title Import localization from orangecanvas to avoid depending on Qt [FIX] Orange can be imported without Qt (fixed importing localization) Dec 16, 2024
@markotoplak markotoplak removed the waiting for new dependency version Depends on unreleased orange-canvas-core/orange-widget-base content label Dec 16, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.47%. Comparing base (c2c1648) to head (74f8282).
Report is 22 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6955      +/-   ##
==========================================
+ Coverage   88.45%   88.47%   +0.01%     
==========================================
  Files         331      332       +1     
  Lines       73099    73277     +178     
==========================================
+ Hits        64659    64831     +172     
- Misses       8440     8446       +6     

@markotoplak markotoplak merged commit 22dc000 into biolab:master Dec 16, 2024
28 of 30 checks passed
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.

Orange wheel requires Qt
2 participants