id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,branch,changelog,apichanges,internalchanges 12158,"Skipped classes can be loaded, activated and displayed on plugin admin page",Ryan J Ollos,Ryan J Ollos,"Issue was found when making changes to [https://github.com/trac-hacks/trac-github/issues/86#issuecomment-128668184 trac-github plugin]. The `entry_points` configuration for the plugin was changed to: {{{#!python extras_require={'oauth': ['requests_oauthlib >= 0.5']}, entry_points={'trac.plugins': [ 'github.browser = tracext.github:GitHubBrowser', 'github.loginmodule = tracext.github:GitHubLoginModule[oauth]', 'github.postcommithook = tracext.github:GitHubPostCommitHook', ]}, }}} The `GitHubLoginModule` still shows on the Plugins admin page when the dependency is not satisfied. The component can be activated when `requests-oauthlib` is not installed even though it was claimed to be skipped during environment startup. {{{ 02:22:27 AM Trac[loader] DEBUG: Skipping ""github.auth = tracext.github:GitHubLoginModule [oauth]"": (""DistributionNotFound: requests-oauthlib>=0.5"" not found) 02:22:27 AM Trac[loader] DEBUG: Loading github.browser from /home/user/Workspace/trac-github-dev/pve/lib/python2.7/site-packages/trac_github-2.1.3-py2.7.egg 02:22:27 AM Trac[loader] DEBUG: Loading github.postcommithook from /home/user/Workspace/trac-github-dev/pve/lib/python2.7/site-packages/trac_github-2.1.3-py2.7.egg }}} The issue seems to be that since the dependency is a [https://github.com/trac-hacks/trac-github/blob/2.3/tracext/github.py#L125 method-scoped import], the `GitHubLoginModule` class is added to the Component registry when other classes in the module are loaded: [browser:/tags/trac-1.0.8/trac/loader.py@:68#L36]. Primarily it would be nice to not show the Component on the plugin admin page when it is claimed to be skipped. I don't know if there's a reasonable solution to this, but I just thought I would raise the issue to see if there are any ideas.",defect,closed,normal,1.2.3,general,,normal,fixed,,,,Components that failed to load due to missing required dependencies would still show on the plugin admin page.,,