Repository: hikari-py/hikari
Pull request #1566 (2023-03-29 13:58:05)

Bump sphinx-autoapi from 2.0.1 to 2.1.0
Bumps [sphinx-autoapi](https://github.com/readthedocs/sphinx-autoapi) from 2.0.1 to 2.1.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/readthedocs/sphinx-autoapi/blob/main/CHANGELOG.rst">sphinx-autoapi's changelog</a>.</em></p>
<blockquote>
<h2>v2.1.0 (2023-03-28)</h2>
<p>Deprecations and Removals
^^^^^^^^^^^^^^^^^^^^^^^^^</p>
<ul>
<li>Support for documenting languages other than Python is deprecated. (<a href="https://redirect.github.com/readthedocs/sphinx-autoapi/issues/248">#248</a>)</li>
<li>Removed the option to have autoapi generate toctree entries for domain objects.
Domain objects are now added to the toctree by Sphinx.
Dropped support for sphinx &lt; 5.2.0. (<a href="https://redirect.github.com/readthedocs/sphinx-autoapi/issues/369">#369</a>)</li>
</ul>
<p>Misc
^^^^</p>
<ul>
<li>Added basic type checking.</li>
<li>Integrated towncrier into the release workflow.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/47e5dcd7070ff9f9a70b5d2028f7ee21db9903ad"><code>47e5dcd</code></a> Version 2.1.0</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/861b8e0f6336015515935a41fc4de0a5e375f023"><code>861b8e0</code></a> Document towncrier in the README</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/5fa927c682aa1656e3b98f77b485db030a3fcbe7"><code>5fa927c</code></a> Document the deprecation for other languages</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/f44080391b86bb8435c497a21d956f182b526b93"><code>f440803</code></a> Adjusted documentation around toctree editing</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/6b16e02de49f989867dd172898ff6b4e68388548"><code>6b16e02</code></a> Let Sphinx handle adding domain directives to the toctree (<a href="https://redirect.github.com/readthedocs/sphinx-autoapi/issues/374">#374</a>)</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/007d9959a0f50b91e24ddd599bbf5a96635a3832"><code>007d995</code></a> Fix towncrier not finding default branch in CI</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/58d653e557f01885e30f8ac43190b5083746240a"><code>58d653e</code></a> Added basic type checking</li>
<li><a href="https://github.com/readthedocs/sphinx-autoapi/commit/1401facbc075d3d7d85c8cd83efff72c8e09482e"><code>1401fac</code></a> Integrated towncrier into the release workflow</li>
<li>See full diff in <a href="https://github.com/readthedocs/sphinx-autoapi/compare/v2.0.1...v2.1.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=sphinx-autoapi&package-manager=pip&previous-version=2.0.1&new-version=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/changes/1528.feature.md b/changes/1528.feature.md
new file mode 100644
index 00000000..d0eb6116
--- /dev/null
+++ b/changes/1528.feature.md
@@ -0,0 +1,1 @@
+`Role.mention` now returns `"@everyone"` for the `@everyone` role.
diff --git a/dev-requirements/formatting.txt b/dev-requirements/formatting.txt
index 369de29f..72fde7f1 100644
--- a/dev-requirements/formatting.txt
+++ b/dev-requirements/formatting.txt
@@ -1,2 +1,2 @@
-black==23.1.0
+black==23.3.0
 isort==5.12.0
diff --git a/dev-requirements/pyright.txt b/dev-requirements/pyright.txt
index de82c85d..bff2e88a 100644
--- a/dev-requirements/pyright.txt
+++ b/dev-requirements/pyright.txt
@@ -1,1 +1,1 @@
-pyright==1.1.300
+pyright==1.1.301
diff --git a/dev-requirements/sphinx.txt b/dev-requirements/sphinx.txt
index d1c9ff2e..6b35b0ee 100644
--- a/dev-requirements/sphinx.txt
+++ b/dev-requirements/sphinx.txt
@@ -4,7 +4,7 @@ sphinx==6.1.3
 furo==2023.3.27
 
 # Autodocumentation
-sphinx-autoapi==2.0.1
+sphinx-autoapi==2.1.0
 numpydoc==1.5.0
 
 # Static files
diff --git a/docs/conf.py b/docs/conf.py
index b61730b5..73844e5c 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -82,9 +82,6 @@
 
 html_theme = "furo"
 html_favicon = "https://www.hikari-py.dev/logo.png"
-# html_theme_options = {
-#     "top_of_page_button": None,
-# }
 html_static_path = ["_static"]
 html_css_files = ["extra.css"]
 
@@ -107,7 +104,6 @@
 autoapi_template_dir = "_templates"
 
 autoapi_add_toctree_entry = False
-autoapi_add_objects_to_toctree = False
 autoapi_keep_files = True
 autoapi_member_order = "groupwise"
 
diff --git a/hikari/guilds.py b/hikari/guilds.py
index 34893db9..d143bb1f 100644
--- a/hikari/guilds.py
+++ b/hikari/guilds.py
@@ -1022,6 +1022,18 @@ def icon_url(self) -> typing.Optional[files.URL]:
         """Role icon URL, if there is one."""
         return self.make_icon_url()
 
+    @property
+    def mention(self) -> str:
+        """Return a raw mention string for the role.
+
+        When this role represents @everyone mentions will only work if
+        `mentions_everyone` is `True`.
+        """
+        if self.guild_id == self.id:
+            return "@everyone"
+
+        return super().mention
+
     def make_icon_url(self, *, ext: str = "png", size: int = 4096) -> typing.Optional[files.URL]:
         """Generate the icon URL for this role, if set.
 


Test patch:
diff --git a/tests/hikari/test_guilds.py b/tests/hikari/test_guilds.py
index b64e5ad6..37567d50 100644
--- a/tests/hikari/test_guilds.py
+++ b/tests/hikari/test_guilds.py
@@ -157,6 +157,13 @@ def test_icon_url_property(self, model):
 
             model.make_icon_url.assert_called_once_with()
 
+    def test_mention_property(self, model):
+        assert model.mention == "<@&979899100>"
+
+    def test_mention_property_when_is_everyone_role(self, model):
+        model.id = model.guild_id
+        assert model.mention == "@everyone"
+
     def test_make_icon_url_when_hash_is_None(self, model):
         model.icon_hash = None