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

[V3 Downloader] Stop including subpackages in cog list #2590

Merged
merged 1 commit into from Apr 23, 2019

Conversation

@jack1142
Copy link
Contributor

commented Apr 18, 2019

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

Before this change, cog list would also include subpackages (because pkgutil.walk_packages() is recursive), so for example, if cog rlstats also had submodule rlstats.submodule, it would be included on cog list, which is unintended.

I'll also add that internally walk_packages() gives you items from iter_modules() generator and also submodules and that's the only difference between them, link
Oh and it also doesn't have to import all those packages because of that.

fix(downloader): Use `pkgutil.iter_modules()` to stop including subpa…
…ckages

Before this change, `Repo.available_modules` would also contain subpackages, which is unintended

@jack1142 jack1142 requested a review from tekulvw as a code owner Apr 18, 2019

@tekulvw tekulvw merged commit 46413c2 into Cog-Creators:V3/develop Apr 23, 2019

1 check passed

Travis CI - Pull Request Build Passed
Details

@jack1142 jack1142 deleted the jack1142:V3/available_modules_fix branch Apr 23, 2019

kennnyshiwa pushed a commit to kennnyshiwa/BB-8-Bot that referenced this pull request Apr 23, 2019

[V3 Downloader] Stop including subpackages in cog list (Cog-Creators#…
…2590)

Before this change, `Repo.available_modules` would also contain subpackages, which is unintended

jack1142 added a commit to jack1142/Red-DiscordBot that referenced this pull request Apr 24, 2019

tekulvw added a commit that referenced this pull request Apr 25, 2019

[Docs] Changelog entries for contributions by jack1142 (#2612)
* docs(changelog): [Mod] Allow admin to choose amount of repeats for "deleterepeats" #2437

* docs(changelog): Spelling correction of method name in Tunnel #2496

* docs(changelog): Tunnel fix - When tunnel closes, message should be sent to other end #2507

* docs(changelog): [V3 Downloader] Tell user how to load the cog after [p]cog install #2523

* docs(changelog): [V3 Audio] If bot has move members perm, it can join to user-limited channels #2525

* docs(changelog): [Trivia] Fix of dead image link (world flags) #2540

* docs(changelog): [V3 Test] Make sure that trivia test will use utf-8 encoding #2565

* docs(changelog): [V3 Core] Print actual version, when `--version` flag is used #2567

* docs(changelog): [V3 Downloader] Stop including subpackages in cog list #2590

* docs(changelog): [V3 Downloader] Uninstall multiple cogs #2592

* docs(changelog): [V3 Downloader] Always remove cog from installed in `[p]cog uninstall` #2595
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.