Skip to content

Commit 02c162b

Browse files
authored
Merge branch 'master' into adding-missing-audit-log-fields
2 parents 6ccd5a7 + c1e2fb2 commit 02c162b

File tree

256 files changed

+1517
-1264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+1517
-1264
lines changed

.flake8

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ count = true
1010
# D105: Magic methods not having a docstring.
1111
# D412: No blank lines allowed between a section header and its content
1212
# E402: Module level import not at top of file (isn't compatible with our import style).
13-
# E701, E704: Multiple statements on one line (conflicts with black, but it will be enforced by it anyways).
13+
# E701, E704: Multiple statements on one line (conflicts with ruff, but it will be enforced by it anyways).
1414
# T101: TO-DO comment detection (T102 is FIX-ME and T103 is XXX).
1515
# S101: Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
1616
# W503: line break before binary operator (too many false positives and doesnt match our style)
@@ -49,7 +49,7 @@ per-file-ignores =
4949

5050
max-complexity = 20
5151
max-function-length = 130
52-
# Technically this is 120, but black has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
52+
# Technically this is 120, but ruff has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
5353
max-line-length = 130
5454
show_source = False
5555
statistics = False

.github/workflows/ci.yml

+11-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, macos-latest, windows-latest]
20-
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
20+
python-version: [3.9, "3.10", 3.11, 3.12, 3.13]
2121

2222
runs-on: ${{ matrix.os }}
2323

@@ -31,7 +31,6 @@ jobs:
3131
python-version: ${{ matrix.python-version }}
3232

3333
- name: Test Installation
34-
shell: bash
3534
run: |
3635
pip install -r dev-requirements/build.txt
3736
@@ -42,7 +41,6 @@ jobs:
4241
pip uninstall -y hikari
4342
4443
- name: Run tests
45-
shell: bash
4644
run: |
4745
pip install -r dev-requirements.txt
4846
nox -s pytest
@@ -57,6 +55,7 @@ jobs:
5755
path: .coverage
5856
retention-days: 1
5957
if-no-files-found: error
58+
include-hidden-files: true
6059

6160
upload-coverage:
6261
needs: [test]
@@ -101,7 +100,7 @@ jobs:
101100
coverage report
102101
103102
- name: Upload coverage to codeclimate
104-
uses: paambaati/codeclimate-action@v8.0.0
103+
uses: paambaati/codeclimate-action@v9.0.0
105104
env:
106105
CC_TEST_REPORTER_ID: d40e64ea0ff74713f79365fea4378ab51a2141ad4fcf0fb118496bbf560d4192
107106
with:
@@ -117,7 +116,7 @@ jobs:
117116
- name: Setup python
118117
uses: actions/setup-python@v5
119118
with:
120-
python-version: 3.8
119+
python-version: 3.9
121120

122121
- name: Check stubs
123122
if: always()
@@ -149,6 +148,12 @@ jobs:
149148
run: |
150149
nox -s flake8
151150
151+
# Temporary until we use ruff for linting too
152+
- name: Ruff format check
153+
if: always()
154+
run: |
155+
nox -s check-reformat-code
156+
152157
- name: Slotscheck
153158
if: always()
154159
run: |
@@ -174,7 +179,7 @@ jobs:
174179
- name: Setup python
175180
uses: actions/setup-python@v5
176181
with:
177-
python-version: 3.8
182+
python-version: 3.9
178183

179184
- name: Test twemoji mapping
180185
run: |

.github/workflows/fragments-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Setup python
2323
uses: actions/setup-python@v5
2424
with:
25-
python-version: 3.8
25+
python-version: 3.9
2626

2727
- name: Check if changelog fragment was added
2828
run: |

.github/workflows/prepare-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup python
3535
uses: actions/setup-python@v5
3636
with:
37-
python-version: 3.8
37+
python-version: 3.9
3838

3939
- name: Run prepare script
4040
env:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup python
3030
uses: actions/setup-python@v5
3131
with:
32-
python-version: 3.8
32+
python-version: 3.9
3333

3434
- name: Temporarily disable "include administrators" branch protection
3535
uses: benjefferies/branch-protection-bot@v1.1.2

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,6 @@ prof/
6464
# Logs
6565
*.log
6666

67+
# Misc
6768
Pipfile*
69+
pyrightconfig.json

