Skip to content

Commit

Permalink
Merge branch 'V3/develop' into V3/enhancement/streams_twitchteams
Browse files Browse the repository at this point in the history
  • Loading branch information
palmtree5 authored Nov 20, 2024
2 parents ec5e70a + 33e0eac commit 8185863
Show file tree
Hide file tree
Showing 406 changed files with 35,182 additions and 27,262 deletions.
2 changes: 2 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@
"Category: Core - API - App Commands Package":
# Source
- redbot/core/app_commands/*
# Docs
- docs/framework_app_commands.rst
# Tests
- tests/core/test_app_commands.py
"Category: Core - API - Commands Package":
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint_python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- run: "python -m pip install git+https://github.com/pycqa/pyflakes@1911c20#egg=pyflakes git+https://github.com/pycqa/pycodestyle@d219c68#egg=pycodestyle git+https://github.com/pycqa/[email protected]#egg=flake8"
- run: >
python -m pip install
'pyflakes @ https://github.com/pycqa/pyflakes/tarball/1911c20'
'pycodestyle @ https://github.com/pycqa/pycodestyle/tarball/d219c68'
'flake8 @ https://github.com/pycqa/flake8/tarball/3.7.9'
name: Install Flake8
- run: "python -m flake8 . --count --select=E9,F7,F82 --show-source"
name: Flake8 Linting
41 changes: 41 additions & 0 deletions .github/workflows/publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,43 @@ jobs:
name: build-output
path: ./dist

generate_default_ll_server_config:
name: Generate default application.yml
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'

- name: Install script's dependencies
run: python -m pip install PyYAML

- name: Generate default application.yml
env:
APP_YML_FILE: "Red-DiscordBot-${{ github.ref_name }}-default-lavalink-application.yml"
run: |
mkdir -p release_assets
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
with:
name: ll-default-server-config
path: ./release_assets

release_to_pypi:
needs:
- release_information
- build
- generate_default_ll_server_config
environment: Release
name: Release to PyPI
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Download packaged distributions
Expand All @@ -96,6 +125,18 @@ jobs:
name: build-output
path: dist/

- name: Download default application.yml
uses: actions/download-artifact@v3
with:
name: ll-default-server-config
path: release_assets/

- name: Upload dists to GitHub Release
env:
GITHUB_TOKEN: "${{ github.token }}"
run: |
gh release upload "$GITHUB_REF_NAME" dist/* release_assets/* --repo "$GITHUB_REPOSITORY"
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/scripts/get_default_ll_server_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import sys
from pathlib import Path

import yaml

ROOT_FOLDER = Path(__file__).parents[3].absolute()
AUDIO_FOLDER = ROOT_FOLDER / "redbot/cogs/audio"

# We want to import `redbot.cogs.audio.managed_node` package as if it were top-level package
# so we have to the `redbot/cogs/audio` directory to Python's path.
sys.path.insert(0, str(AUDIO_FOLDER))


def main() -> int:
try:
output_file = sys.argv[1]
except IndexError:
print("Usage:", sys.argv[0], "<output_file>", file=sys.stderr)
return 2

import managed_node

server_config = managed_node.get_default_server_config()
with open(output_file, "w", encoding="utf-8") as fp:
yaml.safe_dump(server_config, fp)

return 0


if __name__ == "__main__":
raise SystemExit(main())
9 changes: 0 additions & 9 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ unsafe-load-any-extension=no
# run arbitrary code
extension-pkg-whitelist=

# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality.
optimize-ast=no


[MESSAGES CONTROL]

Expand Down Expand Up @@ -66,7 +58,6 @@ disable=C, # black is enforcing this for us already, incompatibly
[REPORTS]

output-format=parseable
files-output=no
reports=no


Expand Down
Loading

0 comments on commit 8185863

Please sign in to comment.