Skip to content

Commit

Permalink
Merge branch 'master' into patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
JustaSqu1d authored Aug 12, 2024
2 parents 0a0cd4c + f7a80e1 commit c06d396
Show file tree
Hide file tree
Showing 564 changed files with 429,031 additions and 141 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[flake8]
min_python_version = 3.8
min_python_version = 3.9

# Incompatible with black see https://github.com/ambv/black/issues/315
ignore =
Expand Down
8 changes: 7 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
/tests/ @Pycord-Development/maintain-tests
/discord/ext/testing/ @Pycord-Development/maintain-tests
/discord/ext/bridge/ @Pycord-Development/maintain-ext-bridge
/.github/ @Pycord-Development/project-leads
/.github/ @Pycord-Development/maintainers @Lulalaby
/docs/locales/ @Pycord-Development/maintain-translations
/docs/build/locales/ @Pycord-Development/maintain-translations
/.github/workflows/docs-localization-download.yml @Pycord-Development/maintain-translations
/.github/workflows/docs-localization-upload.yml @Pycord-Development/maintain-translations
/crowdin.yml @Pycord-Development/maintain-translations
/requirements/_locale.txt @Pycord-Development/maintain-translations
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Bug Report
description: Report broken or incorrect behaviour
labels: unconfirmed bug
labels: ["unconfirmed bug"]
body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature Request
description: Suggest a feature for this library
labels: feature request
labels: ["feature request"]
body:
- type: input
attributes:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/docs-localization-download.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Multilingual Docs Download

on:
workflow_dispatch:

jobs:
localizse:
permissions: write-all
name: "Localisize Docs"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Install Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run:
sphinx-intl update -p ./build/locales -l de -l ja -l de -l ja -l fr -l it -l
hi -l ko -l pt_BR -l es -l zh_CN -l ru
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: false
download_bundle: ${{ secrets.CROWDIN_BUNDLE_ID }}
localization_branch_name: l10n_master
create_pull_request: true
pull_request_title: "docs: Update localizations from Crowdin"
pull_request_body:
"Crowdin download was triggered due to completely translated file or
project. Starting sync. CC @Lulalaby"
pull_request_base_branch_name: "master"
pull_request_reviewers: "Lulalaby"
config: "crowdin.yml"
base_path: "."
commit_message: "docs: Update localizations from Crowdin"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/docs-localization-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Multilingual Docs Upload

on:
push:
branches:
- master
workflow_dispatch:

jobs:
localizse:
permissions: write-all
name: "Localisize Docs"
runs-on: ubuntu-latest
if:
contains(github.event.head_commit.message, '!crowdin upload') || github.event_name
== 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- name: "Install Python"
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/_locale.txt"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements/_locale.txt
pip install .[speed,voice,docs]
- name: "Get locales"
run: |
make html
sphinx-build -b gettext . ./build/locales
working-directory: ./docs
- name: "Build locales"
run:
sphinx-intl update -p ./build/locales -l de -l ja -l de -l ja -l fr -l it -l
hi -l ko -l pt_BR -l es -l zh_CN -l ru
working-directory: ./docs
- name: "Crowdin"
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: false
download_translations: false
localization_branch_name: l10n_master
create_pull_request: false
config: "crowdin.yml"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }}
11 changes: 4 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# Python 3.8/3.9 are on macos-13 but not macos-latest (macos-14-arm64)
python-version: ["3.9", "3.10", "3.11", "3.12"]
# Python 3.9 are on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.8", os: "macos-latest" }
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.8", os: "macos-13" }
- { python-version: "3.9", os: "macos-13" }

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
Expand Down Expand Up @@ -58,10 +55,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"
cache: "pip"
cache-dependency-path: "requirements/docs.txt"
check-latest: true
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
SHA: ${{ github.sha }}
REF: ${{ github.ref }}
COMMENT_ON_ISSUES: true
EXCLUDE_PATTERN: "\\.(doctree|doctrees|pickle)$"
4 changes: 3 additions & 1 deletion .github/workflows/version-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ permissions:
jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
if:
${{ github.actor == 'dependabot[bot]' || github.actor == 'crowdin-bot' ||
github.actor == 'Crowdin Bot' }}
steps:
- run: gh pr review --approve "$PR_URL"
env:
Expand Down
35 changes: 20 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ __pycache__/

