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] setup.py: do not overwrite conda's PyQt5 #5593

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

markotoplak
Copy link
Member

The PyQt5 dependency conflicts with conda, where the same package is called pyqt. Installing pyqt5 inside a conda environment that already contains pyqt may be catastrophic. Removing the dependency makes pip installation into conda environments safer; such installations frequently occur when users install an add-on not available in the conda repos that requires a newer version of Orange. The same issue appears when Anaconda users try to update Orange with the Add-on dialog box. Or when someone who installed Orange with conda downloads the master branch and does pip install -e ..

Orange added the PyQt5 dependency about a year ago to make pip installations friendlier. Unfortunately, that caused more problems than it fixed.

Description of changes

This is an alternative to #5566.

This commit modifies setup.py to only installs PyQt5 in a conda environment if PyQt5 could not be imported. I presume this is safe.

While I dislike that requirements are now not so easily determined with this PR, it should not change anything for non-conda installs. For conda environments, it correctly handles the following:

  • pip install -e . in a conda installed orange3 environment will not install double (conflicting) PyQts (fixed with this PR)
  • pip install orange3 in a fresh conda environment will still install pyqt5 from pip (as before)
Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Sep 10, 2021

Codecov Report

Merging #5593 (816f623) into master (53e2640) will decrease coverage by 0.00%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #5593      +/-   ##
==========================================
- Coverage   85.92%   85.91%   -0.01%     
==========================================
  Files         313      313              
  Lines       65360    65360              
==========================================
- Hits        56159    56155       -4     
- Misses       9201     9205       +4     

The PyQt5 dependency conflicts with conda, where the same package is called
pyqt. Installing pyqt5 inside a conda environment that already contains pyqt
may be catastrophic. Removing the dependency makes pip installation into conda
environments safer; such installations frequently occur when users install an
add-on not available in the conda repos that requires a newer version of
Orange. The same issue appears when Anaconda users try to update Orange with
the Add-on dialog box. Or when someone who installed Orange with conda
downloads the master branch and does "pip install -e .".

Orange added the PyQt5 dependency about a year ago to make pip installations
friendlier. Unfortunately, that caused more problems than it fixed. This commit
modifies setup.py to only installs PyQt5 in a conda environment if PyQt5 could
not be imported. I presume this is safe.
@PrimozGodec
Copy link
Contributor

It looks ok for me. :) I also tested it both in conda environment and virtualevn and it seems it works.

@PrimozGodec PrimozGodec self-requested a review September 17, 2021 08:45
@markotoplak markotoplak merged commit 2088e2d into biolab:master Sep 20, 2021
@markotoplak markotoplak mentioned this pull request Sep 20, 2021
5 tasks
@markotoplak markotoplak deleted the remove-pyqt5-dep2 branch November 25, 2021 15:37
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.

2 participants