Skip to content

Commit 7e29ec6

Browse files
committed
merge master
2 parents e544abd + bfa3968 commit 7e29ec6

File tree

583 files changed

+53999
-18295
lines changed

Some content is hidden

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

583 files changed

+53999
-18295
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[flake8]
2-
min_python_version = 3.9
2+
min_python_version = 3.10
33

44
# Incompatible with black see https://github.com/ambv/black/issues/315
55
ignore =

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
language: ["python"]
2727
steps:
2828
- name: "Checkout repository"
29-
uses: actions/checkout@v5
29+
uses: actions/checkout@v6
3030
- name: "Initialize CodeQL"
3131
uses: github/codeql-action/init@v4
3232
with:

.github/workflows/docs-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- name: "Checkout Repository"
39-
uses: actions/checkout@v5
39+
uses: actions/checkout@v6
4040
- name: "Setup Python"
4141
uses: actions/setup-python@v6
4242
with:

.github/workflows/docs-json-export.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- name: Checkout repository
1515
id: checkout
16-
uses: actions/checkout@v5
16+
uses: actions/checkout@v6
1717
- name: Set up Python
1818
uses: actions/setup-python@v6
1919
id: setup-python
@@ -35,7 +35,7 @@ jobs:
3535
id: generate-json
3636
run: python scripts/docs_json_exporter.py
3737
- name: Upload docs.json as artifact
38-
uses: actions/upload-artifact@v4.6.2
38+
uses: actions/upload-artifact@v6.0.0
3939
id: artifact-upload
4040
with:
4141
name: Pycord Docs JSON

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
pr_id: ${{ steps.convert_outputs.outputs.pr_id }}
1616
steps:
1717
- name: "Checkout Repository"
18-
uses: actions/checkout@v5
18+
uses: actions/checkout@v6
1919
with:
2020
fetch-tags: true
2121
- name: "Install Python"
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: ./docs
4141
- name: "Crowdin"
4242
id: crowdin
43-
uses: crowdin/github-action@v2.12.0
43+
uses: crowdin/github-action@v2.13.0
4444
with:
4545
upload_sources: false
4646
upload_translations: false
@@ -74,7 +74,7 @@ jobs:
7474
environment: translations
7575
steps:
7676
- name: "Checkout Repository"
77-
uses: actions/checkout@v5
77+
uses: actions/checkout@v6
7878
- name: "Refresh Pull"
7979
run: |
8080
git fetch --all

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
environment: translations
2121
steps:
2222
- name: "Checkout Repository"
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424
with:
2525
fetch-tags: true
2626
- name: "Install Python"
@@ -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.12.0
47+
uses: crowdin/github-action@v2.13.0
4848
with:
4949
upload_sources: true
5050
upload_translations: false

.github/workflows/lib-checks.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
runs-on: ubuntu-latest
3333
steps:
3434
- name: "Checkout Repository"
35-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3636
- name: "Setup Python"
3737
uses: actions/setup-python@v6
3838
with:
@@ -52,7 +52,7 @@ jobs:
5252
runs-on: ubuntu-latest
5353
steps:
5454
- name: "Checkout Repository"
55-
uses: actions/checkout@v5
55+
uses: actions/checkout@v6
5656
- name: "Setup Python"
5757
uses: actions/setup-python@v6
5858
with:
@@ -70,7 +70,7 @@ jobs:
7070
runs-on: ubuntu-latest
7171
steps:
7272
- name: "Checkout Repository"
73-
uses: actions/checkout@v5
73+
uses: actions/checkout@v6
7474
- name: "Setup Python"
7575
uses: actions/setup-python@v6
7676
with:
@@ -83,7 +83,7 @@ jobs:
8383
pip install -r requirements/dev.txt
8484
- name: "Setup cache"
8585
id: cache-pylint
86-
uses: actions/cache@v4
86+
uses: actions/cache@v5
8787
with:
8888
path: .pylint.d
8989
key: pylint
@@ -94,7 +94,7 @@ jobs:
9494
runs-on: ubuntu-latest
9595
steps:
9696
- name: "Checkout Repository"
97-
uses: actions/checkout@v5
97+
uses: actions/checkout@v6
9898
- name: "Setup Python"
9999
uses: actions/setup-python@v6
100100
with:
@@ -107,7 +107,7 @@ jobs:
107107
pip install -r requirements/dev.txt
108108
- name: "Setup cache"
109109
id: cache-mypy
110-
uses: actions/cache@v4
110+
uses: actions/cache@v5
111111
with:
112112
path: .mypy_cache
113113
key: mypy
@@ -120,18 +120,14 @@ jobs:
120120
strategy:
121121
matrix:
122122
os: [ubuntu-latest, macos-latest, windows-latest]
123-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
124-
exclude:
125-
- { python-version: "3.9", os: "macos-latest" }
126-
include:
127-
- { python-version: "3.9", os: "macos-13" }
123+
python-version: ["3.10", "3.11", "3.12", "3.13"]
128124
runs-on: ${{ matrix.os }}
129125
env:
130126
OS: ${{ matrix.os }}
131127
PYTHON: ${{ matrix.python-version }}
132128
steps:
133129
- name: "Checkout Repository"
134-
uses: actions/checkout@v5
130+
uses: actions/checkout@v6
135131
- name: "Setup Python"
136132
uses: actions/setup-python@v6
137133
with:
@@ -146,7 +142,7 @@ jobs:
146142
pip install -r requirements/dev.txt
147143
- name: "Setup cache"
148144
id: cache-pytest
149-
uses: actions/cache@v4
145+
uses: actions/cache@v5
150146
with:
151147
path: .pytest_cache
152148
key: ${{ matrix.os }}-${{ matrix.python-version }}-pytest
File renamed without changes.

