1205 Commits

Author SHA1 Message Date
Michael H
02bb1fc390
add apsw-wheels to deps (#3192) 2019-12-20 01:51:33 -05:00
Michael H
e32eecd6e7
[Docs] Update windows deps instructions (#3188)
* update windows deps instructions

* changelog

* be more explicit that manual dependency handling is an excersice left to the reader

* let's only grab the MSVC C++ stuff here...

* Meh

* update language

* Update install_windows.rst

* it's really that easy
2019-12-14 21:00:08 -05:00
jack1142
988536f96b [Downloader] Possible solution for "partial" unload of cog in [p]cog uninstall (#3180)
* Update downloader.py

* Create 3180.bugfix.rst

* Rename 3180.bugfix.rst to 3179.bugfix.rst

* Update redbot/cogs/downloader/downloader.py

Co-Authored-By: Michael H <michael@michaelhall.tech>
2019-12-11 18:28:52 -05:00
jack1142
335ded674e [Core] Add Python executable field to [p]debuginfo command (#3184)
* Update core_commands.py

* Create 3184.enhance.rst
2019-12-11 16:40:27 -05:00
jack1142
b6ae7a6d21 [Core] Add redbot --debuginfo flag (#3183)
* [Core] Add `redbot --debuginfo` flag

* Update cli.py

* Create 3183.enhance.rst

* Update __main__.py

* Update __main__.py
2019-12-11 15:49:57 -05:00
Draper
c67b6cd443 [Audio] Say no to busylooping :Awesome: (#3176)
* Say no to busylooping :Awesome:

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* chrore

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* black y u do dis 2 me

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Return regardless if error is raised here
2019-12-09 20:26:26 -05:00
Flame442
8cba47f382 Fixed [p]announce failing due to errors messaging the owner. (#3166)
* Fixed owner message behavior

* Create 3166.bugfix.rst

* Reduce messages

* Fix plurality
2019-12-08 18:04:57 -05:00
Vexed
203cde9805 Slightly reword installation guide to attempt to stop people using dev (#3079)
* create

* add the code

* change de logs

* lets remember linux exists

* fix formtting and change wording

* change the wording a bit more... after running `sphinx-build` it def looks like i used bold a lot

god that was a long commit mesage

* review changes

* draper's review (see description)

i have put or worse partially to scare users and partially as there are other possible effects of a downgrade

* review

* clarity
2019-12-08 18:02:40 -05:00
Tomas S
064d97f87b [Downloader] Catch and handle erorr in update_all when target repository/branch is missing (#3080)
* [Downloader] Catch and handle erorr in update_all when target repository/branch is removed from remote

* Rewrite fix, remove ctx from repo_manager, edit docstring, add annotations

* Text formatting

* Group failed repo messages into padded table, catch single updated repo fails

* Error catching v2; repo_manager design change

* Docstrings, typos and changelog

* Add Optional to update_repos annotatition

* Wrong logic

* Clear-er log message.

* add format_failed_repos, change _repo_update for failed messages

* Merge cog updating with fail repo logic; Filter out failed repos

* Merge cog updating with fail repo logic; Cog updating logic shuffled to support sending fails at the end

* Docstring typo

* format_failed_repos - proper docstring

* repo_manager.update_repos argument name fix

* downloader._cog_checkforupdates added missed failed message

* downloader._cog_update_logic place back return on some errors

* Purge unused stuff from downloader._repo_update

* downloader._cog_update_logic Change exception catching

* _cog_update_logic purging obsolete

* Remove obsolete 'message' from _cog_checkforupdates

* Fix forgotten ctx.send

* Wording

* Removed obsolete 'message'

* Fix wrong type hint in , update docstring

* repo update logic fix

* format_failed_repos type hint and docstring repair

* Extend _get_cogs_to_check with 'update_repos'

* Fix type mangling in _get_cogs_to_check

* fix: typo

Co-Authored-By: jack1142 <6032823+jack1142@users.noreply.github.com>

* _repo_update; Added single repo up-to-date message
2019-12-08 17:59:53 -05:00
jack1142
9a051ef2c6 [Downloader] Fix [p]findcog not working with different levels of imports (#3178)
* Update downloader.py

* Create 3177.bugfix.rst
2019-12-08 17:58:43 -05:00
jack1142
0f62614055 [Downloader] Disable all git auth prompts on clone/pull (#3159)
* fix(downloader): disable all git auth prompts on clone/pull

* chore(changelog): add towncrier entry
2019-12-07 19:54:49 -05:00
jack1142
672050727f [Downloader] Ensure consistent output from git commands (#3160)
* fix(downloader): ensure consistent output from git commands

* chore(changelog): add towncrier entry
2019-12-07 19:31:43 -05:00
jack1142
d136d594f4 [Changelogs] Remove info about branch support in revision argument (#3158)
* chore(changelog): remove info about branch support

* chore(changelog): fix grammar issue
2019-12-07 19:29:41 -05:00
Flame442
b4186d6724 Clarifies what [p]backup does (#3172)
* Clarify `[p]backup`

* Create 3172.enhance.rst
2019-12-07 19:24:07 -05:00
jack1142
02d6b7d658 [Launcher] To make experience with launcher amazing /s (#3175)
* Update launcher.py

* Create 3174.bugfix.rst

* Revert launcher.py

* Update launcher.py

* Update launcher.py
2019-12-07 18:56:23 -05:00
Flame442
d07e718ab8 Fixes errors on repo add from empty string values for install_msg (#3153)
* Fixes errors on repo add from empty string values for `install_msg`

* Create 3153.bugfix.rst
2019-12-02 11:41:28 -05:00
jack1142
f0836d7182 [Core] Dispatch on_red_api_tokens_update event on api keys update (#3146)
* feat: dispatch `on_red_api_tokens_update` event on api keys update

* docs: add event reference in Shared API Keys docs

* chore(changelog): add tonwcrier entries

* fix: wrap dispatched api tokens in MappingProxyType

* docs: reflect change of type change to read-only Mapping
2019-11-23 16:58:35 -05:00
jack1142
bc5c2513f6 [Audio] Improve help string for [p]audioset emptydisconnect (#3051)
* enhance(audio): improve help string for [p]audioset emptydisconnect

* chore(changelog): add towncrier entry
2019-11-22 18:59:38 -05:00
Vexed
ec834a0666 Audio playlist capitalisation changes (#3048)
* commit une

* changelog

* help me whi can i mot thnik

* i can make changelogs correctly
2019-11-22 18:54:39 -05:00
PredaaA
77742179c0 [Core] Add [p]listdisabled command (#3118)
* Update core_commands.py

* Create 3115.feature.rst

* Rename 3115.feature.rst to 3118.feature.rst

* Add a message if there's any disabled commands.

* Use the same format as [p]command disable/enable

* Make strings more i18n friendly.

* Flame's requested changes.
2019-11-22 18:54:01 -05:00
kennnyshiwa
a3140b6659 [audio] adds typing indicator to playlist dedupe (#3058)
* [audio] adds typing indicator to playlist dedupe

* [audio] not sure what happened here lol

* [audio] forgot the return

* add changelog

* [audio] fix for black
2019-11-22 18:53:42 -05:00
jack1142
4b62598a3d [Downloader] Make Repo.clean_url work with relative urls. (#3142)
* fix(downloader): return string, catch ValueError for relative urls

* chore(changelog): add towncrier entry
2019-11-19 13:14:22 -05:00
Michael H
ddfabb0c0e
Changes from 3.1.8 (#3139) 2019-11-18 23:45:32 -05:00
Michael H
51298f156b
pt2 (#3132) 2019-11-17 11:08:30 -05:00
Michael H
141b48d3cf
Add .codeclimate.yml (#3131)
- This is still not ready to be used as a PR check
  - Can be used to get an idea of where we can look to clean up code
2019-11-17 11:00:26 -05:00
jack1142
5a7c36c581 chore(changelog): fix wrong references in changelog entries for Downloader (#3130) 2019-11-17 16:35:48 +01:00
jack1142
8a90996b36 [Downloader] Add Repo.clean_url and use it in [p]findcog (#3129)
* enhance(downloader): add `Repo.clean_url` and use it in `[p]findcog`

* chore(changelog): add towncrier entries
2019-11-17 10:25:15 -05:00
jack1142
548a50b984 [Docs] Add information about `info.json's min_python_version` key in Downloader Framework page. (#3125)
* docs(downloader): add missing `min_python_version` key

* chore(changelog): add towncrier entry
2019-11-15 22:28:17 +01:00
jack1142
19e8e60a4d [Audio] Stop player before destroying on emptydisconnect (#3119)
* fix(audio): stop player before disconnect in emptydisconnect

* chore(changelog): add towncrier entry
2019-11-14 13:05:48 -05:00
Vexed
6aeca83c63 Increased clarity of wording in info command (#3121)
* make branch + preliminary code

* correction

* towncrier

* sinbad's changes
2019-11-14 13:04:00 -05:00
Draper
33178ef034 [Audio-3.2] Fix an issue with mixplaylist being recognised as single tracks (#3104)
* Fix an issue with mixplaylist being recognised as single tracks

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>

* Add changelogs

Signed-off-by: Drapersniper <27962761+drapersniper@users.noreply.github.com>
2019-11-11 11:59:51 -05:00
flaree
710b520da9 [Docs] get_shared_api_keys -> get_shared_api_tokens (#3110)
* keys -> tokens

* Changelog
2019-11-09 14:58:10 -05:00
Michael H
b3363acf77
reorder some startup to prevent heartbeat issues (#3073)
* reorder some startup to prevent heartbeat issues

* changelog

* handle startup cleanup in audio

* style

* rebased to handle conflict

* be a little smarter to prevent (some) infinite hangs

* Fix a pre-existing NoneType Error

* Migrate config before things are using it...

* another place we should ensure we're ready

* rename-toavoid-issues

* fix cache ordering and mis-use of ensure_future

* remove incorrect typehints

* style
2019-11-09 14:19:57 -05:00
Michael H
6852b7a1d1
License info command (#3090)
* Adds a licenseinfo command

* good enough for now

* changelog

* *sigh* Fine, have it your way Draper

* thanks Flame
2019-11-09 14:06:07 -05:00
Kowlin
418f957332 Update the issue templates (#3109)
This update will automatically attach the relevant labels to the dedicated issue templates.
2019-11-09 13:54:41 -05:00
Vexed
a05508a9f2 [Docs] It's 2019. Let's not say it's 2018. (#3105)
* guys... it's still not 2018

* changelog

i miss git

* review
2019-11-09 15:50:40 +01:00
Michael H
dd899c804a
Remove the mongo driver (#3099)
* kills mongo

* changelog

* more refeences to mongo needed to go
2019-11-08 14:48:04 -05:00
jack1142
1651de1305 [Core] Add redbot --edit cli flag (replacement for [p]set owner&token) (#3060)
* feat(core): add `redbot --edit` cli flag

* chore(changelog): add towncrier entries

* refactor(core): clean up `redbot --edit`, few fixes

* fix(core): prepare for review

* chore(changelog): update towncrier entry to use double ticks :p

* style(black): ugh, Sinbad's git hook isn't perfect (using worktrees)

* fix: Address Flame's first review
2019-11-08 12:07:32 -05:00
Bakersbakebread
078210b54c change to_check.guild to getattr() (#3101)
* change to_check.guild to getattr()

* add webhook check

* changelog

* Update changelog.d/3100.bugfix.rst

Co-Authored-By: Michael H <michael@michaelhall.tech>
2019-11-08 09:43:21 -05:00
jack1142
e2c8b11008 [V3 Downloader] Revision tracking (#2571)
* feat(downloader): Install cog from specific commit in repo (initial commit)

- Repo and Installable have commit property now
- New class inheriting from Installable -
InstalledCog (old one from converters.py removed)
- New Repo.checkout() method, which is also async ctx manager
ref #2527

* fix(downloader): Keep information about repo's branch in config

- This is needed to make sure that repo can go back from detached state in some rare unexpected
cases
- current branch is determined by `git symbolic-ref` now as this command errors for detached
HEAD

* feat(downloader): Update repo without cogs, update single cog

The most important part of issue #2527 has been added here
- `[p]repo update` command added
- new conf format - nested dictionary repo_name->cog_name->cog_json
  installed libraries are now kept in conf too
  - `InstalledCog` renamed to `InstalledModule` - installed libraries use this class
  - `Downloader.installed_libraries()` and `Downloader.installed_modules()` added
  - `Downloader._add_to_installed()` and `Downloader._remove_from_installed()`
    now accept list of modules, of both cogs and libraries
- `[p]cog install` tells about fails of copying cog and installing shared libraries
- `[p]cog update` will truly update only chosen cogs (if provided) or cogs that need update
  - pinned cogs aren't checked
  - before update, repos are updated
  - to determine if update is needed `Repo.get_modified_modules()` is used
- `[p]cog pin` and `[p]cog unpin` commands for pinning/unpinning cogs added
- `Repo.checkout()` allows to choose ctx manager exit's checkout revision
- `Repo.install_cog()` returns `InstalledModule` now and raises CopyingError (maybe breaking?)
- `Repo.install_libraries()` returns 2-tuple of installed and failed libraries (maybe breaking?)
- `RepoManager.get_all_cogs()` added, which returns cogs from all repos
- `RepoManager.repos` property added, which contains tuple of `Repo`

* test(downloader): Repo.current_branch() throws an exception, when branch can't be determined

* style(downloader): rename _add_to_installed to _save_to_installed

This method is used for both adding and updating existing modules in Config

* refactor(downloader): add ctx.typing() for few commands

`[p]cog install` is nested hell, can't wait for moving install logic to separate method

* fix(downloader): refactor and fix `set` usage

* perf(downloader): update commits for ALL checked modules to omit diffs next time

This will also disable running git diff for cogs that have the same commit as the latest one

* style(downloader): few style improvements

- use of mutable object in method definition
- make Repo._get_full_sha1() public method
- too long
line
- don't use len to check if sequence is empty

* feat(downloader): add `[p]cog updateallfromrepos` and `[p]cog updatetoversion` commands

- moved cog update logic into `Downloader._cog_update_logic()` (lack of better name)
  - splitted
whole cog update process into smaller methods
  - might still need some improvements
- added new
methods to `Repo` class:
  - `is_on_branch()` to check if repo is currently checked out to branch

- `is_ancestor()` to check if one commit is ancestor of the other
- fix for
`Downloader._available_updates()` behaviour
broken by commit
5755ab08ba67556b3863e907c6f44d80f4f13d88

* feat(downloader): try to find last commit where module is still present

Enhancements:
- `Installable` now has `repo` attribute containing repo object or `None` if repo is
missing
- `Downloader._install_cogs()` and `Downloader._reinstall_libraries()` are able to install
modules from different commits of repo
- `Repo.checkout()` as ctx manager will now exit to commit
which was active before checking out
- unification of `rev` and `hash` terms:
All function
parameters are explicitly called `hash`, if it can only be commit's full sha1 hash or `rev` if it
can be anything that names a commit object, see
[link](https://git-scm.com/docs/git-rev-parse#_specifying_revisions)
- new
`Repo.get_last_module_occurence()` method, which gets module's Installable from last commit in which
it still occurs

* docs(downloader): Add basic description for `InstalledModule`

* fix(downloader): cog ignored during updates if its commit was missing

After config format update, commit string is empty until update and when such cog was checked and it
wasn't available in repo anymore, it was ignored

* refactor(downloader): Installing cogs from specific rev will pin them

* perf(downloader): Don't checkout when current commit equals target hash

- changes to `Repo.checkout()`:
  - `exit_to_rev` is now keyword only argument
  - added
`force_checkout` to force checkout even if `Repo.commit` value is the same as target hash

* refactor(downloader): Repo._run() stderr is redirected to debug log now

- added two keyword arguments:
  - `valid_exit_codes` which specifies valid exit codes, used to
determine if stderr should be sent as debug or error level in logging
  - `debug_only` which
specifies if stderr can be sent only as debug level in logging

* style(downloader): stop using `set` as arg name in `_load_repos()`

* feat(downloader): pass multiple cogs to `[p]cog (un)pin`

* refactor(downloader): accept module name instead of instance, fix spelling

* style(downloader): few small style changes

* fix(downloader): add type annotations + fixes based on them

- fix wrong type annotations and add a lot of new ones
- add checks for `Installable.repo` being `None`
- fix wrong return type in `Downloader._install_requirements`
- show repo names correctly when updating all repos
- fix error when some requirement fails to install

BREAKING CHANGE:
- type of `Repo.available_modules` is now consistent (always `tuple`)

* tests: use same event loop policy as in Red's code

* enhance(downloader): fully handle ambiguous revisions

* build(deps): add pytest-mock dependency to tests extra

* fix(downloader): minor fixes

* feat(downloader): add tool for editing Downloader's test repo

This script aims to help update the human-readable version of repo
used for git integration tests in ``redbot/tests/downloader_testrepo.export``
by exporting/importing it in/from provided directory.

Note
----
Editing `downloader_git_test_repo.export` file manually is strongly discouraged,
especially editing any part of commit directives as that causes a change in the commit's hash.
Another problem devs could encounter when trying to manually edit that file
are editors that will use CRLF instead of LF for new line character(s) and therefore break it.

I also used `.gitattributes` to prevent autocrlf from breaking testrepo.

Also, if Git ever changes currently used SHA-1 to SHA-256 we will have to
update old hashes with new ones. But it's a small drawback,
when we can have human-readable version of repo.

Known limitations
-----------------
``git fast-export`` exports commits without GPG signs so this script disables it in repo's config.
This also means devs shouldn't use ``--gpg-sign`` flag in ``git commit`` within the test repo.

* tests(downloader): add git tests and test repo for them

Also added Markdown file that is even more clear than export file
on what the test repo contains.
This is manually created but can be automated on later date.

* test(downloader): add more tests related to RepoManager

These tests use expected output that is already guaranteed by git tests.

* chore(CODEOWNERS): add jack1142 to Downloader's folders

I know this doesn't actually give any benefit to people that don't have
write permission to the repo but I saw other big fella devs doing this,
so I think this might be advisable.

* enhance(downloader): allow easy schema updates in future

* enhance(downloader): more typing fixes, add comments for clarity

* feat(downloader): add python and bot version check to update process

follow-up on #2605, this commit fully fixes #1866

* chore(changelog): add towncrier entries

* fix(downloader): use `*args` instead of `commands.Greedy`

* fix(downloader): hot-reload issue - `InstallableType` now inherits from `IntEnum`

There's desync of `InstallableType` class types due to hot-reload
and `IntEnum` allows for equality check between different types

* enhance(downloader): ensure there's no cog with same name installed

should fix #2927

* fix(downloader): last few changes before marking as ready for review
2019-11-07 20:36:16 -05:00
aikaterna
d85fb260e7 [Audio] Expose FriendlyException on play command (#3085)
* [Audio] Expose FriendlyException on play command

* Add changelog
2019-11-06 17:41:18 -05:00
Jeremiah Boby
e79a08e392 Add autostart documentation for venv users (#3028)
* Add documentation for venv users

Resolves #3005

* Add changes to changelog.d

* Use "redenv" over "path/to/venv"
2019-11-06 12:29:01 -05:00
Toby Harradine
7e9b1b87e6 Allow keeping data in redbot-setup delete (#2965)
* Allow keeping data in `redbot-setup delete`

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>

* Add changelog entry

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-11-06 12:24:54 -05:00
Michael H
b8cbaa2fa0
Merge 3.1.7 (#3098)
* uvloop + python3.8

* Lavalink bump to 3.2.1_846

* [Release] 3.1.7

- Handles a dependency issue for python3.8
- Updates the Lavalink jar used
  - This include's Nin's stat fix
  - Streaming from Soundcloud is working again, at least for now.

* 3.1.7
2019-11-05 08:13:32 -05:00
Michael H
ddd9c4c6b0 [Permissions] Ensure defaults are cleared when clearing all rules (#3041)
- fixes #3037
2019-11-04 23:09:01 +01:00
Kowlin
a729a474b1 Added documentation for PM2 (#2105)
* Added PM2 documentation

* Grammar fix

* Build error fix.

* Just work T_T

* Update docs/autostart_pm2.rst

Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com>

* Update docs/autostart_pm2.rst

Co-Authored-By: Vexed <51716387+Vexed01@users.noreply.github.com>

* Create 2105.docs.rst
2019-11-04 16:52:01 -05:00
palmtree5
911aed5fe2 [Docs] Getting Started Guide improvements (#3083)
* Add MS Azure to the list of hosting providers

* Fix some typos, wording, incorrect commands

* towncrier

* Update docs/getting_started.rst

Co-Authored-By: Michael H <michael@michaelhall.tech>
2019-10-23 23:45:25 -04:00
El Laggron
53606a4bbc [Docs] Do not overwrite rst_prolog (#3082)
* Do not overwrite rst_prolog

* Add towncrier entry
2019-10-23 17:51:35 -04:00
Ryan
3b653f93fc [Docs] Update Cog Creation guide install (#3021)
* Use stable instead of dev version

* changelog entry

* Rename 3020.docs.rst to 3021.docs.rst

* update wording in Getting Started

* add note about package layout

* fix some formatting

* spellcheck

* add cookiecutter note

* Update 3021.docs.rst
2019-10-23 17:51:12 -04:00
Michael H
17c8cbb057
Add support for accessing config by ids (#3022)
* Add support for accessing config by ids

* update-changelog with methods
2019-10-22 16:25:01 -04:00