Skip to content

Commit 77232f7

Browse files
Merge branch 'main' into qt/github-rewrite
2 parents b197948 + c5d6faa commit 77232f7

File tree

4 files changed

+16
-13
lines changed

4 files changed

+16
-13
lines changed

.github/actions/setup-env/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
steps:
1818
- name: Set up uv with Python ${{ inputs.python-version }}
1919
id: setup-python
20-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
20+
uses: astral-sh/setup-uv@5a7eac68fb9809dea845d802897dc5c723910fa3 # v7.1.3
2121
with:
2222
version: '0.8.14'
2323
enable-cache: true

monty/exts/info/github/__init__.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from collections.abc import Mapping
88
from typing import Any, overload
99

10-
import attrs
1110
import cachingutils
1211
import disnake
1312
import ghretos
@@ -616,13 +615,10 @@ async def ratelimits_command(self, ctx: commands.Context, refresh: bool = False)
616615
use_inline = len(monty.utils.services.GITHUB_RATELIMITS) <= 18 # 25 fields, 3 per line, 1 for the seperator.
617616
for i, (resource_name, rate_limit) in enumerate(monty.utils.services.GITHUB_RATELIMITS.items()):
618617
embed_value = ""
619-
for name, value in attrs.asdict(rate_limit).items():
620-
if name == "reset":
621-
value = f"<t:{value}:R>"
622-
else:
623-
value = f"`{value}`"
624-
625-
embed_value += f"**`{name}`**: {value}\n"
618+
embed_value += f"**`limit`**: `{rate_limit.limit}`\n"
619+
embed_value += f"**`remaining`**: `{rate_limit.remaining}`\n"
620+
embed_value += f"**`reset`**: <t:{rate_limit.reset}:R>\n"
621+
embed_value += f"**`used`**: `{rate_limit.used}`\n"
626622
embed.add_field(name=resource_name, value=embed_value, inline=use_inline)
627623

628624
# add a "newline" after every 3 fields

monty/utils/extensions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ def walk_extensions() -> Generator[tuple[str, "ExtMetadata"], None, None]:
2828
def on_error(name: str) -> NoReturn:
2929
raise ImportError(name=name) # pragma: no cover
3030

31+
skip_modules: set[str] = set()
32+
3133
for module in pkgutil.walk_packages(exts.__path__, f"{exts.__name__}.", onerror=on_error):
32-
if unqualify(module.name).startswith("_"):
34+
if unqualify(module.name).startswith("_") or module.name in skip_modules:
3335
# Ignore module/package names starting with an underscore.
3436
continue
3537

@@ -38,6 +40,11 @@ def on_error(name: str) -> NoReturn:
3840
# If it lacks a setup function, it's not an extension.
3941
continue
4042

43+
# This check only excludes init files which add an extension.
44+
if module.name.endswith(".__init__"):
45+
# Add all submodules to skip list to avoid re-processing.
46+
skip_modules.add(module.name)
47+
4148
ext_metadata = getattr(imported, "EXT_METADATA", None)
4249
if ext_metadata is not None:
4350
if not isinstance(ext_metadata, ExtMetadata):

uv.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)