Skip to content

Commit

Permalink
Merge branch 'V3/develop' into pr/fix/user-installable-ignore-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Flame442 authored Feb 2, 2025
2 parents b3a2512 + 8e0948d commit 41d366f
Show file tree
Hide file tree
Showing 31 changed files with 314 additions and 169 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
- any:
- redbot/core/_drivers/**/*
- "!redbot/core/_drivers/**/locales/*"
- redbot/core/_config.py
- redbot/core/config.py
# Docs
- docs/framework_config.rst
Expand Down Expand Up @@ -215,6 +216,7 @@
- redbot/core/commands/help.py
"Category: Core - i18n":
# Source
- redbot/core/_i18n.py
- redbot/core/i18n.py
# Locale files
- redbot/**/locales/*
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_label_pattern_exhaustiveness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -34,14 +34,13 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: 'python'
# Override the default behavior so that the action doesn't attempt
# to auto-install Python dependencies
# Learn more...
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#analyzing-python-dependencies
setup-python-dependencies: false

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -55,4 +54,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 1 addition & 1 deletion .github/workflows/crowdin_upload_strings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: github.repository == 'Cog-Creators/Red-DiscordBot'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Lint Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
- uses: actions/setup-python@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
needs: pr_stable_bump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
milestone_number: ${{ steps.get_milestone_number.outputs.result }}
steps:
# Checkout repository and install Python
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout repository and install Python
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
name: Build package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -75,7 +75,7 @@ jobs:
run: python -m twine check dist/*

- name: Upload packaged distributions
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-output
path: ./dist
Expand All @@ -84,7 +84,7 @@ jobs:
name: Generate default application.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -102,7 +102,7 @@ jobs:
python .github/workflows/scripts/get_default_ll_server_config.py "release_assets/$APP_YML_FILE"
- name: Upload default application.yml
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ll-default-server-config
path: ./release_assets
Expand All @@ -120,13 +120,13 @@ jobs:
id-token: write
steps:
- name: Download packaged distributions
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build-output
path: dist/

- name: Download default application.yml
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ll-default-server-config
path: release_assets/
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
run: |
echo "BASE_BRANCH=${TAG_BASE_BRANCH#'refs/heads/'}" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.BASE_BRANCH }}
- name: Set up Python
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/run_pip_compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- macos-latest
steps:
- name: Checkout the repository.
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.8.
uses: actions/setup-python@v4
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
python .github/workflows/scripts/compile_requirements.py
- name: Upload requirements files.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.compile_requirements.outputs.sys_platform }}
path: requirements/${{ steps.compile_requirements.outputs.sys_platform }}-*.txt
Expand All @@ -59,7 +59,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository.
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.8.
uses: actions/setup-python@v4
Expand All @@ -71,17 +71,17 @@ jobs:
python -m pip install -U "packaging>=22.0"
- name: Download Windows requirements.
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: win32
path: requirements
- name: Download Linux requirements.
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: linux
path: requirements
- name: Download macOS requirements.
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: darwin
path: requirements
Expand All @@ -91,7 +91,7 @@ jobs:
python .github/workflows/scripts/merge_requirements.py
- name: Upload merged requirements files.
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: merged
path: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
fail-fast: false
name: Tox - ${{ matrix.friendly_name }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
- name: Set up Python
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ env.ref }}
- name: Set up Python
Expand Down
6 changes: 6 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ build:
os: "ubuntu-22.04"
tools:
python: "3.8"
jobs:
install:
- pip install .[doc]

sphinx:
configuration: docs/conf.py

python:
install:
Expand Down
17 changes: 14 additions & 3 deletions redbot/cogs/audio/core/commands/llset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
from redbot.core import commands
from redbot.core.data_manager import cog_data_path
from redbot.core.i18n import Translator
from redbot.core.utils.chat_formatting import box, inline
from redbot.core.utils.chat_formatting import box, humanize_list, inline

from ..abc import MixinMeta
from ..cog_utils import CompositeMetaClass
from ...managed_node import version_pins
from ...utils import (
MAX_JAVA_RAM,
DEFAULT_LAVALINK_YAML,
Expand All @@ -29,6 +30,16 @@
_ = Translator("Audio", Path(__file__))


class LavalinkSetupJavaCommand(commands.Command):
def format_text_for_context(self, ctx: commands.Context, text: str) -> str:
text = super().format_text_for_context(ctx, text)
return text.format(
supported_java_versions=humanize_list(
list(map(str, version_pins.SUPPORTED_JAVA_VERSIONS))
),
)


class LavalinkSetupCommands(MixinMeta, metaclass=CompositeMetaClass):
@commands.group(name="llset")
@commands.is_owner()
Expand All @@ -43,15 +54,15 @@ async def command_llset(self, ctx: commands.Context):
All the commands in here have the potential to break the Audio cog.
"""

@command_llset.command(name="java")
@command_llset.command(name="java", cls=LavalinkSetupJavaCommand)
@has_managed_server()
async def command_llset_java(self, ctx: commands.Context, *, java_path: str = "java"):
"""Change your Java executable path.
This command shouldn't need to be used most of the time, and is only useful if the host machine has conflicting Java versions.
If changing this make sure that the Java executable you set is supported by Audio.
The current supported versions are Java 17 and 11.
The current supported versions are Java {supported_java_versions}.
Enter nothing or "java" to reset it back to default.
"""
Expand Down
9 changes: 7 additions & 2 deletions redbot/cogs/audio/core/events/dpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from redbot.core.utils.chat_formatting import box, humanize_list, underline, bold

from ...errors import TrackEnqueueError, AudioError
from ...managed_node import version_pins
from ..abc import MixinMeta
from ..cog_utils import CompositeMetaClass

Expand Down Expand Up @@ -87,7 +88,7 @@
"This command will change the executable path of Java, "
"this is useful if you have multiple installations of Java and the default one is causing issues. "
"Please don't change this unless you are certain that the Java version you are specifying is supported by Red. "
"The default and supported versions are currently Java 17 and 11."
"The supported versions are currently Java {supported_java_versions}."
),
"command_llset_heapsize": _(
"This command will change the maximum RAM allocation for the managed Lavalink node, "
Expand Down Expand Up @@ -279,7 +280,11 @@ async def cog_before_invoke(self, ctx: commands.Context) -> None:
"If you wish to continue, enter this case sensitive token without spaces as your next message."
"\n\n{confirm_token}"
).format(
template=_(DANGEROUS_COMMANDS[ctx.command.callback.__name__]),
template=_(DANGEROUS_COMMANDS[ctx.command.callback.__name__]).format(
supported_java_versions=humanize_list(
list(map(str, version_pins.SUPPORTED_JAVA_VERSIONS))
),
),
confirm_token=box(confirm_token, lang="py"),
)
sent = await ctx.send(message)
Expand Down
5 changes: 2 additions & 3 deletions redbot/cogs/audio/managed_node/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@

from .ll_server_config import generate_server_config, get_default_server_config
from .ll_version import LAVALINK_BUILD_LINE, LavalinkOldVersion, LavalinkVersion
from .version_pins import JAR_VERSION, YT_PLUGIN_VERSION
from . import version_pins

__all__ = (
"generate_server_config",
"get_default_server_config",
"LAVALINK_BUILD_LINE",
"LavalinkOldVersion",
"LavalinkVersion",
"JAR_VERSION",
"YT_PLUGIN_VERSION",
"version_pins",
)
16 changes: 13 additions & 3 deletions redbot/cogs/audio/managed_node/version_pins.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
from typing import Final
from typing import Final, Tuple

from .ll_version import LavalinkVersion

__all__ = ("JAR_VERSION", "YT_PLUGIN_VERSION")
__all__ = (
"JAR_VERSION",
"YT_PLUGIN_VERSION",
"SUPPORTED_JAVA_VERSIONS",
"LATEST_SUPPORTED_JAVA_VERSION",
"OLDER_SUPPORTED_JAVA_VERSIONS",
)


JAR_VERSION: Final[LavalinkVersion] = LavalinkVersion(3, 7, 12, red=1)
YT_PLUGIN_VERSION: Final[str] = "1.11.2"
YT_PLUGIN_VERSION: Final[str] = "1.11.4"
# keep this sorted from oldest to latest
SUPPORTED_JAVA_VERSIONS: Final[Tuple[int, ...]] = (11, 17)
LATEST_SUPPORTED_JAVA_VERSION: Final = SUPPORTED_JAVA_VERSIONS[-1]
OLDER_SUPPORTED_JAVA_VERSIONS: Final[Tuple[int, ...]] = SUPPORTED_JAVA_VERSIONS[:-1]
Loading

0 comments on commit 41d366f

Please sign in to comment.