Repository navigation
Conversation
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3449 +/- ##
==========================================
+ Coverage 91.15% 91.30% +0.14%
==========================================
Files 93 93
Lines 11800 11819 +19
Branches 1938 1941 +3
==========================================
+ Hits 10756 10791 +35
+ Misses 735 714 -21
- Partials 309 314 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type of Changes
Description
brain_giimportsgiwhile building the AST._import_gi_moduleruns__import__("gi.repository.X")for anygi.repositoryimport astroid cannot resolve from files, and_register_require_versionrunsimport gifor everygi.require_version(...)call. Both resolvegithroughsys.path, and pylint puts the analysed project first onsys.path, so a checkout that ships agi/package (regular or namespace) gets that package executed as soon as a linted file containsimport gi.repository.Gtk,from gi.repository import Gtkorgi.require_version("Gtk", "3.0"). Noextension-pkg-allow-listentry is involved; this is the same hole #3308 closed for numpy.Both sites now go through
_gi_is_installed, which locatesgiwithimportlib.util.find_spec(no import for a top-level name) and only proceeds when the origin is in the standard library or a site-packages directory. The newmodutils.is_library_pathalso covers Debian'sdist-packagesand the user site, sincesysconfigalone misses the apt-installedpython3-gi. Agicovered byextension-pkg-allow-listorunsafe-load-any-extensionis still imported from anywhere, so unusual installs keep a knob. A normally installed gi is unaffected and an absent gi behaves as before.GiFromProjectTestplants agipackage onsys.pathand checks that neither site imports it, that a fake installed gi is still used, and the namespace, missing-spec and allow-list cases. The two end-to-end tests fail onmain. Full suite, black, ruff, pylint, mypy and pyright pass locally.Refs #562