CHANGELOG.md

+68
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
## 2.1.1 (2025-02-26)
2+
3+
### Features
4+
5+
- Allow specifying a reason for message deletions ([#2066](https://github.com/hikari-py/hikari/issues/2066))
6+
- Allow setting `name` and `value` of an `EmbedField` to an empty string. ([#2105](https://github.com/hikari-py/hikari/issues/2105))
7+
8+
### Bugfixes
9+
10+
- Fixed Entitlement `starts_at` and `ends_at` erroring when set to `None`. ([#2149](https://github.com/hikari-py/hikari/issues/2149))
11+
- Properly handle and error on Cloudflare bans ([#2168](https://github.com/hikari-py/hikari/issues/2168))
12+
13+
### Documentation Improvements
14+
15+
- Added missing documentation for `GatewayShard` and for trait `ShardAware`, adding missing errors which can be thrown. ([#2100](https://github.com/hikari-py/hikari/issues/2100))
16+
17+
---
18+
## 2.1.0 (2024-09-25)
19+
20+
### Breaking Changes
21+
22+
- `VoiceState.member` can now be `None` in cases where Discord doesn't send the relevant information ([#2038](https://github.com/hikari-py/hikari/issues/2038))
23+
24+
### Features
25+
26+
- Add the optional audit log `reason` argument to `hikari.api.rest.RESTClient.delete_channel` and
27+
`hikari.impl.rest.RESTClientImpl.delete_channel`, the same way it already exists for e.g.
28+
`edit_channel` ([#2058](https://github.com/hikari-py/hikari/issues/2058))
29+
30+
### Bugfixes
31+
32+
- Fix issue when deserializing voice states with missing member data ([#2038](https://github.com/hikari-py/hikari/issues/2038))
33+
- Fix `fetch_application_emojis` endpoint deserialization ([#2050](https://github.com/hikari-py/hikari/issues/2050))
34+
- Fix uploading files when using aiohttp 3.10.6 and onwards ([#2059](https://github.com/hikari-py/hikari/issues/2059))
35+
36+
---
37+
## 2.0.0 (2024-08-28)
38+
39+
### Breaking Changes
40+
41+
- Drop Python 3.8 support. ([#2008](https://github.com/hikari-py/hikari/issues/2008))
42+
43+
### Features
44+
45+
- Implement stage instances ([#1725](https://github.com/hikari-py/hikari/issues/1725))
46+
- Add Python 3.13 support ([#1793](https://github.com/hikari-py/hikari/issues/1793))
47+
- Add `title` and `description` fields to `Attachment`. ([#1945](https://github.com/hikari-py/hikari/issues/1945))
48+
- Add `display_name` to `PartialUser` ([#1951](https://github.com/hikari-py/hikari/issues/1951))
49+
- Remove `Optional` type hint from `CommandInteraction.options` - it will now always be an empty sequence when not provided. ([#1965](https://github.com/hikari-py/hikari/issues/1965))
50+
- Application-bound emojis API support. ([#1990](https://github.com/hikari-py/hikari/issues/1990))
51+
- Add `Member.guild_flag` and matching `GuildMemberFlags` enum. ([#2004](https://github.com/hikari-py/hikari/issues/2004))
52+
- Add `Message.thread` field. ([#2012](https://github.com/hikari-py/hikari/issues/2012))
53+
- Add new voice endpoints (`fetch_my_voice_state` and `fetch_voice_state`) ([#2016](https://github.com/hikari-py/hikari/issues/2016))
54+
- Add `fetch_role` method to `RESTClient` ([#2020](https://github.com/hikari-py/hikari/issues/2020))
55+
56+
### Bugfixes
57+
58+
- Fix incorrect cleanup when failing to create request with a web reader ([#1946](https://github.com/hikari-py/hikari/issues/1946))
59+
- Fix serializing JSON dicts with enum values as keys.
60+
See [#1955](https://github.com/hikari-py/hikari/issues/1955) ([#1957](https://github.com/hikari-py/hikari/issues/1957))
61+
- Use Discord Media Proxy instead of CDN for animated stickers urls ([#1982](https://github.com/hikari-py/hikari/issues/1982))
62+
- Use correct URL route for scheduled event covers. ([#1983](https://github.com/hikari-py/hikari/issues/1983))
63+
- Perform proper comparison when checking `CustomEmoji` against `KnownCustomEmoji`. ([#1986](https://github.com/hikari-py/hikari/issues/1986))
64+
- Add `NITRO_BASIC` attribute to `PremiumType` ([#1988](https://github.com/hikari-py/hikari/issues/1988))
65+
- Fix incorrectly deserialized field `type` in `ChannelOverwriteEntryInfo` ([#1993](https://github.com/hikari-py/hikari/issues/1993))
66+
- Add missing `AuditLogChangeKey.COMMUNICATION_DISABLED_UNTIL` and matching key deserialization ([#1996](https://github.com/hikari-py/hikari/issues/1996))
67+
68+
---
169
## 2.0.0.dev126 (2024-06-20)
270

371
### Features

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<br>
66
<a href="https://github.com/hikari-py/hikari/actions"><img height="20" alt="CI status" src="https://github.com/hikari-py/hikari/actions/workflows/ci.yml/badge.svg?branch=master&event=push"></a>
77
<a href="https://pypi.org/project/mypy/"><img height="20" alt="Mypy badge" src="https://img.shields.io/badge/mypy-checked-blue"></a>
8-
<a href="https://pypi.org/project/black"><img height="20" alt="Black badge" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
8+
<a href="https://pypi.org/project/ruff"><img height="20" alt="Ruff badge" src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json"></a>
99
<a href="https://codeclimate.com/github/hikari-py/hikari/test_coverage"><img height="20" alt="Test coverage" src="https://api.codeclimate.com/v1/badges/f95070b25136a69b0589/test_coverage"></a>
1010
<br>
1111
<a href="https://discord.gg/Jx4cNGG"><img height="20" alt="Discord invite" src="https://discord.com/api/guilds/574921006817476608/widget.png"></a>
@@ -18,7 +18,7 @@ Gateway APIs.
1818
Built on good intentions and the hope that it will be extendable and reusable, rather than an obstacle for future
1919
development.
2020

21-
Python 3.8, 3.9, 3.10, 3.11 and 3.12 are currently supported.
21+
Python 3.9, 3.10, 3.11, 3.12 and 3.13 are currently supported.
2222

2323
## Installation
2424

changes/1725.feature.md

-1
This file was deleted.

changes/1945.feature.md

-1
This file was deleted.

changes/1946.bugfix.md

-1
This file was deleted.

changes/1951.feature.md

-1
This file was deleted.

changes/1965.feature.md

-1
This file was deleted.

changes/1982.bugfix.md

-1
This file was deleted.

changes/1983.bugfix.md

-1
This file was deleted.

changes/1986.bugfix.md

-1
This file was deleted.

changes/1988.bugfix.md

-1
This file was deleted.

changes/1990.feature.md

-1
This file was deleted.

changes/1993.bugfix.md

-1
This file was deleted.

changes/1996.bugfix.md

-1
This file was deleted.

dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nox[uv]==2024.4.15
1+
nox[uv]==2025.2.9

dev-requirements/build.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
setuptools>=65.2.0
2-
wheel==0.44.0
2+
wheel==0.45.1

dev-requirements/coverage.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
coverage[toml]==7.6.0
1+
coverage[toml]==7.6.12

dev-requirements/flake8.txt

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
1-
flake8==7.1.1
1+
flake8==7.1.2
22

33
# Plugins
44
# Ref: https://github.com/DmytroLitvinov/awesome-flake8-extensions
55

66
flake8-bandit~=4.1.1 # runs bandit
7-
flake8-black==0.3.6 # runs black
87
flake8-builtins==2.5.0 # builtin shadowing checks
9-
flake8-coding==1.3.2 # coding magic-comment detection
10-
flake8-comprehensions==3.15.0 # comprehension checks
8+
flake8-comprehensions==3.16.0 # comprehension checks
119
flake8-docstrings==1.7.0 # pydocstyle support
1210
flake8-executable==2.1.3 # shebangs
1311
flake8-fixme==1.1.1 # "fix me" counter
1412
flake8-functions==0.0.8 # function linting
1513
flake8-html==0.4.3 # html output
16-
flake8-isort==6.1.1 # runs isort
1714
flake8-mutable==1.2.0 # mutable default argument detection
1815
flake8-pep3101==2.1.0 # new-style format strings only
1916
flake8-print==5.0.0 # complain about print statements in code
2017
flake8-printf-formatting==1.1.2 # forbey printf-style python2 string formatting
21-
flake8-pytest-style==2.0.0 # pytest checks
18+
flake8-pytest-style==2.1.0 # pytest checks
2219
flake8-raise==0.0.5 # exception raising linting
2320
flake8-use-fstring==1.4 # format string checking
2421
flake8-noqa==1.4.0 # validate noqa commands

dev-requirements/formatting.txt

-2
This file was deleted.

dev-requirements/mkdocs.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
mkdocs==1.6.0
1+
mkdocs==1.6.1
22

33
# Mkdocs Material
4-
mkdocs-material[imaging]==9.5.31
4+
mkdocs-material[imaging]==9.6.5
55

66
# Docstring parsing for API reference
7-
mkdocstrings[python]==0.25.2
8-
griffe-inherited-docstrings==1.0.0
7+
mkdocstrings[python]==0.27.0
8+
griffe-inherited-docstrings==1.1.1
99

1010
# Generate API reference pages dynamically
1111
mkdocs-gen-files==0.5.0
@@ -14,8 +14,8 @@ mkdocs-literate-nav==0.6.1
1414
# Minify
1515
mkdocs-minify-plugin==0.8.0
1616

17-
# Formatting signatures
18-
black==24.8.0
17+
# Towncrier draft changelogs
18+
mkdocs-towncrier==0.1.3
1919

2020
# Image viewer ext
2121
# mkdocs-glightbox==0.3.7

dev-requirements/mypy.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mypy==1.10.1
1+
mypy[faster-cache]==1.15.0

dev-requirements/pyright.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pyright==1.1.374
1+
pyright==1.1.395

dev-requirements/pytest.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# mock in the stdlib changes between versions of Python, so are not consistent in behaviour like the backport is
22
mock==5.1.0
33

4-
pytest==8.3.2
5-
pytest-asyncio==0.23.8
6-
pytest-cov==5.0.0
7-
pytest-randomly==3.15.0
4+
pytest==8.3.4
5+
pytest-asyncio==0.25.3
6+
pytest-cov==6.0.0
7+
pytest-randomly==3.16.0
88

9-
async-timeout==4.0.3 # Used for timeouts in some test cases.
9+
async-timeout==5.0.1 # Used for timeouts in some test cases.
1010

1111
-r coverage.txt # Consistent coverage version

dev-requirements/release.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
twine==5.1.1
1+
twine==6.1.0
22

33
-r build.txt

dev-requirements/ruff.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ruff==0.9.9

dev-requirements/slotscheck.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
slotscheck==0.19.0
1+
slotscheck==0.19.1

dev-requirements/towncrier.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
towncrier==24.7.1
1+
towncrier==24.8.0

docs/changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ hide:
88
!!! warning
99
Major and minor releases also include the changes specified in prior development releases.
1010

11+
:: towncrier-draft
1112

1213
--8<-- "CHANGELOG.md"

examples/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Hikari Examples - A collection of examples for Hikari.
32
#
43
# To the extent possible under law, the author(s) have dedicated all copyright

examples/hello_world.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Hikari Examples - A collection of examples for Hikari.
32
#
43
# To the extent possible under law, the author(s) have dedicated all copyright
@@ -9,6 +8,8 @@
98
# If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
109
"""A simple bot with only a `!ping` command."""
1110

11+
from __future__ import annotations
12+
1213
import os
1314

1415
import hikari

examples/image_resources.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Hikari Examples - A collection of examples for Hikari.
32
#
43
# To the extent possible under law, the author(s) have dedicated all copyright
@@ -13,6 +12,8 @@
1312
special treatment.
1413
"""
1514

15+
from __future__ import annotations
16+
1617
import os
1718
import re
1819

examples/oauth.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
# Hikari Examples - A collection of examples for Hikari.
32
#
43
# To the extent possible under law, the author(s) have dedicated all copyright
@@ -8,6 +7,9 @@
87
# You should have received a copy of the CC0 Public Domain Dedication along with this software.
98
# If not, see <https://creativecommons.org/publicdomain/zero/1.0/>.
109
"""An example OAuth server."""
10+
11+
from __future__ import annotations
12+
1113
import logging
1214
import os
1315

0 commit comments

Comments
 (0)