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

A bug? in FindPyQt5.py #41913

Closed
Sinan81 opened this issue Feb 28, 2021 · 5 comments
Closed

A bug? in FindPyQt5.py #41913

Sinan81 opened this issue Feb 28, 2021 · 5 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers PyQGIS Related to the PyQGIS API stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@Sinan81
Copy link

Sinan81 commented Feb 28, 2021

Describe the bug
I find the following code confusing. Either the following else block is indented incorrectly or the following few lines of code, starting with cfg... should have been removed:

    if sys.platform.startswith('freebsd'):
        py_version = str(sys.version_info.major) + str(sys.version_info.minor)
        sip_dir = sip_dir.replace(py_version, '')
    for p in (os.path.join(sip_dir, "PyQt5"),
              os.path.join(sip_dir, "PyQt5-3"),
              sip_dir,
              os.path.join(cfg.default_mod_dir, "PyQt5", "bindings")):
        if os.path.exists(os.path.join(p, "QtCore", "QtCoremod.sip")):
            sip_dir = p
            break
    else:
        sys.exit(1)
    cfg = {
        'pyqt_mod_dir': os.path.join(cfg.default_mod_dir, "PyQt5"),
        'pyqt_sip_dir': sip_dir,
        'pyqt_bin_dir': cfg.default_bin_dir,
    }

How to Reproduce
NA

QGIS and OS versions
3.16.0 onwards

@Sinan81 Sinan81 added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Feb 28, 2021
@Sinan81
Copy link
Author

Sinan81 commented Feb 28, 2021

pinging @dminor and @nyalldawson (hope that's ok)

@Sinan81
Copy link
Author

Sinan81 commented Feb 28, 2021

Here is the actual file. https://github.com/qgis/QGIS/blob/master/cmake/FindPyQt5.py

@Sinan81
Copy link
Author

Sinan81 commented Feb 28, 2021

related to spack/spack#21963 (comment)

@gioman gioman added PyQGIS Related to the PyQGIS API Feedback Waiting on the submitter for answers labels Feb 28, 2021
@dminor
Copy link
Contributor

dminor commented Mar 1, 2021

If the else statement is hit, it means that QtCoremod.sip was not found in any of the locations that were searched, which as far as I can tell, means that sip_dir may not be correct in the code below. Without the early exit, configuration can continue with a bad sip_dir, which in my case, lead to some confusing errors further along in the process. Maybe this is no longer relevant.

@github-actions
Copy link

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Mar 16, 2021
@lbartoletti lbartoletti self-assigned this Jun 4, 2021
lbartoletti added a commit to lbartoletti/QGIS that referenced this issue Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers PyQGIS Related to the PyQGIS API stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

4 participants