.github/workflows/release.yml

Lines changed: 53 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ jobs:
2828
is_rc: ${{ steps.determine_vars.outputs.is_rc }}
2929
version: ${{ steps.determine_vars.outputs.version }}
3030
previous_tag: ${{ steps.determine_vars.outputs.previous_tag }}
31+
previous_final_tag: ${{ steps.determine_vars.outputs.previous_final_tag }}
3132
runs-on: ubuntu-latest
3233
steps:
3334
- name: "Checkout Repository"
34-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3536
with:
3637
fetch-depth: 0
3738
fetch-tags: true
@@ -41,18 +42,24 @@ jobs:
4142
env:
4243
VERSION: ${{ github.event.inputs.version }}
4344
run: |
44-
VALID_VERSION_REGEX='^([0-9]+\.[0-9]+\.[0-9]+((a|b|rc|\.dev|\.post)[0-9]+)?)$'
45+
set -euo pipefail
46+
VALID_VERSION_REGEX='^[0-9]+\.[0-9]+\.[0-9]+(rc[0-9]+)?$'
4547
if ! [[ $VERSION =~ $VALID_VERSION_REGEX ]]; then
46-
echo "::error::Invalid version string '$VERSION'. Must match PEP 440 (e.g. 1.2.0, 1.2.0rc1, 1.2.0.dev1, 1.2.0a1, 1.2.0b1, 1.2.0.post1)"
48+
echo "::error::Invalid version string '$VERSION'. Only releases like 1.2.3 and release candidates like 1.2.3rc1 are supported."
4749
exit 1
4850
fi
49-
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+rc[0-9]+$ ]]; then
50-
echo "::error::Unsupported version string '$VERSION'. Only normal releases (e.g. 1.2.3) and rc (e.g. 1.2.3rc1) are supported at this time."
51+
echo "version=$VERSION" >> $GITHUB_OUTPUT
52+
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || git describe --tags --abbrev=0 2>/dev/null || true)
53+
if [[ -z "$PREVIOUS_TAG" ]]; then
54+
echo "::error::Could not determine previous tag. Ensure at least one tag exists."
5155
exit 1
5256
fi
53-
echo "version=$VERSION" >> $GITHUB_OUTPUT
54-
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^)
5557
echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT
58+
PREVIOUS_FINAL_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n1 || true)
59+
if [[ -z "$PREVIOUS_FINAL_TAG" ]]; then
60+
PREVIOUS_FINAL_TAG=$PREVIOUS_TAG
61+
fi
62+
echo "previous_final_tag=${PREVIOUS_FINAL_TAG}" >> $GITHUB_OUTPUT
5663
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
5764
echo "branch_name=v${MAJOR_MINOR_VERSION}.x" >> $GITHUB_OUTPUT
5865
if [[ $VERSION == *rc* ]]; then
@@ -108,7 +115,7 @@ jobs:
108115
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
109116
steps:
110117
- name: "Checkout Repository"
111-
uses: actions/checkout@v5
118+
uses: actions/checkout@v6
112119
with:
113120
fetch-depth: 0
114121
fetch-tags: true
@@ -146,17 +153,23 @@ jobs:
146153
shell: bash
147154
env:
148155
VERSION: ${{ inputs.version }}
156+
PREVIOUS_TAG: ${{ needs.pre_config.outputs.previous_tag }}
157+
PREVIOUS_FINAL_TAG: ${{ needs.pre_config.outputs.previous_final_tag }}
149158
REPOSITORY: ${{ github.repository }}
150159
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
151160
BRANCH: ${{ github.ref_name }}
152161
run: |
153162
git config user.name "NyuwBot"
154163
git config user.email "[email protected]"
155164
DATE=$(date +'%Y-%m-%d')
156-
sed -i "/These changes are available on the \`.*\` branch, but have not yet been released\./{N;d;}" CHANGELOG.md
157-
sed -i "s/## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md
158-
sed -i "0,/## \[$VERSION\]/ s|## \[$VERSION\]|## [Unreleased]\n\nThese changes are available on the \`$BRANCH\` branch, but have not yet been released.\n\n### Added\n\n### Changed\n\n### Fixed\n\n### Deprecated\n\n### Removed\n\n&|" CHANGELOG.md
159-
sed -i "s|\[unreleased\]:.*|[unreleased]: https://github.com/$REPOSITORY/compare/v$VERSION...HEAD\n[$VERSION]: https://github.com/$REPOSITORY/compare/$(git describe --tags --abbrev=0 @^)...v$VERSION|" CHANGELOG.md
165+
python scripts/release_changelog.py \
166+
--path CHANGELOG.md \
167+
--version "$VERSION" \
168+
--previous-tag "$PREVIOUS_TAG" \
169+
--previous-final-tag "$PREVIOUS_FINAL_TAG" \
170+
--branch "$BRANCH" \
171+
--repository "$REPOSITORY" \
172+
--date "$DATE"
160173
git add CHANGELOG.md
161174
git commit -m "chore(release): update CHANGELOG.md for version $VERSION"
162175
- name: "Commit and Push Changelog to ${{ github.ref_name }}"
@@ -202,7 +215,7 @@ jobs:
202215
python3 -m build --sdist
203216
python3 -m build --wheel
204217
- name: "Create GitHub Release"
205-
uses: softprops/action-gh-release@v2.4.1
218+
uses: softprops/action-gh-release@v2.5.0
206219
id: gh-release
207220
with:
208221
tag_name: "v${{ inputs.version }}"
@@ -235,67 +248,42 @@ jobs:
235248
docs_release:
236249
runs-on: ubuntu-latest
237250
needs: [lib_release, pre_config]
238-
if:
239-
${{ needs.pre_config.outputs.is_rc == 'false' || (needs.pre_config.outputs.is_rc
240-
== 'true' && endsWith(needs.pre_config.outputs.version, '0rc1')) }}
241251
environment: release
242252
steps:
243-
- name: "Sync Versions on Read the Docs"
244-
run: |
245-
curl --location --request POST 'https://readthedocs.org/api/v3/projects/pycord/sync-versions/' \
246-
--header 'Content-Type: application/json' \
247-
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}"
253+
- name: "Checkout repository"
254+
uses: actions/checkout@v6
255+
with:
256+
fetch-depth: 0
257+
fetch-tags: true
248258