# Distribution / packaging
.Python
build/
./build/
./_build/
develop-eggs/
dist/
downloads/
Expand Down Expand Up @@ -51,10 +52,6 @@ coverage.xml
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
Expand Down Expand Up @@ -165,17 +162,16 @@ cython_debug/
*.egg-info
.venv/
docs/_build
docs/crowdin.py
*.buildinfo
*.mp3
*.m4a
*.wav
*.mp4
*.ogg
*.pcm
*.png
*.jpg
*.flac
!*.mp3
!*.m4a
!*.wav
!*.mp4
!*.ogg
!*.pcm
!*.png
!*.jpg
!*.flac
.vs/
.DS_Store
__pycache__
Expand All @@ -186,3 +182,12 @@ node_modules/*

# changelog is autogenerated from CHANGELOG.md
docs/changelog.md

# Translations
docs/build/html
docs/build/doctrees
!docs/build/locales/*
*.mo
!docs/locales/*
/build/
/vscode/
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ repos:
rev: v4.6.0
hooks:
- id: trailing-whitespace
exclude: \.(po|pot)$
- id: end-of-file-fixer
exclude: \.(po|pot)$
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
Expand All @@ -19,19 +21,21 @@ repos:
# - --remove-duplicate-keys
# - --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: [--py38-plus]
exclude: \.(po|pot)$
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
exclude: \.(po|pot)$
- repo: https://github.com/psf/black
rev: 24.4.2
rev: 24.8.0
hooks:
- id: black
args: [--safe, --quiet]
exclude: \.(po|pot)$
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker
rev: v1.1.3
hooks:
Expand Down Expand Up @@ -81,10 +85,12 @@ repos:
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
exclude: \.(po|pot)$
- repo: https://github.com/DanielNoord/pydocstringformatter
rev: v0.7.3
hooks:
- id: pydocstringformatter
exclude: \.(po|pot)$
args:
[
--style=numpydoc,
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ formats: []
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.12"

sphinx:
configuration: docs/conf.py
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ possible (see our [Version Guarantees] for more info).

These changes are available on the `master` branch, but have not yet been released.

⚠️ **This Version Removes Support For Python 3.8** ⚠️

### Changed

- Renamed `cover` property of `ScheduledEvent` and `cover` argument of
`ScheduledEvent.edit` to `image`.
([#2496](https://github.com/Pycord-Development/pycord/pull/2496))
- ⚠️ **This Version Removes Support For Python 3.8** ⚠️
([#2521](https://github.com/Pycord-Development/pycord/pull/2521))

### Added

Expand Down
11 changes: 10 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Pycord
.. image:: https://img.shields.io/github/v/release/Pycord-Development/pycord?include_prereleases&label=Latest%20Release&logo=github&sort=semver&style=for-the-badge&logoColor=white
:target: https://github.com/Pycord-Development/pycord/releases
:alt: Latest release
.. image:: https://badges.crowdin.net/badge/dark/crowdin-on-light.png
:target: https://translations.pycord.dev/documentation/?utm_source=badge&utm_medium=referral&utm_campaign=badge-add-on
:alt: Crowdin | Agile localization for tech companies

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

Expand All @@ -30,7 +33,7 @@ Key Features
Installing
----------

**Python 3.8 or higher is required**
**Python 3.9 or higher is required**

To install the library without full voice support, run the following command:

Expand Down Expand Up @@ -141,3 +144,9 @@ Useful Links
- `Learn how to create Discord bots with Pycord <https://guide.pycord.dev>`_
- `Our Official Discord Server <https://pycord.dev/discord>`_
- `Official Discord Developers Server <https://discord.gg/discord-developers>`_

Translations
------------

.. image:: https://badges.awesome-crowdin.com/translation-200034237-5.png
:alt: Translation Status
19 changes: 19 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
base_path: "docs/build/locales"
base_url: "https://pycord.crowdin.com"

preserve_hierarchy: true

commit_message: "docs: Update translations"

export_languages: ["de", "ja", "fr", "it", "hi", "ko", "pt-BR", "es-ES", "zh-CN"]

bundles:
- 1

files:
[
{
source: "**/*.pot",
translation: "/docs/locales/%two_letters_code%/LC_MESSAGES/%original_path%/%file_name%.po",
},
]
2 changes: 1 addition & 1 deletion discord/audit_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class AuditLogDiff:
def __len__(self) -> int:
return len(self.__dict__)

def __iter__(self) -> Generator[tuple[str, Any], None, None]:
def __iter__(self) -> Generator[tuple[str, Any]]:
yield from self.__dict__.items()

def __repr__(self) -> str:
Expand Down
2 changes: 1 addition & 1 deletion discord/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ def inner(cls: type[SlashCommandGroup]) -> SlashCommandGroup:

slash_group = group

def walk_application_commands(self) -> Generator[ApplicationCommand, None, None]:
def walk_application_commands(self) -> Generator[ApplicationCommand]:
"""An iterator that recursively walks through all application commands and subcommands.
Yields
Expand Down
Loading

0 comments on commit c06d396

Please sign in to comment.