Skip to content

Commit

Permalink
Merge branch 'babel-list' of https://github.com/Drapersniper/Red-Disc…
Browse files Browse the repository at this point in the history
…ordBot into babel-list

� Conflicts:
�	redbot/core/utils/chat_formatting.py
  • Loading branch information
Drapersniper committed May 28, 2020
2 parents 2e267ee + 6fe8a87 commit 6eaa9ab
Show file tree
Hide file tree
Showing 1,200 changed files with 204,325 additions and 103,384 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ redbot/core/utils/dbtools.py @mikeshardmind
# Cogs
redbot/cogs/admin/* @tekulvw
redbot/cogs/alias/* @tekulvw
redbot/cogs/audio/* @aikaterna @Drapersniper
redbot/cogs/audio/** @aikaterna @Drapersniper
redbot/cogs/bank/* @tekulvw
redbot/cogs/cleanup/* @palmtree5
redbot/cogs/customcom/* @palmtree5
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Support question
url: https://discord.gg/red
about: For any questions regarding on how to operate and run Red.
16 changes: 13 additions & 3 deletions .github/workflows/lint_python.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
name: Lint Python
on: [push, pull_request]
on:
pull_request:
push:
repository_dispatch:
types:
- dispatched_test

env:
ref: ${{ github.event.client_payload.ref || '' }}

jobs:
lint_python:
name: Lint Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
ref: ${{ env.ref }}
- uses: actions/setup-python@v1
with:
python_version: "3.8"
- run: "python -m pip install flake8"
- 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://gitlab.com/pycqa/[email protected]#egg=flake8"
name: Install Flake8
- run: "python -m flake8 . --count --select=E9,F7,F82 --show-source"
name: Flake8 Linting
34 changes: 27 additions & 7 deletions .github/workflows/publish_crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: Publish to Crowdin
on:
push:
tags:
- "*"
schedule:
- cron: '0 12 * * THU'
repository_dispatch:
types: crowdin

env:
CROWDIN_API_KEY: ${{ secrets.crowdin_token}}
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }}

jobs:
deploy:
if: github.repository == 'Cog-Creators/Red-DiscordBot'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -20,9 +26,23 @@ jobs:
sudo apt-get update -qq
sudo apt-get install -y crowdin
pip install redgettext==3.1
- name: Publish
env:
CROWDIN_API_KEY: ${{ secrets.crowdin_token}}
CROWDIN_PROJECT_ID: ${{ secrets.crowdin_identifier }}
- name: Generate source files
run: |
make gettext
- name: Upload source files
run: |
make upload_translations
- name: Download translations
run: |
make download_translations
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Automated Crowdin downstream
title: "[i18n] Automated Crowdin downstream"
body: |
This is an automated PR.
Please ensure that there are no errors or invalid files are in the PR.
labels: "Automated PR, Category: i18n, Changelog Entry: Skipped"
branch: "automated/i18n"
1 change: 1 addition & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

jobs:
deploy:
if: github.repository == 'Cog-Creators/Red-DiscordBot'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Tests
on: [push, pull_request]
on:
pull_request:
push:
repository_dispatch:
types:
- dispatched_test

env:
ref: ${{ github.event.client_payload.ref || '' }}

jobs:
tox:
Expand All @@ -23,6 +31,8 @@ jobs:
name: Tox - ${{ matrix.friendly_name }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.ref }}
- name: Set up Python
uses: actions/setup-python@v1
with:
Expand Down Expand Up @@ -55,6 +65,8 @@ jobs:
POSTGRES_USER: postgres
steps:
- uses: actions/checkout@v2
with:
ref: ${{ env.ref }}
- name: Set up Python
uses: actions/setup-python@v1
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
!/tests/cogs/dataconverter/data/**/*.json
Pipfile
Pipfile.lock
.directory

### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
Expand Down
43 changes: 10 additions & 33 deletions .github/CONTRIBUTING.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
* [4.4 Make](#44-make)
* [4.5 Keeping your dependencies up to date](#45-keeping-your-dependencies-up-to-date)
* [4.6 To contribute changes](#46-to-contribute-changes)
* [4.7 Using towncrier](#47-using-towncrier)
* [4.8 How To Report A Bug](#48-how-to-report-a-bug)
* [4.9 How To Suggest A Feature Or Enhancement](#49-how-to-suggest-a-feature-or-enhancement)
* [4.7 How To Report A Bug](#47-how-to-report-a-bug)
* [4.8 How To Suggest A Feature Or Enhancement](#48-how-to-suggest-a-feature-or-enhancement)
* [5. Code Review Process](#5-code-review-process)
* [5.1 Issues](#51-issues)
* [5.2 Pull Requests](#52-pull-requests)
Expand Down Expand Up @@ -79,7 +78,7 @@ If you're not on Windows, you should also have GNU make installed, and you can o
**Note:** If you're comfortable with setting up virtual environments yourself and would rather do it manually, just run `pip install -Ur tools/dev-requirements.txt` after setting it up.
### 4.2 Testing
We've recently started using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's extremely simple to use, and if you followed the previous section correctly, it is already installed to your virtual environment.
We're using [tox](https://github.com/tox-dev/tox) to run all of our tests. It's extremely simple to use, and if you followed the previous section correctly, it is already installed to your virtual environment.
Currently, tox does the following, creating its own virtual environments for each stage:
- Runs all of our unit tests with [pytest](https://github.com/pytest-dev/pytest) on python 3.8 (test environment `py38`)
Expand All @@ -95,7 +94,7 @@ Your PR will not be merged until all of these tests pass.
### 4.3 Style
Our style checker of choice, [black](https://github.com/ambv/black), actually happens to be an auto-formatter. The checking functionality simply detects whether or not it would try to reformat something in your code, should you run the formatter on it. For this reason, we recommend using this tool as a formatter, regardless of any disagreements you might have with the style it enforces.
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/ambv/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. When using `black` on the command line, simply use it like so: `black -l 99 -N <src>`.
Use the command `black --help` to see how to use this tool. The full style guide is explained in detail on [black's GitHub repository](https://github.com/ambv/black). **There is one exception to this**, however, which is that we set the line length to 99, instead of black's default 88. This is already set in `pyproject.toml` configuration file in the repo so you can simply format code with Black like so: `black <src>`.
### 4.4 Make
You may have noticed we have a `Makefile` and a `make.bat` in the top-level directory. For now, you can do a few things with them:
Expand All @@ -116,39 +115,17 @@ Whenever you pull from upstream (V3/develop on the main repository) and you noti
1. Create a new branch on your fork
2. Make the changes
3. If you like the changes and think the main Red project could use it:
* Create a towncrier entry for the changes. (See next section for details)
* Run tests with `tox` to ensure your code is up to scratch
* Create a Pull Request on GitHub with your changes
- If you are contributing a behavior change, please keep in mind that behavior changes
are conditional on them being appropriate for the project's current goals.
If you would like to reduce the risk of putting in effort for something we aren't
going to use, open an issue discussing it first.
### 4.7 Using towncrier
Red uses towncrier to create changelogs.
To create a towncrier entry for your PR, create a file in `changelog.d` for it. If the changes are for a specific cog, place the file in the related subdirectory.
The filename should be of the format `issuenumber.changetype(.count).rst`, where `(.count)` is an optional
part of the filename should multiple entries for the same issue number and type be necessary.
If there is not an issue associated with your PR,
you may use the PR number in place of the issue number.
Valid changetypes are:
* breaking : Breaking changes
* dep : Changes to dependencies
* enhance : Enhancements
* feature : New features
* bugfix : Bugfixes
* docs : documentation improvements and additions
* removal : removal of something
* misc : any changes which don't have a user facing change, and don't belong in the changelog for users
The contents of the file should be a short, human readable description of the impact of the changes made,
not the technical details of the change.
### 4.8 How To Report A Bug
### 4.7 How To Report A Bug
Please see our **ISSUES.MD** for more information.
### 4.9 How To Suggest A Feature Or Enhancement
### 4.8 How To Suggest A Feature Or Enhancement
The goal of Red is to be as useful to as many people as possible, this means that all features must be useful to anyone and any server that uses Red.
If you find yourself wanting a feature that Red does not already have, you're probably not alone. There's bound to be a great number of users out there needing the same thing and a lot of the features that Red has today have been added because of the needs of our users. Open an issue on our issues list and describe the feature you would like to see, how you would use it, how it should work, and why it would be useful to the Red community as a whole.
Expand Down
12 changes: 4 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ PYTHON ?= python3.8

# Python Code Style
reformat:
$(PYTHON) -m black -l 99 --target-version py38 `git ls-files "*.py"`
$(PYTHON) -m black `git ls-files "*.py"`
stylecheck:
$(PYTHON) -m black --check -l 99 --target-version py38 `git ls-files "*.py"`
$(PYTHON) -m black --check `git ls-files "*.py"`
stylediff:
$(PYTHON) -m black --check --diff `git ls-files "*.py"`

# Translations
gettext:
$(PYTHON) -m redgettext --command-docstrings --verbose --recursive redbot --exclude-files "redbot/pytest/**/*"
upload_translations:
$(MAKE) gettext
crowdin upload sources
download_translations:
crowdin download
Expand All @@ -26,8 +27,3 @@ newenv:
$(MAKE) syncenv
syncenv:
.venv/bin/pip install -Ur ./tools/dev-requirements.txt

# Changelog check
checkchangelog:
bash tools/check_changelog_entries.sh
$(PYTHON) -m towncrier --draft
1 change: 0 additions & 1 deletion changelog.d/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/admin/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/alias/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/audio/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/bank/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/cleanup/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/customcom/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/downloader/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/economy/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/filter/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/general/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/image/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/mod/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/modlog/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/mutes/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/permissions/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/reports/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/streams/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/trivia/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/warnings/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion changelog.d/warnings/3515.misc.rst

This file was deleted.

1 change: 1 addition & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
api_key_env: CROWDIN_API_KEY
project_identifier_env: CROWDIN_PROJECT_ID
base_path: ./redbot/
preserve_hierarchy: true
files:
- source: cogs/**/messages.pot
translation: /%original_path%/%locale%.po
Expand Down
11 changes: 10 additions & 1 deletion docs/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{% extends '!layout.html' %}
{% block document %}
{% if version_slug == 'latest' %}
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">
This document is for Red's development version, which can be significantly different from previous releases.
If you're a regular user, you should read the <a href="{{ dict(versions)['stable'] }}">Red documentation for the current stable release</a>.
</p>
</div>
{% endif %}
{{ super() }}
<a href="https://github.com/Cog-Creators/Red-DiscordBot">
<img style="position: absolute; top: 0; right: 0; border: 0;"
src="https://github.blog/wp-content/uploads/2008/12/forkme_right_darkblue_121621.png?resize=149%2C149"
class="attachment-full size-full" alt="Fork me on GitHub">
</a>
{% endblock %}
{% endblock %}
39 changes: 39 additions & 0 deletions docs/about_venv.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. _about-venvs:

==========================
About Virtual Environments
==========================
Creating a virtual environment is really easy and usually prevents many common installation
problems.

**What Are Virtual Environments For?**

Virtual environments allow you to isolate Red's library dependencies, cog dependencies and python
binaries from the rest of your system. There is no performance overhead to using virtual environment
and it saves you from a lot of troubles during setup. It also makes sure Red and its dependencies
are installed to a predictable location which makes uninstalling Red as simple as removing a single folder,
without worrying about losing your data or other things on your system becoming broken.


--------------------------------------------
Virtual Environments with Multiple Instances
--------------------------------------------
If you are running multiple instances of Red on the same machine, you have the option of either
using the same virtual environment for all of them, or creating separate ones.

.. note::

This only applies for multiple instances of V3. If you are running a V2 instance as well,
you **must** use separate virtual environments.

The advantages of using a *single* virtual environment for all of your V3 instances are:

- When updating Red, you will only need to update it once for all instances (however you will still need to restart all instances for the changes to take effect)
- It will save space on your hard drive

On the other hand, you may wish to update each of your instances individually.

.. important::

Windows users with multiple instances should create *separate* virtual environments, as
updating multiple running instances at once is likely to cause errors.
Loading

0 comments on commit 6eaa9ab

Please sign in to comment.