Skip to content

Commit

Permalink
Merge branch 'master' into docs/sphinx-warns-and-errors
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaSqu1d authored Aug 19, 2024
2 parents d3514a9 + 8a09b89 commit 3cfbeac
Show file tree
Hide file tree
Showing 25 changed files with 168 additions and 158 deletions.
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ updates:
major-version-bumps:
update-types: ["major"]
schedule:
interval: "weekly"
interval: "daily"
commit-message:
prefix: "chore"
prefix-development: "chore"
Expand All @@ -25,7 +25,7 @@ updates:
major-version-bumps:
update-types: ["major"]
schedule:
interval: "weekly"
interval: "daily"
commit-message:
prefix: "ci"
include: "scope"
7 changes: 6 additions & 1 deletion .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ on:
- "*.toml"
- "*.py"
workflow_dispatch:
inputs:
with_linkcheck:
type: boolean
description: "Whether to run the linkcheck"
default: true
schedule:
- cron: "0 0 * * *"

Expand Down Expand Up @@ -44,7 +49,7 @@ jobs:
python -m pip install -U pip
pip install ".[docs]"
- name: "Check Links"
if: ${{ github.event_name == 'schedule' }}
if: ${{ github.event_name == 'schedule' || inputs.with_linkcheck }}
run: |
cd docs
make linkcheck
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "Read The Docs Localization"

on:
push:
branches: [master]
paths:
- "discord/**"
- "docs/**"
workflow_dispatch:
schedule:
- cron: "0 0 * * 1"

permissions: write-all

jobs:
localization_builds:
runs-on: ubuntu-latest
environment: documentation
strategy:
matrix:
rdt_projects: [
"pycord-spanish",
"pycord-japanese",
"pycord-brazilian",
"pycord-russian",
"pycord-german",
"pycord-hindi",
"pycord-korean",
"pycord-italian",
"pycord-chinese",
"pycord-french"
]
steps:
- name: "Trigger RDT ${{ matrix.rdt_projects }}"
run: |
PROJECT=${{ matrix.rdt_projects }}
curl --location --request POST "https://readthedocs.org/api/v3/projects/$PROJECT/versions/master/builds/" \
--header 'Content-Type: application/json' \
--header "Authorization: Token ${{ secrets.READTHEDOCS_TOKEN }}"
186 changes: 73 additions & 113 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
environment: release
steps:
- name: "Security Check"
uses: pycord-development/[email protected].5
uses: Aiko-IT-Systems/[email protected].0
with:
whitelisted-github-ids: ${{ vars.ALLOWED_USER_IDS }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -25,19 +25,23 @@ jobs:
needs: [safety_check]
outputs:
branch_name: ${{ steps.determine_vars.outputs.branch_name }}
is_rc: ${{ steps.determine_vars.outputs.version }}
version: ${{ steps.determine_vars.outputs.is_rc }}
is_rc: ${{ steps.determine_vars.outputs.is_rc }}
version: ${{ steps.determine_vars.outputs.version }}
previous_tag: ${{ steps.determine_vars.outputs.previous_tag }}
runs-on: ububtu-latest
runs-on: ubuntu-latest
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: "Determine Push Branch"
id: determine_vars
env:
VERSION: ${{ github.event.inputs.version }}
run: |
VERSION=${{ github.event.inputs.version }}
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^)
echo "previous_tag=${PREVIOUS_TAG}" >> $GITHUB_OUTPUT
if [[ $VERSION =~ -rc ]]; then
Expand All @@ -63,79 +67,27 @@ jobs:
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4

- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_release.txt"

- name: "Install Release Dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements/_release.txt
- name: "Prepare and Update CHANGELOG.md"
run: |
VERSION=${{ needs.pre_config.outputs.version }}
DATE=$(date +'%Y-%m-%d')
sed -i "s/## \[Unreleased\]/## [$VERSION] - $DATE/" CHANGELOG.md
sed -i "0,/## \[$VERSION\]/ s|## \[$VERSION\]|## [Unreleased]\n\n### Added\n\n### Changed\n\n### Fixed\n\n### Removed\n\n$&|" CHANGELOG.md
sed -i "s|\[Unreleased\]:.*|[Unreleased]: https://github.com/Pycord-Development/pycord/compare/v$VERSION...HEAD\n[$VERSION]: https://github.com/Pycord-Development/pycord/compare/v$(git describe --tags --abbrev=0 @^)...v$VERSION|" CHANGELOG.md
echo "[Unreleased]: https://github.com/Pycord-Development/pycord/compare/v$VERSION...HEAD" >> CHANGELOG.md
git add CHANGELOG.md
git commit -m "chore(release): update CHANGELOG for version $VERSION"
- name: "Commit and Push Changelog to Master"
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add CHANGELOG.md
git commit -m "chore(release): update CHANGELOG for version ${{ needs.pre_config.outputs.version }}"
git push origin HEAD:master
- name: "Push Changelog to Version Branch"
run: |
git push origin HEAD:${{ needs.pre_config.outputs.branch_name }}
- name: "Create Git Tag"
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
VERSION=${{ needs.pre_config.outputs.version }}
git tag -s v$VERSION -m "Release version $VERSION"
git push origin v$VERSION
- name: "Verify Version"
run: python -m setuptools_scm

