Skip to content

Commit ccdac7b

Browse files
committed
Merge branch 'master' into feat/python-3.14
2 parents 4dacf6f + d9890f3 commit ccdac7b

24 files changed

Lines changed: 317 additions & 79 deletions

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ body:
99
Thanks for taking the time to fill out a bug. If you want real-time support,
1010
consider joining our Discord at https://pycord.dev/discord instead.
1111
12+
Please make sure that you tested either the latest (pre-)release [currently https://pypi.org/project/py-cord/2.8.0rc1/] or master, before submitting a bug report.
13+
1214
Please note that this form is for bugs only!
1315
- type: input
1416
attributes:

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
blank_issues_enabled: true
1+
blank_issues_enabled: false
22
contact_links:
33
- name: Ask a question
44
about: Ask questions and discuss with other users of the library.

.github/workflows/docs-localization-download.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: ./docs
4141
- name: "Crowdin"
4242
id: crowdin
43-
uses: crowdin/github-action@v2.15.2
43+
uses: crowdin/github-action@v2.16.0
4444
with:
4545
upload_sources: false
4646
upload_translations: false

.github/workflows/docs-localization-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
sphinx-intl update -p ./build/locales ${{ vars.SPHINX_LANGUAGES }}
4545
working-directory: ./docs
4646
- name: "Crowdin"
47-
uses: crowdin/github-action@v2.15.2
47+
uses: crowdin/github-action@v2.16.0
4848
with:
4949
upload_sources: true
5050
upload_translations: false
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Enforce PR Template
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, edited, synchronize, reopened]
6+
workflow_dispatch:
7+
inputs:
8+
pr_number:
9+
description: 'Pull request number to validate'
10+
required: true
11+
type: number
12+
13+
permissions:
14+
pull-requests: write
15+
contents: read
16+
issues: write
17+
18+
jobs:
19+
enforce-template:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Determine PR number
24+
id: pr
25+
run: |
26+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
27+
echo "number=${{ inputs.pr_number }}" >> "$GITHUB_OUTPUT"
28+
else
29+
echo "number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
30+
fi
31+
32+
- name: Enforce template
33+
uses: actions/github-script@v8
34+
with:
35+
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
script: |
37+
const prNumber = Number('${{ steps.pr.outputs.number }}');
38+
const org = 'Pycord-Development';
39+
const INVALID_LABEL = 'invalid';
40+
41+
// 1) Load PR
42+
const { data: pr } = await github.rest.pulls.get({
43+
owner: context.repo.owner,
44+
repo: context.repo.repo,
45+
pull_number: prNumber,
46+
});
47+
48+
const author = pr.user.login;
49+
50+
if (pr.locked) {
51+
core.info(`PR #${prNumber} is already locked; skipping enforcement.`);
52+
return;
53+
}
54+
55+
const skipAuthors = [
56+
'renovate[bot]',
57+
'renovate-bot',
58+
'dependabot[bot]',
59+
'github-actions[bot]',
60+
'github-copilot[bot]',
61+
'copilot[bot]',
62+
'copilot'
63+
];
64+
65+
if (skipAuthors.includes(author)) {
66+
core.info(`Author ${author} is in skip list; skipping enforcement.`);
67+
return;
68+
}
69+
70+
// 2) Check org membership
71+
let isMember = false;
72+
try {
73+
await github.rest.orgs.checkMembershipForUser({ org, username: author });
74+
isMember = true;
75+
} catch (error) {
76+
if (error.status !== 404) {
77+
throw error;
78+
}
79+
}
80+
81+
if (isMember) {
82+
core.info(`Author ${author} is in org ${org}; skipping enforcement.`);
83+
return;
84+
}
85+
86+
// 3) Validate body
87+
const body = (pr.body || '').trim();
88+
const problems = [];
89+
90+
// Basic length check – tune as needed
91+
if (body.length < 150) {
92+
problems.push('PR description is too short (expected more content based on the template).');
93+
}
94+
95+
// Required headings from PULL_REQUEST_TEMPLATE.md
96+
const requiredHeadings = [
97+
'## Summary',
98+
'## Information',
99+
'## Checklist',
100+
];
101+
102+
for (const heading of requiredHeadings) {
103+
if (!body.includes(heading)) {
104+
problems.push(`Missing required section: "${heading}"`);
105+
}
106+
}
107+
108+
// Enforce AI disclosure line
109+
if (!body.includes('AI Usage has been disclosed')) {
110+
problems.push('The line "AI Usage has been disclosed." is missing.');
111+
}
112+
113+
if (problems.length === 0) {
114+
core.info('PR body passed template validation.');
115+
return;
116+
}
117+
118+
// 4) If invalid: label, comment, close, and fail
119+
core.info('Template validation failed. Applying actions.');
120+
121+
const existingLabels = (pr.labels || []).map(l => l.name);
122+
if (!existingLabels.includes(INVALID_LABEL)) {
123+
await github.rest.issues.addLabels({
124+
owner: context.repo.owner,
125+
repo: context.repo.repo,
126+
issue_number: prNumber,
127+
labels: [INVALID_LABEL],
128+
});
129+
}
130+
131+
const problemsBlock = problems.join('\n');
132+
133+
await github.rest.issues.createComment({
134+
owner: context.repo.owner,
135+
repo: context.repo.repo,
136+
issue_number: prNumber,
137+
body: [
138+
'This pull request does not follow the required pull request template.',
139+
'',
140+
'Please use the default template (`PULL_REQUEST_TEMPLATE.md`) and fill out all required sections.',
141+
'',
142+
'Problems detected:',
143+
'',
144+
'```',
145+
problemsBlock,
146+
'```',
147+
].join('\n'),
148+
});
149+
150+
if (pr.state === 'open') {
151+
await github.rest.pulls.update({
152+
owner: context.repo.owner,
153+
repo: context.repo.repo,
154+
pull_number: prNumber,
155+
state: 'closed',
156+
});
157+
}
158+
159+
try {
160+
await github.rest.issues.lock({
161+
owner: context.repo.owner,
162+
repo: context.repo.repo,
163+
issue_number: prNumber,
164+
lock_reason: 'spam',
165+
});
166+
core.info('Locked PR conversation.');
167+
} catch (lockError) {
168+
core.warning(`Failed to lock issue/PR #${prNumber}: ${lockError.message}`);
169+
}
170+
171+
core.setFailed('PR does not follow the required template.');

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ jobs:
288288
determine_milestone_id:
289289
runs-on: ubuntu-latest
290290
needs: [lib_release, pre_config]
291-
if: ${{ !contains(needs.pre_config.outputs.version, '-') }}
291+
if: ${{ !contains(needs.pre_config.outputs.version, '-') && false }}
292292
outputs:
293293
old_milestone_version: ${{ steps.extract_version.outputs.old_milestone_version }}
294294
new_milestone_version: ${{ steps.extract_version.outputs.new_milestone_version }}
@@ -311,7 +311,7 @@ jobs:
311311
runs-on: ubuntu-latest
312312
needs: [determine_milestone_id, pre_config]
313313
if: ${{ !contains(needs.pre_config.outputs.version, 'rc') &&
314-
endsWith(needs.pre_config.outputs.version, '.0') }}
314+
endsWith(needs.pre_config.outputs.version, '.0') && false }}
315315
environment: release
316316
env:
317317
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,3 +194,6 @@ docs/build/linkcheck
194194
/build/
195195
/vscode/
196196
remote-release.yml
197+
*.wav
198+
*.ogg
199+
*.ps1

CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,22 @@ These changes are available on the `master` branch, but have not yet been releas
1414

1515
- Support for **Python 3.14**.
1616
([#2948](https://github.com/Pycord-Development/pycord/pull/2948))
17+
18+
### Changed
19+
20+
### Fixed
21+
22+
- Fixed a `TypeError` when using `Label.set_select` and not providing `default_values`.
23+
([#3171](https://github.com/Pycord-Development/pycord/pull/3171))
24+
25+
### Deprecated
26+
27+
### Removed
28+
29+
## [2.8.0rc1] - 2026-03-21
30+
31+
### Added
32+
1733
- Added support for community invites.
1834
([#3044](https://github.com/Pycord-Development/pycord/pull/3044))
1935
- Added `Member.colours` and `Member.colors` properties.
@@ -1653,7 +1669,8 @@ These changes are available on the `master` branch, but have not yet been releas
16531669
- Fix py3.10 UnionType checks issue.
16541670
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))
16551671

1656-
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.7.1...HEAD
1672+
[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.8.0rc1...HEAD
1673+
[2.8.0rc1]: https://github.com/Pycord-Development/pycord/compare/v2.7.0...v2.8.0rc1
16571674
[2.7.1]: https://github.com/Pycord-Development/pycord/compare/v2.7.0...v2.7.1
16581675
[2.7.0]: https://github.com/Pycord-Development/pycord/compare/v2.7.0rc2...v2.7.0
16591676
[2.7.0rc2]: https://github.com/Pycord-Development/pycord/compare/v2.7.0rc1...v2.7.0rc2

RELEASE_SCHEDULE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Pycord Release Schedule
22

3-
Status: Draft
3+
Status: Active
44

55
Authors: <Paillat-dev paillat@pycord.dev>
66

@@ -18,7 +18,9 @@ v2.4.1 and v2.5.0).
1818

1919
## Release Guarantees
2020

21-
> [!NOTE] For an up to date list of Pycord's release guarantees, please visit
21+
<!-- prettier-ignore -->
22+
> [!NOTE]
23+
> For an up to date list of Pycord's release guarantees, please visit
2224
> https://docs.pycord.dev/en/stable/version_guarantees.html.
2325
2426
The library follows the [semantic versioning principle](https://semver.org/) which means

discord/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
from .threads import Thread
7171
from .ui.view import BaseView
7272
from .user import ClientUser, User
73-
from .utils import _D, _FETCHABLE, MISSING
74-
from .voice.utils.dependencies import warn_if_voice_dependencies_missing
73+
from .utils import _D, _FETCHABLE, MISSING, warn_if_voice_dependencies_missing
7574
from .webhook import Webhook
7675
from .widget import Widget
7776

@@ -93,7 +92,6 @@
9392

9493
Coro = TypeVar("Coro", bound=Callable[..., Coroutine[Any, Any, Any]])
9594

96-
9795
_log = logging.getLogger(__name__)
9896

9997

0 commit comments

Comments
 (0)