249-
- name: "Activate and Show Version on Read the Docs"
259+
- name: "Sync and activate version on Read the Docs"
260+
env:
261+
READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
250262
run: |
251-
VERSION=${{ needs.pre_config.outputs.version }}
252-
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
253-
HIDDEN=$([[ $VERSION == *rc* ]] && echo true || echo false)
254-
if [[ $VERSION == *rc* ]]; then
255-
DOCS_VERSION="v${MAJOR_MINOR_VERSION}.x"
256-
else
257-
DOCS_VERSION="v$VERSION"
258-
fi
259-
curl --location --request PATCH "https://readthedocs.org/api/v3/projects/pycord/versions/$DOCS_VERSION/" \
260-
--header 'Content-Type: application/json' \
261-
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}" \
262-
--data '{
263-
"active": true,
264-
"hidden": $HIDDEN
265-
}'
263+
python3 scripts/release_rtd_versions.py \
264+
--project pycord \
265+
--version "${{ needs.pre_config.outputs.version }}" \
266+
--sync
266267
267268
inform_discord:
268269
runs-on: ubuntu-latest
269270
needs: [docs_release, lib_release, pre_config]
270271
environment: release
271272
steps:
273+
- name: "Checkout repository"
274+
uses: actions/checkout@v6
275+
with:
276+
fetch-depth: 0
277+
fetch-tags: true
278+
272279
- name: "Notify Discord"
273-
run: |
274-
VERSION=${{ needs.pre_config.outputs.version }}
275-
MAJOR_MINOR_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
276-
DOCS_URL="<https://docs.pycord.dev/en/v$VERSION/changelog.html>"
277-
GITHUB_COMPARE_URL="<https://github.com/Pycord-Development/pycord/compare/${{ needs.pre_config.outputs.previous_tag }}...v$VERSION>"
278-
GITHUB_RELEASE_URL="<https://github.com/Pycord-Development/pycord/releases/tag/v$VERSION>"
279-
PYPI_RELEASE_URL="<https://pypi.org/project/py-cord/$VERSION/>"
280-
if [[ $VERSION == *rc* ]]; then
281-
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v$VERSION Release Candidate ($MAJOR_MINOR_VERSION) is available!\n\n"
282-
ANNOUNCEMENT="${ANNOUNCEMENT}@here\n\n"
283-
ANNOUNCEMENT="${ANNOUNCEMENT}This is a pre-release (release candidate) for testing and feedback.\n\n"
284-
ANNOUNCEMENT="${ANNOUNCEMENT}You can view the changelog here: <$DOCS_URL>\n\n"
285-
ANNOUNCEMENT="${ANNOUNCEMENT}Check out the [GitHub changelog]($GITHUB_COMPARE_URL), [GitHub release page]($GITHUB_RELEASE_URL), and [PyPI release page]($PYPI_RELEASE_URL).\n\n"
286-
ANNOUNCEMENT="${ANNOUNCEMENT}You can install this version by running the following command:\n\`\`\`sh\npip install -U py-cord==$VERSION\n\`\`\`\n\n"
287-
ANNOUNCEMENT="${ANNOUNCEMENT}Please try it out and let us know your feedback or any issues!"
288-
else
289-
ANNOUNCEMENT="## <:pycord:1063211537008955495> Pycord v${VERSION} is out!\n\n"
290-
ANNOUNCEMENT="${ANNOUNCEMENT}@everyone\n\n"
291-
ANNOUNCEMENT="${ANNOUNCEMENT}You can view the changelog here: <$DOCS_URL>\n\n"
292-
ANNOUNCEMENT="${ANNOUNCEMENT}Feel free to take a look at the [GitHub changelog]($GITHUB_COMPARE_URL), [GitHub release page]($GITHUB_RELEASE_URL) and the [PyPI release page]($PYPI_RELEASE_URL).\n\n"
293-
ANNOUNCEMENT="${ANNOUNCEMENT}You can install this version by running the following command:\n\`\`\`sh\npip install -U py-cord==$VERSION\n\`\`\`"
294-
fi
295-
curl -H "Content-Type: application/json" \
296-
-X POST \
297-
-d "{\"content\":\"$ANNOUNCEMENT\",\"allowed_mentions\":{\"parse\":[\"everyone\",\"roles\"]}}" \
298-
${{ secrets.DISCORD_WEBHOOK_URL }}
280+
env:
281+
VERSION: ${{ needs.pre_config.outputs.version }}
282+
PREVIOUS_TAG: ${{ needs.pre_config.outputs.previous_tag }}
283+
PREVIOUS_FINAL_TAG: ${{ needs.pre_config.outputs.previous_final_tag }}
284+
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
285+
REPOSITORY: ${{ github.repository }}
286+
run: python scripts/discord_release_notification.py
299287

300288
determine_milestone_id:
301289
runs-on: ubuntu-latest
@@ -330,7 +318,7 @@ jobs:
330318
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
331319
steps:
332320
- name: "Checkout Repository"
333-
uses: actions/checkout@v5
321+
uses: actions/checkout@v6
334322
with:
335323
fetch-depth: 0
336324
fetch-tags: true
@@ -344,7 +332,7 @@ jobs:
344332
- name: "Create New Milestone"
345333
run: |
346334
gh extension install valeriobelli/gh-milestone
347-
gh milestone create "${{ needs.determine_milestone_id.outputs.new_milestone_version }}"
335+
gh milestone create -t "${{ needs.determine_milestone_id.outputs.new_milestone_version }}"
348336
349337
# branch_protection_restore:
350338
# runs-on: ubuntu-latest

.github/workflows/todo-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: "Checkout Repository"
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
- name: "Track TODO Action"
26-
uses: ribtoks/[email protected].15-beta
26+
uses: ribtoks/[email protected].16-beta
2727
with:
2828
TOKEN: ${{ secrets.GITHUB_TOKEN }}
2929
REPO: ${{ github.repository }}

0 commit comments

Comments
 (0)