- name: "Build Package"
run: |
python3 -m build --sdist
python3 -m build --wheel
fetch-depth: 0
fetch-tags: true

- name: "Create GitHub Release"
uses: softprops/[email protected]
- name: "Release Pycord"
id: pycord-release
uses: Aiko-IT-Systems/[email protected]
with:
tag_name: "v${{ needs.pre_config.outputs.version }}"
name: "v${{ needs.pre_config.outputs.version }}"
generate_release_notes: true
draft: false
prerelease: ${{ needs.pre_config.outputs.is_rc == 'true' }}
files: |
dist/*.whl
dist/*.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
make_latest: true
github-token: ${{ secrets.GITHUB_TOKEN }}
pypi-token: ${{ secrets.PYPI_TOKEN }}
version-branch-name: ${{ needs.pre_config.outputs.branch_name }}
ref: ${{ github.ref_name }}
repository: ${{ github.repository }}
python-version: "3.12"
release-requirements: "requirements/_release.txt"
version: ${{ needs.pre_config.outputs.version }}
is-rc: ${{ needs.pre_config.outputs.is_rc }}
pypi-package: "py-cord"

- name: "Publish package distributions to PyPI"
uses: pypa/[email protected]
env:
name: pypi
url: https://pypi.org/p/pycord
with:
password: ${{ secrets.PYPI_TOKEN }}
- name: "Echo release url"
run: echo "${{ steps.pycord-release.outputs.gh-release }}"

docs_release:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -167,44 +119,6 @@ jobs:
"hidden": false
}'
determine_milestone_id:
runs-on: ubuntu-latest
needs: [lib_release,docs_release,pre_config]
if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }}
outputs:
milestone_version: ${{ steps.extract_version.outputs.milestone_version }}
environment: release
steps:
- name: "Extract Milestone Version"
id: extract_version
run: |
VERSION=${{ needs.pre_config.outputs.version }}
MILESTONE_VERSION=$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')
echo "milestone_version=$MILESTONE_VERSION" >> $GITHUB_OUTPUT
close_milestone:
runs-on: ubuntu-latest
needs: [determine_milestone_id,pre_config]
if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }}
environment: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Close Milestone"
run: gh milestone edit "v${{ needs.determine_milestone_id.outputs.milestone_version }}" --state closed

- name: "Create New Milestone"
run: |
NEW_MILESTONE_VERSION=$(echo ${{ needs.determine_milestone_id.outputs.milestone_version }} | awk -F. '{print $1"."$2+1}')
gh milestone create "v${NEW_MILESTONE_VERSION}"
- name: "Move Open Issues and PRs"
run: |
gh issue list --milestone "v${{ needs.determine_milestone_id.outputs.milestone_version }}" --state open | while read issue
do
gh issue edit $issue --milestone "v${NEW_MILESTONE_VERSION}"
done
inform_discord:
runs-on: ubuntu-latest
needs: [lib_release,docs_release,close_milestone,pre_config]
Expand All @@ -227,3 +141,49 @@ jobs:
-X POST \
-d "{\"content\":\"$ANNOUNCEMENT\"}" \
${{ secrets.DISCORD_WEBHOOK_URL }}
determine_milestone_id:
runs-on: ubuntu-latest
needs: [lib_release,pre_config]
if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }}
outputs:
old_milestone_version: ${{ steps.extract_version.outputs.old_milestone_version }}
new_milestone_version: ${{ steps.extract_version.outputs.new_milestone_version }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment: release
steps:
- name: "Extract Milestone Version"
id: extract_version
run: |
gh extension install valeriobelli/gh-milestone
VERSION=${{ needs.pre_config.outputs.version }}
OLD_MILESTONE_VERSION=$(gh milestone list --query "v2.7" | grep "#" | awk '{print $2}')
NEW_MILESTONE_VERSION="v$(echo $VERSION | grep -oE '^[0-9]+\.[0-9]+')"
echo "old_milestone_version=$OLD_MILESTONE_VERSION" >> $GITHUB_OUTPUT
echo "new_milestone_version=$NEW_MILESTONE_VERSION" >> $GITHUB_OUTPUT
close_milestone:
runs-on: ubuntu-latest
needs: [determine_milestone_id,pre_config]
if: ${{ !contains(needs.pre_config.outputs.version, '-') && endsWith(needs.pre_config.outputs.version, '.0') }}
environment: release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout Repository"
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: "Close Milestone"
run: |
gh extension install valeriobelli/gh-milestone
OLD_MILESTONE_ID=$(gh milestone list --query "${{ needs.determine_milestone_id.outputs.old_milestone_version }}" | grep "#" | cut -d' ' -f2 | cut -d '#' -f2)
gh milestone edit $OLD_MILESTONE_ID --state closed
- name: "Create New Milestone"
run: |
gh extension install valeriobelli/gh-milestone
gh milestone create "${{ needs.determine_milestone_id.outputs.new_milestone_version }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ docs/changelog.md
# Translations
docs/build/html
docs/build/doctrees
docs/build/linkcheck
!docs/build/locales/*
*.mo
!docs/locales/*
Expand Down
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ These changes are available on the `master` branch, but have not yet been releas
([#2185](https://github.com/Pycord-Development/pycord/pull/2185))
- Fixed inaccurate `Union` type hint of `values` argument of `basic_autocomplete` to
include `Iterable[OptionChoice]`.
([#2164](https://github.com/Pycord-Development/pycord/pull/2164))
- Fixed initial message inside of the create thread payload sending legacy beta payload.
([#2191](https://github.com/Pycord-Development/pycord/pull/2191))
- Fixed a misplaced payload object inside of the thread creation payload.
Expand Down Expand Up @@ -654,7 +653,7 @@ These changes are available on the `master` branch, but have not yet been releas

- Fix `VoiceChannel`/`CategoryChannel` data being invalidated on `Option._invoke`.
([#1490](https://github.com/Pycord-Development/pycord/pull/1490))
- Fix type issues in options.py
- Fix type issues in `options.py`
([#1473](https://github.com/Pycord-Development/pycord/pull/1473))
- Fix KeyError on AutoModActionExecution when the bot lacks the Message Content Intent.
([#1521](https://github.com/Pycord-Development/pycord/pull/1521))
Expand Down Expand Up @@ -905,7 +904,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#1240](https://github.com/Pycord-Development/pycord/pull/1240))

[unreleased]: https://github.com/Pycord-Development/pycord/compare/v2.6.0...HEAD
[2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...2.6.0
[2.6.0]: https://github.com/Pycord-Development/pycord/compare/v2.5.0...v2.6.0
[2.5.0]: https://github.com/Pycord-Development/pycord/compare/v2.4.1...v2.5.0
[2.4.1]: https://github.com/Pycord-Development/pycord/compare/v2.4.0...v2.4.1
[2.4.0]: https://github.com/Pycord-Development/pycord/compare/v2.3.3...v2.4.0
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.. image:: https://raw.githubusercontent.com/Pycord-Development/pycord-next/main/docs/assets/pycord-v3.png
:alt: Pycord v3

Pycord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python.

======
Expand Down
2 changes: 1 addition & 1 deletion discord/guild.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class Guild(Hashable):
features: List[:class:`str`]
A list of features that the guild has. The features that a guild can have are
subject to arbitrary change by Discord. You can find a catalog of guild features
`here <https://github.com/Delitefully/DiscordLists#guild-feature-glossary>`_.
`here <https://github.com/Delitefully/DiscordLists?tab=readme-ov-file#guild-feature-glossary>`_.
premium_tier: :class:`int`
The premium tier for this guild. Corresponds to "Nitro Server" in the official UI.
The number goes from 0 to 3 inclusive.
Expand Down
2 changes: 1 addition & 1 deletion docs/build/locales/api/models.pot
Original file line number Diff line number Diff line change
Expand Up @@ -7434,7 +7434,7 @@ msgstr ""

#: ../../../discord/guild.py:docstring of discord.guild.Guild:141
#: 96094a79a794453ca947a68e85a7ac9d
msgid "A list of features that the guild has. The features that a guild can have are subject to arbitrary change by Discord. You can find a catalog of guild features `here <https://github.com/Delitefully/DiscordLists#guild-feature-glossary>`_."
msgid "A list of features that the guild has. The features that a guild can have are subject to arbitrary change by Discord. You can find a catalog of guild features `here <https://github.com/Delitefully/DiscordLists?tab=readme-ov-file#guild-feature-glossary>`_."
msgstr ""

#: ../../../discord/automod.py:docstring of discord.automod.AutoModTriggerMetadata:29
Expand Down
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,8 +480,15 @@ def write_new():
r"https://discord.com/developers/docs/.*#",
r"https://support(?:-dev)?.discord.com/hc/en-us/articles/.*",
r"https://dis.gd/contact",
r"https://guide.pycord.dev/",
r"https://guide.pycord.dev/.*",
r"https://pycord.dev/",
r"https://pycord.dev/.*",
r"https://packages.debian.org/.*",
]

linkcheck_anchors_ignore_for_url = [r"https://github.com/Delitefully/DiscordLists"]

modindex_common_prefix = ["discord."]
suppress_warnings = ["ref.duplicate"]
myst_enable_extensions = [
Expand Down
Loading

0 comments on commit 3cfbeac

Please sign in to comment.