From 9cb5fe99cade09a2f33f444bb005a5dcf69b68e9 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 25 Jan 2023 08:24:44 -0700 Subject: Make new tag for #2360 --- bot/resources/tags/in-place.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 bot/resources/tags/in-place.md diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md new file mode 100644 index 000000000..361dfd111 --- /dev/null +++ b/bot/resources/tags/in-place.md @@ -0,0 +1,5 @@ +**Out of Place** and **In Place** + +- An "out of place" operation is one that creates a new object, leaving the original object unchanged. +- An "in place" operation is one that modifies the original object, without creating a new one. + -- cgit v1.2.3 From a0bfba540a0fedabe3f3e3625ac829c614fd4b82 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 25 Jan 2023 08:45:24 -0700 Subject: Update in-place.md --- bot/resources/tags/in-place.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 361dfd111..c81fa660a 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -1,5 +1,24 @@ **Out of Place** and **In Place** -- An "out of place" operation is one that creates a new object, leaving the original object unchanged. -- An "in place" operation is one that modifies the original object, without creating a new one. +- An "out of place" operation creates a new object, leaving the original object unchanged. +- An "in place" operation modifies the original object, without creating a new one. These return None explicitly. +A prime example of these different ideas is `list.sort()` vs `sorted(...)`: + +`list.sort()` can cause many errors within your code, one of the most common is shown below: + +```py +a_list = [3, 1, 2] +a_new_list = a_list.sort() # This will be None +print(a_new_list[1]) # This will error +``` + +On the other hand, `sorted()` can also cause errors: + +```py +a_list = [3, 1, 2] +sorted(a_list) +print(a_list[0]) # You may expect 1, but it will print 3 +``` + +Both of these errors are an easy fixes. -- cgit v1.2.3 From 27eb0f9eb1a3795ed6eeadb3d9b35e9de29831e9 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 25 Jan 2023 15:54:23 -0700 Subject: Update in-place.md --- bot/resources/tags/in-place.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index c81fa660a..9f6ec6402 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -5,7 +5,7 @@ A prime example of these different ideas is `list.sort()` vs `sorted(...)`: -`list.sort()` can cause many errors within your code, one of the most common is shown below: +This is a common use for `list.sort()` which will end in an error. ```py a_list = [3, 1, 2] @@ -13,7 +13,7 @@ a_new_list = a_list.sort() # This will be None print(a_new_list[1]) # This will error ``` -On the other hand, `sorted()` can also cause errors: +This is a common use for `sorted()` which will end in a unexpected result. ```py a_list = [3, 1, 2] @@ -21,4 +21,4 @@ sorted(a_list) print(a_list[0]) # You may expect 1, but it will print 3 ``` -Both of these errors are an easy fixes. +To fix this you just need to set a new variable to `sorted(a_list)`, and don't create a new list for `list.sort()` -- cgit v1.2.3 From 8b2573cb5ef87ffe1697a20ef5f2a7b137f432ee Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 25 Jan 2023 15:59:16 -0700 Subject: Make explanation more concise, and informational --- bot/resources/tags/in-place.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 9f6ec6402..49f9bfe2f 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -1,11 +1,10 @@ **Out of Place** and **In Place** -- An "out of place" operation creates a new object, leaving the original object unchanged. -- An "in place" operation modifies the original object, without creating a new one. These return None explicitly. +In programming, there are two types of operations: "out of place" and "in place". An "out of place" operation creates a new object, leaving the original object unchanged. An "in place" operation modifies the original object, without creating a new one. These operations return None explicitly. -A prime example of these different ideas is `list.sort()` vs `sorted(...)`: +A common example of these different concepts is seen in the use of the methods `list.sort()` and sorted(...) in Python. Using `list.sort()` will modify the original list and return None, so attempting to access an element of the list after calling `sort()` will result in an error. -This is a common use for `list.sort()` which will end in an error. +For example, the following code will result in an error: ```py a_list = [3, 1, 2] @@ -13,7 +12,7 @@ a_new_list = a_list.sort() # This will be None print(a_new_list[1]) # This will error ``` -This is a common use for `sorted()` which will end in a unexpected result. +On the other hand, using `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: ```py a_list = [3, 1, 2] @@ -21,4 +20,4 @@ sorted(a_list) print(a_list[0]) # You may expect 1, but it will print 3 ``` -To fix this you just need to set a new variable to `sorted(a_list)`, and don't create a new list for `list.sort()` +To avoid these errors and unexpected results, it is required to assign the result of sorted(...) to a new variable and use list.sort() method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. -- cgit v1.2.3 From bb890bbbfa9a5aca03b5cc38791e71d915086557 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Thu, 26 Jan 2023 11:04:12 -0700 Subject: Add clarifying details Co-authored-by: Caeden Perelli-Harris --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 49f9bfe2f..880f82527 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -9,7 +9,7 @@ For example, the following code will result in an error: ```py a_list = [3, 1, 2] a_new_list = a_list.sort() # This will be None -print(a_new_list[1]) # This will error +print(a_new_list[1]) # This will error because it is empty ``` On the other hand, using `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: -- cgit v1.2.3 From 053c5edda0bbca2b7c7d96046b0a7befa767666b Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Thu, 26 Jan 2023 11:04:26 -0700 Subject: Add clarifying details Co-authored-by: Caeden Perelli-Harris --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 880f82527..2a9a1db2f 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -12,7 +12,7 @@ a_new_list = a_list.sort() # This will be None print(a_new_list[1]) # This will error because it is empty ``` -On the other hand, using `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: +On the other hand, using the function `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: ```py a_list = [3, 1, 2] -- cgit v1.2.3 From c7bc8a084357216fbe118ad0983cf0d51affa3aa Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Thu, 26 Jan 2023 11:04:46 -0700 Subject: Add missing code blocks Co-authored-by: Caeden Perelli-Harris --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 2a9a1db2f..f1d3090fd 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -20,4 +20,4 @@ sorted(a_list) print(a_list[0]) # You may expect 1, but it will print 3 ``` -To avoid these errors and unexpected results, it is required to assign the result of sorted(...) to a new variable and use list.sort() method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. +To avoid these errors and unexpected results, it is required to assign the result of `sorted(...)` to a new variable and use `list.sort()` method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. -- cgit v1.2.3 From ae70912045d5c817acecdf0025dd00f6cbb846a6 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Thu, 26 Jan 2023 11:05:48 -0700 Subject: Clarify empty and why it errors. --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index f1d3090fd..8c5df89c9 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -9,7 +9,7 @@ For example, the following code will result in an error: ```py a_list = [3, 1, 2] a_new_list = a_list.sort() # This will be None -print(a_new_list[1]) # This will error because it is empty +print(a_new_list[1]) # This will error because it is NoneType and not a list ``` On the other hand, using the function `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: -- cgit v1.2.3 From 413cfd38d7e9af22f7428d3afd16faac63e67d77 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Fri, 27 Jan 2023 13:57:45 -0700 Subject: Small Minimization Changes --- bot/resources/tags/in-place.md | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 8c5df89c9..7782175a2 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -2,19 +2,13 @@ In programming, there are two types of operations: "out of place" and "in place". An "out of place" operation creates a new object, leaving the original object unchanged. An "in place" operation modifies the original object, without creating a new one. These operations return None explicitly. -A common example of these different concepts is seen in the use of the methods `list.sort()` and sorted(...) in Python. Using `list.sort()` will modify the original list and return None, so attempting to access an element of the list after calling `sort()` will result in an error. - -For example, the following code will result in an error: +A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list after calling `sort()` will result in an error. ```py a_list = [3, 1, 2] a_new_list = a_list.sort() # This will be None print(a_new_list[1]) # This will error because it is NoneType and not a list -``` -On the other hand, using the function `sorted(...)` will return a new sorted list, leaving the original list unchanged. This means that if you expect the original list to be sorted, you will be disappointed with the result. For example, the following code will print 3 instead of 1: - -```py a_list = [3, 1, 2] sorted(a_list) print(a_list[0]) # You may expect 1, but it will print 3 -- cgit v1.2.3 From aacbdb080c1dd8da6304692c985b0f695b5b4b63 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Fri, 27 Jan 2023 17:28:56 -0700 Subject: More minimizations --- bot/resources/tags/in-place.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 7782175a2..a19fc1b30 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -1,8 +1,8 @@ **Out of Place** and **In Place** -In programming, there are two types of operations: "out of place" and "in place". An "out of place" operation creates a new object, leaving the original object unchanged. An "in place" operation modifies the original object, without creating a new one. These operations return None explicitly. +In programming, there are two types of operations: "out of place" operations creates a new object, leaving the original object unchanged. "in place" operations modifies the original object, without creating a new one. These operations return None explicitly. -A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list after calling `sort()` will result in an error. +A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. ```py a_list = [3, 1, 2] -- cgit v1.2.3 From a3ddebe8d6686832c4a3fedfc435e7b4d643e1d6 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Fri, 27 Jan 2023 17:54:24 -0700 Subject: Clarify words Co-authored-by: dawn <78233879+dawnofmidnight@users.noreply.github.com> --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index a19fc1b30..ca48d4de5 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -1,6 +1,6 @@ **Out of Place** and **In Place** -In programming, there are two types of operations: "out of place" operations creates a new object, leaving the original object unchanged. "in place" operations modifies the original object, without creating a new one. These operations return None explicitly. +In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object, without creating a new one. These operations return None explicitly. A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. -- cgit v1.2.3 -- cgit v1.2.3 From b4ab5429fc74c9a7300a73f352a583c853c32c27 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Fri, 27 Jan 2023 17:58:14 -0700 Subject: Update list names --- bot/resources/tags/in-place.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index ca48d4de5..d120f9b08 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -5,13 +5,13 @@ In programming, there are two types of operations: "out of place" operations cre A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. ```py -a_list = [3, 1, 2] -a_new_list = a_list.sort() # This will be None +inplace_list = [3, 1, 2] +a_new_list = inplace_list.sort() # This will be None print(a_new_list[1]) # This will error because it is NoneType and not a list -a_list = [3, 1, 2] -sorted(a_list) -print(a_list[0]) # You may expect 1, but it will print 3 +outofplace_list = [3, 1, 2] +sorted(outofplace_list) +print(outofplace_list[0]) # You may expect 1, but it will print 3 ``` To avoid these errors and unexpected results, it is required to assign the result of `sorted(...)` to a new variable and use `list.sort()` method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. -- cgit v1.2.3 From 83f3167bdf6d6320dda40d3ed90dbad13ca7c4d0 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Sat, 28 Jan 2023 11:38:00 -0700 Subject: Clarify comments --- bot/resources/tags/in-place.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index d120f9b08..7ed957bdc 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -7,11 +7,11 @@ A common example of these different concepts is seen in the use of the methods ` ```py inplace_list = [3, 1, 2] a_new_list = inplace_list.sort() # This will be None -print(a_new_list[1]) # This will error because it is NoneType and not a list +print(a_new_list) # Outputs None. Where did the list go? outofplace_list = [3, 1, 2] sorted(outofplace_list) -print(outofplace_list[0]) # You may expect 1, but it will print 3 +print(outofplace_list) # The list still isn't sorted. Why? ``` To avoid these errors and unexpected results, it is required to assign the result of `sorted(...)` to a new variable and use `list.sort()` method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. -- cgit v1.2.3 From d959f7690f919b915c1375704e30de2a1438b8ee Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Sat, 28 Jan 2023 18:37:37 -0700 Subject: Update list names, and add clarifying comments --- bot/resources/tags/in-place.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 7ed957bdc..0144a840b 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -5,13 +5,15 @@ In programming, there are two types of operations: "out of place" operations cre A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. ```py -inplace_list = [3, 1, 2] -a_new_list = inplace_list.sort() # This will be None -print(a_new_list) # Outputs None. Where did the list go? +# WRONG: -outofplace_list = [3, 1, 2] -sorted(outofplace_list) -print(outofplace_list) # The list still isn't sorted. Why? +unsorted_list = [3, 1, 2] +sorted_list = inplace_list.sort() # This will be None +print(sorted_list) # Outputs None. Where did the list go? + +list_to_sort = [3, 1, 2] +sorted(list_to_sort) +print(list_to_sort) # The list still isn't sorted. Why? ``` To avoid these errors and unexpected results, it is required to assign the result of `sorted(...)` to a new variable and use `list.sort()` method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. -- cgit v1.2.3 From e50149264c3f33fe5625cb611db44cc5ba521351 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 8 Feb 2023 08:28:35 -0700 Subject: Update wording Co-authored-by: dawn <78233879+dawnofmidnight@users.noreply.github.com> --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 0144a840b..bd36300f5 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -8,7 +8,7 @@ A common example of these different concepts is seen in the use of the methods ` # WRONG: unsorted_list = [3, 1, 2] -sorted_list = inplace_list.sort() # This will be None +sorted_list = unsorted_list.sort() # This will be None print(sorted_list) # Outputs None. Where did the list go? list_to_sort = [3, 1, 2] -- cgit v1.2.3 From 81ae7f0a68f8a3c55c1f113d7a0474eaaf919a65 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 20:11:02 +0100 Subject: add constants needed --- botstrap.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/botstrap.py b/botstrap.py index 90a954d9b..98ecceabb 100644 --- a/botstrap.py +++ b/botstrap.py @@ -15,6 +15,10 @@ env_file_path = Path(".env.server") BOT_TOKEN = os.getenv("BOT_TOKEN", None) GUILD_ID = os.getenv("GUILD_ID", None) +COMMUNITY_FEATURE = "COMMUNITY" +PYTHON_HELP_NAME = _Channels.__fields__["python_help"].name +GUILD_FORUM_TYPE = 15 + if not BOT_TOKEN: message = ( -- cgit v1.2.3 From 0862e39627a99635fd46e49c63cb2edf32aa56a7 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 20:11:37 +0100 Subject: add new utilities to check/upgrade guild/channel states --- botstrap.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/botstrap.py b/botstrap.py index 98ecceabb..d5dbacac3 100644 --- a/botstrap.py +++ b/botstrap.py @@ -52,6 +52,44 @@ class DiscordClient(Client): response.raise_for_status() +def is_community_server(guild_id: int | str, client: DiscordClient) -> bool: + """A predicate that indicates whether a server has the COMMUNITY feature or not""" + response = client.get(f"/guilds/{guild_id}") + return COMMUNITY_FEATURE in response.json()["features"] + + +def upgrade_server_to_community(guild_id: int | str, client: DiscordClient) -> bool: + """Transforms a server into a community one. + + Return true if the server has been correctly upgraded, False otherwise. + """ + + payload = {"features": [COMMUNITY_FEATURE]} + response = client.patch(f"/guilds/{guild_id}", json=payload) + + return 200 <= response.status_code < 300 + + +def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClient, category_id_: int | None = None): + """Creates a new forum channel""" + + payload = {"name": channel_name_, "type": GUILD_FORUM_TYPE} + if category_id_: + payload["parent_id"] = category_id_ + + response = client.post(f"/guilds/{guild_id}/channels", json=payload) + + return response.json()["id"] + + +def delete_channel(channel_id_: id, client: DiscordClient): + """Upgrades a channel to a channel of type GUILD FORUM""" + + response = client.delete(f"/channels/{channel_id_}") + + return response.json() + + def get_all_roles(guild_id: int | str, client: DiscordClient) -> dict: """Fetches all the roles in a guild.""" result = {} -- cgit v1.2.3 From 71bbbbcf5dd339fe5c65699036852efceb63716c Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 20:26:44 +0100 Subject: add is_forum_channel predicate --- botstrap.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/botstrap.py b/botstrap.py index d5dbacac3..caf4459d7 100644 --- a/botstrap.py +++ b/botstrap.py @@ -82,6 +82,13 @@ def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClien return response.json()["id"] +def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: + """A boolean that indicates if a channel is of type GUILD_FORUM""" + + response = client.get(f"/channels/{channel_id_}") + return response.json()["type"] == GUILD_FORUM_TYPE + + def delete_channel(channel_id_: id, client: DiscordClient): """Upgrades a channel to a channel of type GUILD FORUM""" -- cgit v1.2.3 From 9367f76221302571175cf0b9209e11f493dcc83d Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 20:27:28 +0100 Subject: add necessary workflow to check guild features & act accordingly --- botstrap.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/botstrap.py b/botstrap.py index caf4459d7..ae8652f4a 100644 --- a/botstrap.py +++ b/botstrap.py @@ -175,6 +175,20 @@ with DiscordClient() as discord_client: config_str += "\n#Channels\n" + if not is_community_server(GUILD_ID, discord_client): + upgrade_server_to_community(GUILD_ID, discord_client) + + create_help_channel = True + if PYTHON_HELP_NAME in all_channels: + python_help_channel_id = all_channels[PYTHON_HELP_NAME] + if not is_forum_channel(python_help_channel_id, discord_client): + delete_channel(python_help_channel_id, discord_client) + else: + create_help_channel = False + + if create_help_channel: + python_help_channel_id = create_forum_channel(PYTHON_HELP_NAME.replace('_', '-'), GUILD_ID, discord_client) + for channel_name in _Channels.__fields__: channel_id = all_channels.get(channel_name, None) if not channel_id: @@ -184,6 +198,7 @@ with DiscordClient() as discord_client: continue config_str += f"channels_{channel_name}={channel_id}\n" + config_str += f"channels_{PYTHON_HELP_NAME}={python_help_channel_id}\n" config_str += "\n#Categories\n" -- cgit v1.2.3 From 8df08a6b516868370bbdb52f7b0101f58097ee15 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 22:45:21 +0100 Subject: replace upgrade_server_to_community with upgrade_server_to_community_if_necessary --- bot/constants.py | 2 ++ botstrap.py | 51 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 006d0e4ce..d9327deec 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -125,6 +125,8 @@ class _Channels(EnvConfig): duck_pond = 637820308341915648 roles = 851270062434156586 + rules = 693837295685730335 + Channels = _Channels() diff --git a/botstrap.py b/botstrap.py index ae8652f4a..aa6cf87a9 100644 --- a/botstrap.py +++ b/botstrap.py @@ -16,7 +16,9 @@ BOT_TOKEN = os.getenv("BOT_TOKEN", None) GUILD_ID = os.getenv("GUILD_ID", None) COMMUNITY_FEATURE = "COMMUNITY" -PYTHON_HELP_NAME = _Channels.__fields__["python_help"].name +PYTHON_HELP_CHANNEL_NAME = _Channels.__fields__["python_help"].name +ANNOUNCEMENTS_CHANNEL_NAME = _Channels.__fields__["announcements"].name +RULES_CHANNEL_NAME = _Channels.__fields__["rules"].name GUILD_FORUM_TYPE = 15 @@ -44,7 +46,6 @@ class DiscordClient(Client): super().__init__( base_url="https://discord.com/api/v10", headers={"Authorization": f"Bot {BOT_TOKEN}"}, - event_hooks={"response": [self._raise_for_status]} ) @staticmethod @@ -52,22 +53,32 @@ class DiscordClient(Client): response.raise_for_status() -def is_community_server(guild_id: int | str, client: DiscordClient) -> bool: - """A predicate that indicates whether a server has the COMMUNITY feature or not""" +def upgrade_server_to_community_if_necessary( + guild_id: int | str, + rules_channel_id_: int | str, + announcements_channel_id_: int | str, + client: DiscordClient) -> None: + """Fetches server info & upgrades to COMMUNITY if necessary""" response = client.get(f"/guilds/{guild_id}") - return COMMUNITY_FEATURE in response.json()["features"] + payload = response.json() + + if COMMUNITY_FEATURE not in payload["features"]: + log.warning("This server is currently not a community, upgrading.") + payload["features"].append(COMMUNITY_FEATURE) + payload["rules_channel_id"] = rules_channel_id_ + payload["public_updates_channel_id"] = announcements_channel_id_ + client.patch(f"/guilds/{guild_id}", json=payload) -def upgrade_server_to_community(guild_id: int | str, client: DiscordClient) -> bool: +def upgrade_server_to_community(guild_id: int | str, client: DiscordClient) -> None: """Transforms a server into a community one. Return true if the server has been correctly upgraded, False otherwise. """ payload = {"features": [COMMUNITY_FEATURE]} - response = client.patch(f"/guilds/{guild_id}", json=payload) - - return 200 <= response.status_code < 300 + client.patch(f"/guilds/{guild_id}", json=payload) + log.info(f"Server {guild_id} has been successfully updated to a community.") def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClient, category_id_: int | None = None): @@ -78,8 +89,9 @@ def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClien payload["parent_id"] = category_id_ response = client.post(f"/guilds/{guild_id}/channels", json=payload) - - return response.json()["id"] + forum_channel_id = response.json()["id"] + log.info(f"New forum channel: {channel_name_} has been successfully created.") + return forum_channel_id def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: @@ -91,7 +103,7 @@ def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: def delete_channel(channel_id_: id, client: DiscordClient): """Upgrades a channel to a channel of type GUILD FORUM""" - + log.info(f"Channel python-help: {channel_id_} is not a forum channel and will be replaced with one.") response = client.delete(f"/channels/{channel_id_}") return response.json() @@ -175,19 +187,22 @@ with DiscordClient() as discord_client: config_str += "\n#Channels\n" - if not is_community_server(GUILD_ID, discord_client): - upgrade_server_to_community(GUILD_ID, discord_client) + rules_channel_id = all_channels[RULES_CHANNEL_NAME] + announcements_channel_id = all_channels[ANNOUNCEMENTS_CHANNEL_NAME] + + upgrade_server_to_community_if_necessary(GUILD_ID, rules_channel_id, announcements_channel_id, discord_client) create_help_channel = True - if PYTHON_HELP_NAME in all_channels: - python_help_channel_id = all_channels[PYTHON_HELP_NAME] + + if PYTHON_HELP_CHANNEL_NAME in all_channels: + python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] if not is_forum_channel(python_help_channel_id, discord_client): delete_channel(python_help_channel_id, discord_client) else: create_help_channel = False if create_help_channel: - python_help_channel_id = create_forum_channel(PYTHON_HELP_NAME.replace('_', '-'), GUILD_ID, discord_client) + python_help_channel_id = create_forum_channel(PYTHON_HELP_CHANNEL_NAME.replace('_', '-'), GUILD_ID, discord_client) for channel_name in _Channels.__fields__: channel_id = all_channels.get(channel_name, None) @@ -198,7 +213,7 @@ with DiscordClient() as discord_client: continue config_str += f"channels_{channel_name}={channel_id}\n" - config_str += f"channels_{PYTHON_HELP_NAME}={python_help_channel_id}\n" + config_str += f"channels_{PYTHON_HELP_CHANNEL_NAME}={python_help_channel_id}\n" config_str += "\n#Categories\n" -- cgit v1.2.3 From db3f040f8f8aed37bd8d9dcdacc179fb5aef2135 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 22:53:23 +0100 Subject: bring back the response event hook --- botstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/botstrap.py b/botstrap.py index aa6cf87a9..f6d35485d 100644 --- a/botstrap.py +++ b/botstrap.py @@ -46,6 +46,7 @@ class DiscordClient(Client): super().__init__( base_url="https://discord.com/api/v10", headers={"Authorization": f"Bot {BOT_TOKEN}"}, + event_hooks={"response": [self._raise_for_status]}, ) @staticmethod -- cgit v1.2.3 From a915d4700c0cf0bc48166baae648e6b0e9a1cdc1 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 22:55:54 +0100 Subject: appease linter --- botstrap.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/botstrap.py b/botstrap.py index f6d35485d..472b18478 100644 --- a/botstrap.py +++ b/botstrap.py @@ -59,7 +59,7 @@ def upgrade_server_to_community_if_necessary( rules_channel_id_: int | str, announcements_channel_id_: int | str, client: DiscordClient) -> None: - """Fetches server info & upgrades to COMMUNITY if necessary""" + """Fetches server info & upgrades to COMMUNITY if necessary.""" response = client.get(f"/guilds/{guild_id}") payload = response.json() @@ -72,19 +72,23 @@ def upgrade_server_to_community_if_necessary( def upgrade_server_to_community(guild_id: int | str, client: DiscordClient) -> None: - """Transforms a server into a community one. + """ + Transforms a server into a community one. Return true if the server has been correctly upgraded, False otherwise. """ - payload = {"features": [COMMUNITY_FEATURE]} client.patch(f"/guilds/{guild_id}", json=payload) log.info(f"Server {guild_id} has been successfully updated to a community.") -def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClient, category_id_: int | None = None): - """Creates a new forum channel""" - +def create_forum_channel( + channel_name_: str, + guild_id: str, + client: DiscordClient, + category_id_: int | None = None +) -> int: + """Creates a new forum channel.""" payload = {"name": channel_name_, "type": GUILD_FORUM_TYPE} if category_id_: payload["parent_id"] = category_id_ @@ -96,18 +100,15 @@ def create_forum_channel(channel_name_: str, guild_id: str, client: DiscordClien def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: - """A boolean that indicates if a channel is of type GUILD_FORUM""" - + """A boolean that indicates if a channel is of type GUILD_FORUM.""" response = client.get(f"/channels/{channel_id_}") return response.json()["type"] == GUILD_FORUM_TYPE -def delete_channel(channel_id_: id, client: DiscordClient): - """Upgrades a channel to a channel of type GUILD FORUM""" +def delete_channel(channel_id_: id, client: DiscordClient) -> None: + """Upgrades a channel to a channel of type GUILD FORUM.""" log.info(f"Channel python-help: {channel_id_} is not a forum channel and will be replaced with one.") - response = client.delete(f"/channels/{channel_id_}") - - return response.json() + client.delete(f"/channels/{channel_id_}") def get_all_roles(guild_id: int | str, client: DiscordClient) -> dict: @@ -203,7 +204,8 @@ with DiscordClient() as discord_client: create_help_channel = False if create_help_channel: - python_help_channel_id = create_forum_channel(PYTHON_HELP_CHANNEL_NAME.replace('_', '-'), GUILD_ID, discord_client) + python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') + python_help_channel_id = create_forum_channel(python_help_channel_name, GUILD_ID, discord_client) for channel_name in _Channels.__fields__: channel_id = all_channels.get(channel_name, None) -- cgit v1.2.3 From 00330956f6140476d9e9f633b045921b214b3d37 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Mon, 13 Mar 2023 08:03:27 +0100 Subject: remove olf version o fupgrade to community func --- botstrap.py | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/botstrap.py b/botstrap.py index 472b18478..e2a9534d2 100644 --- a/botstrap.py +++ b/botstrap.py @@ -69,17 +69,7 @@ def upgrade_server_to_community_if_necessary( payload["rules_channel_id"] = rules_channel_id_ payload["public_updates_channel_id"] = announcements_channel_id_ client.patch(f"/guilds/{guild_id}", json=payload) - - -def upgrade_server_to_community(guild_id: int | str, client: DiscordClient) -> None: - """ - Transforms a server into a community one. - - Return true if the server has been correctly upgraded, False otherwise. - """ - payload = {"features": [COMMUNITY_FEATURE]} - client.patch(f"/guilds/{guild_id}", json=payload) - log.info(f"Server {guild_id} has been successfully updated to a community.") + log.info(f"Server {guild_id} has been successfully updated to a community.") def create_forum_channel( -- cgit v1.2.3 From a650c089ffb843f0e1a9caf032822d7490b9b5d5 Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 15 Mar 2023 22:46:54 -0600 Subject: Comply to #2419 Co-authored-by: Mohammad Ibrahim <74553450+Ibrahim2750mi@users.noreply.github.com> --- bot/resources/tags/in-place.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index bd36300f5..61f70256b 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -1,4 +1,7 @@ -**Out of Place** and **In Place** +--- +embed: + title: "Out of place and in place" +--- In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object, without creating a new one. These operations return None explicitly. -- cgit v1.2.3 From 628d254e877c03bfc775adc3fa4810488c1481ff Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Wed, 15 Mar 2023 22:48:36 -0600 Subject: Comply to PEP8 Co-authored-by: Mohammad Ibrahim <74553450+Ibrahim2750mi@users.noreply.github.com> --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 61f70256b..0fd672cf0 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -11,7 +11,7 @@ A common example of these different concepts is seen in the use of the methods ` # WRONG: unsorted_list = [3, 1, 2] -sorted_list = unsorted_list.sort() # This will be None +sorted_list = unsorted_list.sort() # This will be None print(sorted_list) # Outputs None. Where did the list go? list_to_sort = [3, 1, 2] -- cgit v1.2.3 From 6a782da04193b825220de2a9cefab1983351e134 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 19 Mar 2023 17:47:31 +0100 Subject: remove "circular" referencing of channel names --- botstrap.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/botstrap.py b/botstrap.py index e2a9534d2..f882f48ab 100644 --- a/botstrap.py +++ b/botstrap.py @@ -16,9 +16,9 @@ BOT_TOKEN = os.getenv("BOT_TOKEN", None) GUILD_ID = os.getenv("GUILD_ID", None) COMMUNITY_FEATURE = "COMMUNITY" -PYTHON_HELP_CHANNEL_NAME = _Channels.__fields__["python_help"].name -ANNOUNCEMENTS_CHANNEL_NAME = _Channels.__fields__["announcements"].name -RULES_CHANNEL_NAME = _Channels.__fields__["rules"].name +PYTHON_HELP_CHANNEL_NAME = "python_help" +ANNOUNCEMENTS_CHANNEL_NAME = "announcements" +RULES_CHANNEL_NAME = "rules" GUILD_FORUM_TYPE = 15 -- cgit v1.2.3 From 027f1ac8f9573711e11b49602f540be9ace26aab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:56:17 +0000 Subject: Bump pytest-xdist from 3.2.0 to 3.2.1 Bumps [pytest-xdist](https://github.com/pytest-dev/pytest-xdist) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/pytest-dev/pytest-xdist/releases) - [Changelog](https://github.com/pytest-dev/pytest-xdist/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest-xdist/compare/v3.2.0...v3.2.1) --- updated-dependencies: - dependency-name: pytest-xdist dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 22a4c0730..cc4ed38ab 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1759,14 +1759,14 @@ pytest = ">=7.0" [[package]] name = "pytest-xdist" -version = "3.2.0" +version = "3.2.1" description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-xdist-3.2.0.tar.gz", hash = "sha256:fa10f95a2564cd91652f2d132725183c3b590d9fdcdec09d3677386ecf4c1ce9"}, - {file = "pytest_xdist-3.2.0-py3-none-any.whl", hash = "sha256:336098e3bbd8193276867cc87db8b22903c3927665dff9d1ac8684c02f597b68"}, + {file = "pytest-xdist-3.2.1.tar.gz", hash = "sha256:1849bd98d8b242b948e472db7478e090bf3361912a8fed87992ed94085f54727"}, + {file = "pytest_xdist-3.2.1-py3-none-any.whl", hash = "sha256:37290d161638a20b672401deef1cba812d110ac27e35d213f091d15b8beb40c9"}, ] [package.dependencies] @@ -2494,4 +2494,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "9063356c1260ec285981fe813dcbcf4ea0959c83623e6dc10bf645ad4db57096" +content-hash = "4a1dc77f9f8448ec9048cbf7ca32fa5e0d31a96325ba1db1fe139bccf29a353d" diff --git a/pyproject.toml b/pyproject.toml index 6eceb9a1b..4aa2b5e81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ pip-licenses = "4.1.0" pytest = "7.2.2" pytest-cov = "4.0.0" pytest-subtests = "0.10.0" -pytest-xdist = "3.2.0" +pytest-xdist = "3.2.1" taskipy = "1.10.3" httpx = "0.23.3" -- cgit v1.2.3 From f9dae3d304340d61ddb3be846ca57d96e951985a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 21:06:30 +0000 Subject: Bump sentry-sdk from 1.16.0 to 1.17.0 (#2474) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index cc4ed38ab..40924e0c4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2154,14 +2154,14 @@ idna2008 = ["idna"] [[package]] name = "sentry-sdk" -version = "1.16.0" +version = "1.17.0" description = "Python client for Sentry (https://sentry.io)" category = "main" optional = false python-versions = "*" files = [ - {file = "sentry-sdk-1.16.0.tar.gz", hash = "sha256:a900845bd78c263d49695d48ce78a4bce1030bbd917e0b6cc021fc000c901113"}, - {file = "sentry_sdk-1.16.0-py2.py3-none-any.whl", hash = "sha256:633edefead34d976ff22e7edc367cdf57768e24bc714615ccae746d9d91795ae"}, + {file = "sentry-sdk-1.17.0.tar.gz", hash = "sha256:ad40860325c94d1a656da70fba5a7c4dbb2f6809d3cc2d00f74ca0b608330f14"}, + {file = "sentry_sdk-1.17.0-py2.py3-none-any.whl", hash = "sha256:3c4e898f7a3edf5a2042cd0dcab6ee124e2112189228c272c08ad15d3850c201"}, ] [package.dependencies] @@ -2494,4 +2494,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "4a1dc77f9f8448ec9048cbf7ca32fa5e0d31a96325ba1db1fe139bccf29a353d" +content-hash = "6f3439fdfc23b4d9fa6ca2e984734b66427e2648a75bb04922f63608f2d4df9a" diff --git a/pyproject.toml b/pyproject.toml index 4aa2b5e81..fbca9b49d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ python-frontmatter = "1.0.0" pyyaml = "6.0" rapidfuzz = "2.13.7" regex = "2022.10.31" -sentry-sdk = "1.16.0" +sentry-sdk = "1.17.0" tldextract = "3.4.0" pydantic = { version = "1.10.6", extras = ["dotenv"]} -- cgit v1.2.3 From 7904d9befddc22648e2ab47b1ba639339bffa8b5 Mon Sep 17 00:00:00 2001 From: ChrisJL Date: Tue, 21 Mar 2023 21:08:50 +0000 Subject: Enable sentry profiling (#2478) Co-authored-by: Xithrius <15021300+Xithrius@users.noreply.github.com> --- bot/log.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/log.py b/bot/log.py index 100cd06f6..236031f25 100644 --- a/bot/log.py +++ b/bot/log.py @@ -98,7 +98,11 @@ def setup_sentry() -> None: sentry_logging, RedisIntegration(), ], - release=f"bot@{constants.GIT_SHA}" + release=f"bot@{constants.GIT_SHA}", + traces_sample_rate=0.5, + _experiments={ + "profiles_sample_rate": 0.5, + }, ) -- cgit v1.2.3 From 9d7f64ad06bdc19b7382ae59d8f3c6c27ef683a1 Mon Sep 17 00:00:00 2001 From: Robin <74519799+Robin5605@users.noreply.github.com> Date: Tue, 21 Mar 2023 16:13:23 -0500 Subject: Add tag for Discord bot hosting (#2472) Co-authored-by: Xithrius <15021300+Xithrius@users.noreply.github.com> --- bot/resources/tags/discord-bot-hosting.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bot/resources/tags/discord-bot-hosting.md diff --git a/bot/resources/tags/discord-bot-hosting.md b/bot/resources/tags/discord-bot-hosting.md new file mode 100644 index 000000000..8b1535953 --- /dev/null +++ b/bot/resources/tags/discord-bot-hosting.md @@ -0,0 +1,11 @@ +--- +embed: + title: Discord Bot Hosting +--- + +Using free hosting options like repl.it or Heroku for continuous 24/7 bot hosting is strongly discouraged. +Instead, opt for a virtual private server (VPS) or use your own spare hardware if you'd rather not pay for hosting. + +See our [Discord Bot Hosting Guide](https://www.pythondiscord.com/pages/guides/python-guides/vps-services/) on our website that compares many hosting providers, both free and paid. + +You may also use <#965291480992321536> to discuss different discord bot hosting options. -- cgit v1.2.3 From dd1ba28e9663321b83aaffbcad360fa5812c26d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 21:17:43 +0000 Subject: Bump flake8-bugbear from 23.2.13 to 23.3.12 (#2468) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 40924e0c4..cdde57a76 100644 --- a/poetry.lock +++ b/poetry.lock @@ -640,14 +640,14 @@ flake8 = ">=5.0" [[package]] name = "flake8-bugbear" -version = "23.2.13" +version = "23.3.12" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "flake8-bugbear-23.2.13.tar.gz", hash = "sha256:39259814a83f33c8409417ee12dd4050c9c0bb4c8707c12fc18ae62b2f3ddee1"}, - {file = "flake8_bugbear-23.2.13-py3-none-any.whl", hash = "sha256:f136bd0ca2684f101168bba2310dec541e11aa6b252260c17dcf58d18069a740"}, + {file = "flake8-bugbear-23.3.12.tar.gz", hash = "sha256:e3e7f74c8a49ad3794a7183353026dabd68c74030d5f46571f84c1fb0eb79363"}, + {file = "flake8_bugbear-23.3.12-py3-none-any.whl", hash = "sha256:beb5c7efcd7ccc2039ef66a77bb8db925e7be3531ff1cb4d0b7030d0e2113d72"}, ] [package.dependencies] @@ -2494,4 +2494,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "6f3439fdfc23b4d9fa6ca2e984734b66427e2648a75bb04922f63608f2d4df9a" +content-hash = "abc96b65c5f00203268cc628d30db3e811564dcd1eb9640c62107106b85ab360" diff --git a/pyproject.toml b/pyproject.toml index fbca9b49d..bf6757631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ pydantic = { version = "1.10.6", extras = ["dotenv"]} coverage = "7.2.1" flake8 = "6.0.0" flake8-annotations = "3.0.0" -flake8-bugbear = "23.2.13" +flake8-bugbear = "23.3.12" flake8-docstrings = "1.7.0" flake8-string-format = "0.3.0" flake8-tidy-imports = "4.8.0" -- cgit v1.2.3 From 54469b68d2d6cbb01e6e5db5c3bb1b9647000bc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 21:22:34 +0000 Subject: Bump coverage from 7.2.1 to 7.2.2 (#2473) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 106 ++++++++++++++++++++++++++++----------------------------- pyproject.toml | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/poetry.lock b/poetry.lock index cdde57a76..81c392920 100644 --- a/poetry.lock +++ b/poetry.lock @@ -392,63 +392,63 @@ cron = ["capturer (>=2.4)"] [[package]] name = "coverage" -version = "7.2.1" +version = "7.2.2" description = "Code coverage measurement for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "coverage-7.2.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:49567ec91fc5e0b15356da07a2feabb421d62f52a9fff4b1ec40e9e19772f5f8"}, - {file = "coverage-7.2.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:d2ef6cae70168815ed91388948b5f4fcc69681480a0061114db737f957719f03"}, - {file = "coverage-7.2.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3004765bca3acd9e015794e5c2f0c9a05587f5e698127ff95e9cfba0d3f29339"}, - {file = "coverage-7.2.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cca7c0b7f5881dfe0291ef09ba7bb1582cb92ab0aeffd8afb00c700bf692415a"}, - {file = "coverage-7.2.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2167d116309f564af56f9aa5e75ef710ef871c5f9b313a83050035097b56820"}, - {file = "coverage-7.2.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:cb5f152fb14857cbe7f3e8c9a5d98979c4c66319a33cad6e617f0067c9accdc4"}, - {file = "coverage-7.2.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:87dc37f16fb5e3a28429e094145bf7c1753e32bb50f662722e378c5851f7fdc6"}, - {file = "coverage-7.2.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e191a63a05851f8bce77bc875e75457f9b01d42843f8bd7feed2fc26bbe60833"}, - {file = "coverage-7.2.1-cp310-cp310-win32.whl", hash = "sha256:e3ea04b23b114572b98a88c85379e9e9ae031272ba1fb9b532aa934c621626d4"}, - {file = "coverage-7.2.1-cp310-cp310-win_amd64.whl", hash = "sha256:0cf557827be7eca1c38a2480484d706693e7bb1929e129785fe59ec155a59de6"}, - {file = "coverage-7.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:570c21a29493b350f591a4b04c158ce1601e8d18bdcd21db136fbb135d75efa6"}, - {file = "coverage-7.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9e872b082b32065ac2834149dc0adc2a2e6d8203080501e1e3c3c77851b466f9"}, - {file = "coverage-7.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fac6343bae03b176e9b58104a9810df3cdccd5cfed19f99adfa807ffbf43cf9b"}, - {file = "coverage-7.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abacd0a738e71b20e224861bc87e819ef46fedba2fb01bc1af83dfd122e9c319"}, - {file = "coverage-7.2.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d9256d4c60c4bbfec92721b51579c50f9e5062c21c12bec56b55292464873508"}, - {file = "coverage-7.2.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:80559eaf6c15ce3da10edb7977a1548b393db36cbc6cf417633eca05d84dd1ed"}, - {file = "coverage-7.2.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:0bd7e628f6c3ec4e7d2d24ec0e50aae4e5ae95ea644e849d92ae4805650b4c4e"}, - {file = "coverage-7.2.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:09643fb0df8e29f7417adc3f40aaf379d071ee8f0350ab290517c7004f05360b"}, - {file = "coverage-7.2.1-cp311-cp311-win32.whl", hash = "sha256:1b7fb13850ecb29b62a447ac3516c777b0e7a09ecb0f4bb6718a8654c87dfc80"}, - {file = "coverage-7.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:617a94ada56bbfe547aa8d1b1a2b8299e2ec1ba14aac1d4b26a9f7d6158e1273"}, - {file = "coverage-7.2.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8649371570551d2fd7dee22cfbf0b61f1747cdfb2b7587bb551e4beaaa44cb97"}, - {file = "coverage-7.2.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d2b9b5e70a21474c105a133ba227c61bc95f2ac3b66861143ce39a5ea4b3f84"}, - {file = "coverage-7.2.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae82c988954722fa07ec5045c57b6d55bc1a0890defb57cf4a712ced65b26ddd"}, - {file = "coverage-7.2.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:861cc85dfbf55a7a768443d90a07e0ac5207704a9f97a8eb753292a7fcbdfcfc"}, - {file = "coverage-7.2.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:0339dc3237c0d31c3b574f19c57985fcbe494280153bbcad33f2cdf469f4ac3e"}, - {file = "coverage-7.2.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:5928b85416a388dd557ddc006425b0c37e8468bd1c3dc118c1a3de42f59e2a54"}, - {file = "coverage-7.2.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8d3843ca645f62c426c3d272902b9de90558e9886f15ddf5efe757b12dd376f5"}, - {file = "coverage-7.2.1-cp37-cp37m-win32.whl", hash = "sha256:6a034480e9ebd4e83d1aa0453fd78986414b5d237aea89a8fdc35d330aa13bae"}, - {file = "coverage-7.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:6fce673f79a0e017a4dc35e18dc7bb90bf6d307c67a11ad5e61ca8d42b87cbff"}, - {file = "coverage-7.2.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:7f099da6958ddfa2ed84bddea7515cb248583292e16bb9231d151cd528eab657"}, - {file = "coverage-7.2.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:97a3189e019d27e914ecf5c5247ea9f13261d22c3bb0cfcfd2a9b179bb36f8b1"}, - {file = "coverage-7.2.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a81dbcf6c6c877986083d00b834ac1e84b375220207a059ad45d12f6e518a4e3"}, - {file = "coverage-7.2.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78d2c3dde4c0b9be4b02067185136b7ee4681978228ad5ec1278fa74f5ca3e99"}, - {file = "coverage-7.2.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a209d512d157379cc9ab697cbdbb4cfd18daa3e7eebaa84c3d20b6af0037384"}, - {file = "coverage-7.2.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f3d07edb912a978915576a776756069dede66d012baa503022d3a0adba1b6afa"}, - {file = "coverage-7.2.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:8dca3c1706670297851bca1acff9618455122246bdae623be31eca744ade05ec"}, - {file = "coverage-7.2.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b1991a6d64231a3e5bbe3099fb0dd7c9aeaa4275ad0e0aeff4cb9ef885c62ba2"}, - {file = "coverage-7.2.1-cp38-cp38-win32.whl", hash = "sha256:22c308bc508372576ffa3d2dbc4824bb70d28eeb4fcd79d4d1aed663a06630d0"}, - {file = "coverage-7.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:b0c0d46de5dd97f6c2d1b560bf0fcf0215658097b604f1840365296302a9d1fb"}, - {file = "coverage-7.2.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4dd34a935de268a133e4741827ae951283a28c0125ddcdbcbba41c4b98f2dfef"}, - {file = "coverage-7.2.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0f8318ed0f3c376cfad8d3520f496946977abde080439d6689d7799791457454"}, - {file = "coverage-7.2.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:834c2172edff5a08d78e2f53cf5e7164aacabeb66b369f76e7bb367ca4e2d993"}, - {file = "coverage-7.2.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4d70c853f0546855f027890b77854508bdb4d6a81242a9d804482e667fff6e6"}, - {file = "coverage-7.2.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a6450da4c7afc4534305b2b7d8650131e130610cea448ff240b6ab73d7eab63"}, - {file = "coverage-7.2.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:99f4dd81b2bb8fc67c3da68b1f5ee1650aca06faa585cbc6818dbf67893c6d58"}, - {file = "coverage-7.2.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bdd3f2f285ddcf2e75174248b2406189261a79e7fedee2ceeadc76219b6faa0e"}, - {file = "coverage-7.2.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:f29351393eb05e6326f044a7b45ed8e38cb4dcc38570d12791f271399dc41431"}, - {file = "coverage-7.2.1-cp39-cp39-win32.whl", hash = "sha256:e2b50ebc2b6121edf352336d503357321b9d8738bb7a72d06fc56153fd3f4cd8"}, - {file = "coverage-7.2.1-cp39-cp39-win_amd64.whl", hash = "sha256:bd5a12239c0006252244f94863f1c518ac256160cd316ea5c47fb1a11b25889a"}, - {file = "coverage-7.2.1-pp37.pp38.pp39-none-any.whl", hash = "sha256:436313d129db7cf5b4ac355dd2bd3f7c7e5294af077b090b85de75f8458b8616"}, - {file = "coverage-7.2.1.tar.gz", hash = "sha256:c77f2a9093ccf329dd523a9b2b3c854c20d2a3d968b6def3b820272ca6732242"}, + {file = "coverage-7.2.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:c90e73bdecb7b0d1cea65a08cb41e9d672ac6d7995603d6465ed4914b98b9ad7"}, + {file = "coverage-7.2.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e2926b8abedf750c2ecf5035c07515770944acf02e1c46ab08f6348d24c5f94d"}, + {file = "coverage-7.2.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:57b77b9099f172804e695a40ebaa374f79e4fb8b92f3e167f66facbf92e8e7f5"}, + {file = "coverage-7.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:efe1c0adad110bf0ad7fb59f833880e489a61e39d699d37249bdf42f80590169"}, + {file = "coverage-7.2.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2199988e0bc8325d941b209f4fd1c6fa007024b1442c5576f1a32ca2e48941e6"}, + {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:81f63e0fb74effd5be736cfe07d710307cc0a3ccb8f4741f7f053c057615a137"}, + {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:186e0fc9cf497365036d51d4d2ab76113fb74f729bd25da0975daab2e107fd90"}, + {file = "coverage-7.2.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:420f94a35e3e00a2b43ad5740f935358e24478354ce41c99407cddd283be00d2"}, + {file = "coverage-7.2.2-cp310-cp310-win32.whl", hash = "sha256:38004671848b5745bb05d4d621526fca30cee164db42a1f185615f39dc997292"}, + {file = "coverage-7.2.2-cp310-cp310-win_amd64.whl", hash = "sha256:0ce383d5f56d0729d2dd40e53fe3afeb8f2237244b0975e1427bfb2cf0d32bab"}, + {file = "coverage-7.2.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3eb55b7b26389dd4f8ae911ba9bc8c027411163839dea4c8b8be54c4ee9ae10b"}, + {file = "coverage-7.2.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d2b96123a453a2d7f3995ddb9f28d01fd112319a7a4d5ca99796a7ff43f02af5"}, + {file = "coverage-7.2.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:299bc75cb2a41e6741b5e470b8c9fb78d931edbd0cd009c58e5c84de57c06731"}, + {file = "coverage-7.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5e1df45c23d4230e3d56d04414f9057eba501f78db60d4eeecfcb940501b08fd"}, + {file = "coverage-7.2.2-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:006ed5582e9cbc8115d2e22d6d2144a0725db542f654d9d4fda86793832f873d"}, + {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d683d230b5774816e7d784d7ed8444f2a40e7a450e5720d58af593cb0b94a212"}, + {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8efb48fa743d1c1a65ee8787b5b552681610f06c40a40b7ef94a5b517d885c54"}, + {file = "coverage-7.2.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4c752d5264053a7cf2fe81c9e14f8a4fb261370a7bb344c2a011836a96fb3f57"}, + {file = "coverage-7.2.2-cp311-cp311-win32.whl", hash = "sha256:55272f33da9a5d7cccd3774aeca7a01e500a614eaea2a77091e9be000ecd401d"}, + {file = "coverage-7.2.2-cp311-cp311-win_amd64.whl", hash = "sha256:92ebc1619650409da324d001b3a36f14f63644c7f0a588e331f3b0f67491f512"}, + {file = "coverage-7.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5afdad4cc4cc199fdf3e18088812edcf8f4c5a3c8e6cb69127513ad4cb7471a9"}, + {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0484d9dd1e6f481b24070c87561c8d7151bdd8b044c93ac99faafd01f695c78e"}, + {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d530191aa9c66ab4f190be8ac8cc7cfd8f4f3217da379606f3dd4e3d83feba69"}, + {file = "coverage-7.2.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ac0f522c3b6109c4b764ffec71bf04ebc0523e926ca7cbe6c5ac88f84faced0"}, + {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ba279aae162b20444881fc3ed4e4f934c1cf8620f3dab3b531480cf602c76b7f"}, + {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:53d0fd4c17175aded9c633e319360d41a1f3c6e352ba94edcb0fa5167e2bad67"}, + {file = "coverage-7.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c99cb7c26a3039a8a4ee3ca1efdde471e61b4837108847fb7d5be7789ed8fd9"}, + {file = "coverage-7.2.2-cp37-cp37m-win32.whl", hash = "sha256:5cc0783844c84af2522e3a99b9b761a979a3ef10fb87fc4048d1ee174e18a7d8"}, + {file = "coverage-7.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:817295f06eacdc8623dc4df7d8b49cea65925030d4e1e2a7c7218380c0072c25"}, + {file = "coverage-7.2.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6146910231ece63facfc5984234ad1b06a36cecc9fd0c028e59ac7c9b18c38c6"}, + {file = "coverage-7.2.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:387fb46cb8e53ba7304d80aadca5dca84a2fbf6fe3faf6951d8cf2d46485d1e5"}, + {file = "coverage-7.2.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:046936ab032a2810dcaafd39cc4ef6dd295df1a7cbead08fe996d4765fca9fe4"}, + {file = "coverage-7.2.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e627dee428a176ffb13697a2c4318d3f60b2ccdde3acdc9b3f304206ec130ccd"}, + {file = "coverage-7.2.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4fa54fb483decc45f94011898727802309a109d89446a3c76387d016057d2c84"}, + {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:3668291b50b69a0c1ef9f462c7df2c235da3c4073f49543b01e7eb1dee7dd540"}, + {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:7c20b731211261dc9739bbe080c579a1835b0c2d9b274e5fcd903c3a7821cf88"}, + {file = "coverage-7.2.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5764e1f7471cb8f64b8cda0554f3d4c4085ae4b417bfeab236799863703e5de2"}, + {file = "coverage-7.2.2-cp38-cp38-win32.whl", hash = "sha256:4f01911c010122f49a3e9bdc730eccc66f9b72bd410a3a9d3cb8448bb50d65d3"}, + {file = "coverage-7.2.2-cp38-cp38-win_amd64.whl", hash = "sha256:c448b5c9e3df5448a362208b8d4b9ed85305528313fca1b479f14f9fe0d873b8"}, + {file = "coverage-7.2.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:bfe7085783cda55e53510482fa7b5efc761fad1abe4d653b32710eb548ebdd2d"}, + {file = "coverage-7.2.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:9d22e94e6dc86de981b1b684b342bec5e331401599ce652900ec59db52940005"}, + {file = "coverage-7.2.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:507e4720791977934bba016101579b8c500fb21c5fa3cd4cf256477331ddd988"}, + {file = "coverage-7.2.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bc4803779f0e4b06a2361f666e76f5c2e3715e8e379889d02251ec911befd149"}, + {file = "coverage-7.2.2-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db8c2c5ace167fd25ab5dd732714c51d4633f58bac21fb0ff63b0349f62755a8"}, + {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4f68ee32d7c4164f1e2c8797535a6d0a3733355f5861e0f667e37df2d4b07140"}, + {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d52f0a114b6a58305b11a5cdecd42b2e7f1ec77eb20e2b33969d702feafdd016"}, + {file = "coverage-7.2.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:797aad79e7b6182cb49c08cc5d2f7aa7b2128133b0926060d0a8889ac43843be"}, + {file = "coverage-7.2.2-cp39-cp39-win32.whl", hash = "sha256:db45eec1dfccdadb179b0f9ca616872c6f700d23945ecc8f21bb105d74b1c5fc"}, + {file = "coverage-7.2.2-cp39-cp39-win_amd64.whl", hash = "sha256:8dbe2647bf58d2c5a6c5bcc685f23b5f371909a5624e9f5cd51436d6a9f6c6ef"}, + {file = "coverage-7.2.2-pp37.pp38.pp39-none-any.whl", hash = "sha256:872d6ce1f5be73f05bea4df498c140b9e7ee5418bfa2cc8204e7f9b817caa968"}, + {file = "coverage-7.2.2.tar.gz", hash = "sha256:36dd42da34fe94ed98c39887b86db9d06777b1c8f860520e21126a75507024f2"}, ] [package.dependencies] @@ -2494,4 +2494,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "abc96b65c5f00203268cc628d30db3e811564dcd1eb9640c62107106b85ab360" +content-hash = "2854a6afe8c9ca83480963c7402e84c12a17e58ed3ab271040867435ed75a028" diff --git a/pyproject.toml b/pyproject.toml index bf6757631..05f50e1f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ tldextract = "3.4.0" pydantic = { version = "1.10.6", extras = ["dotenv"]} [tool.poetry.dev-dependencies] -coverage = "7.2.1" +coverage = "7.2.2" flake8 = "6.0.0" flake8-annotations = "3.0.0" flake8-bugbear = "23.3.12" -- cgit v1.2.3 From cbb5395475e586e4cf1c74202ddba7f4c496e578 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 21:27:13 +0000 Subject: Bump deepdiff from 6.2.3 to 6.3.0 (#2475) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 64 +++++----------------------------------------------------- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 60 deletions(-) diff --git a/poetry.lock b/poetry.lock index 81c392920..df783f364 100644 --- a/poetry.lock +++ b/poetry.lock @@ -459,22 +459,22 @@ toml = ["tomli"] [[package]] name = "deepdiff" -version = "6.2.3" +version = "6.3.0" description = "Deep Difference and Search of any Python object/data. Recreate objects by adding adding deltas to each other." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "deepdiff-6.2.3-py3-none-any.whl", hash = "sha256:d83b06e043447d6770860a635abecb46e849b0494c43ced2ecafda7628c7ce72"}, - {file = "deepdiff-6.2.3.tar.gz", hash = "sha256:a02aaa8171351eba675cff5f795ec7a90987f86ad5449553308d4e18df57dc3d"}, + {file = "deepdiff-6.3.0-py3-none-any.whl", hash = "sha256:15838bd1cbd046ce15ed0c41e837cd04aff6b3e169c5e06fca69d7aa11615ceb"}, + {file = "deepdiff-6.3.0.tar.gz", hash = "sha256:6a3bf1e7228ac5c71ca2ec43505ca0a743ff54ec77aa08d7db22de6bc7b2b644"}, ] [package.dependencies] ordered-set = ">=4.0.2,<4.2.0" -orjson = "*" [package.extras] cli = ["click (==8.1.3)", "pyyaml (==6.0)"] +optimize = ["orjson"] [[package]] name = "discord-py" @@ -1294,60 +1294,6 @@ files = [ [package.extras] dev = ["black", "mypy", "pytest"] -[[package]] -name = "orjson" -version = "3.8.7" -description = "Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy" -category = "main" -optional = false -python-versions = ">=3.7" -files = [ - {file = "orjson-3.8.7-cp310-cp310-macosx_10_7_x86_64.whl", hash = "sha256:f98c82850b7b4b7e27785ca43706fa86c893cdb88d54576bbb9b0d9c1070e421"}, - {file = "orjson-3.8.7-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:1dee503c6c1a0659c5b46f5f39d9ca9d3657b11ca8bb4af8506086df416887d9"}, - {file = "orjson-3.8.7-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc4fa83831f42ce5c938f8cefc2e175fa1df6f661fdeaba3badf26d2b8cfcf73"}, - {file = "orjson-3.8.7-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9e432c6c9c8b97ad825276d5795286f7cc9689f377a97e3b7ecf14918413303f"}, - {file = "orjson-3.8.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ee519964a5a0efb9633f38b1129fd242807c5c57162844efeeaab1c8de080051"}, - {file = "orjson-3.8.7-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:109b539ce5bf60a121454d008fa67c3b67e5a3249e47d277012645922cf74bd0"}, - {file = "orjson-3.8.7-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:ad4d441fbde4133af6fee37f67dbf23181b9c537ecc317346ec8c3b4c8ec7705"}, - {file = "orjson-3.8.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:89dc786419e1ce2588345f58dd6a434e6728bce66b94989644234bcdbe39b603"}, - {file = "orjson-3.8.7-cp310-none-win_amd64.whl", hash = "sha256:697abde7350fb8076d44bcb6b4ab3ce415ae2b5a9bb91efc460e5ab0d96bb5d3"}, - {file = "orjson-3.8.7-cp311-cp311-macosx_10_7_x86_64.whl", hash = "sha256:1c19f47b35b9966a3abadf341b18ee4a860431bf2b00fd8d58906d51cf78aa70"}, - {file = "orjson-3.8.7-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:3ffaabb380cd0ee187b4fc362516df6bf739808130b1339445c7d8878fca36e7"}, - {file = "orjson-3.8.7-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5d88837002c5a8af970745b8e0ca1b0fdb06aafbe7f1279e110d338ea19f3d23"}, - {file = "orjson-3.8.7-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:ff60187d1b7e0bfab376b6002b08c560b7de06c87cf3a8ac639ecf58f84c5f3b"}, - {file = "orjson-3.8.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0110970aed35dec293f30ed1e09f8604afd5d15c5ef83de7f6c427619b3ba47b"}, - {file = "orjson-3.8.7-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:51b275475d4e36118b65ad56f9764056a09d985c5d72e64579bf8816f1356a5e"}, - {file = "orjson-3.8.7-cp311-none-win_amd64.whl", hash = "sha256:63144d27735f3b60f079f247ac9a289d80dfe49a7f03880dfa0c0ba64d6491d5"}, - {file = "orjson-3.8.7-cp37-cp37m-macosx_10_7_x86_64.whl", hash = "sha256:a16273d77db746bb1789a2bbfded81148a60743fd6f9d5185e02d92e3732fa18"}, - {file = "orjson-3.8.7-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:5bb32259ea22cc9dd47a6fdc4b8f9f1e2f798fcf56c7c1122a7df0f4c5d33bf3"}, - {file = "orjson-3.8.7-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad02e9102d4ba67db30a136e631e32aeebd1dce26c9f5942a457b02df131c5d0"}, - {file = "orjson-3.8.7-cp37-cp37m-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:dbcfcec2b7ac52deb7be3685b551addc28ee8fa454ef41f8b714df6ba0e32a27"}, - {file = "orjson-3.8.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e1a0e5504a5fc86083cc210c6946e8d61e13fe9f1d7a7bf81b42f7050a49d4fb"}, - {file = "orjson-3.8.7-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:7bd4fd37adb03b1f2a1012d43c9f95973a02164e131dfe3ff804d7e180af5653"}, - {file = "orjson-3.8.7-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:188ed9f9a781333ad802af54c55d5a48991e292239aef41bd663b6e314377eb8"}, - {file = "orjson-3.8.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:cc52f58c688cb10afd810280e450f56fbcb27f52c053463e625c8335c95db0dc"}, - {file = "orjson-3.8.7-cp37-none-win_amd64.whl", hash = "sha256:403c8c84ac8a02c40613b0493b74d5256379e65196d39399edbf2ed3169cbeb5"}, - {file = "orjson-3.8.7-cp38-cp38-macosx_10_7_x86_64.whl", hash = "sha256:7d6ac5f8a2a17095cd927c4d52abbb38af45918e0d3abd60fb50cfd49d71ae24"}, - {file = "orjson-3.8.7-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:0295a7bfd713fa89231fd0822c995c31fc2343c59a1d13aa1b8b6651335654f5"}, - {file = "orjson-3.8.7-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:feb32aaaa34cf2f891eb793ad320d4bb6731328496ae59b6c9eb1b620c42b529"}, - {file = "orjson-3.8.7-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7a3ab1a473894e609b6f1d763838c6689ba2b97620c256a32c4d9f10595ac179"}, - {file = "orjson-3.8.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e8c430d82b532c5ab95634e034bbf6ca7432ffe175a3e63eadd493e00b3a555"}, - {file = "orjson-3.8.7-cp38-cp38-manylinux_2_28_x86_64.whl", hash = "sha256:366cc75f7e09106f9dac95a675aef413367b284f25507d21e55bd7f45f445e80"}, - {file = "orjson-3.8.7-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:84d154d07e8b17d97e990d5d710b719a031738eb1687d8a05b9089f0564ff3e0"}, - {file = "orjson-3.8.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06180014afcfdc167ca984b312218aa62ce20093965c437c5f9166764cb65ef7"}, - {file = "orjson-3.8.7-cp38-none-win_amd64.whl", hash = "sha256:41244431ba13f2e6ef22b52c5cf0202d17954489f4a3c0505bd28d0e805c3546"}, - {file = "orjson-3.8.7-cp39-cp39-macosx_10_7_x86_64.whl", hash = "sha256:b20f29fa8371b8023f1791df035a2c3ccbd98baa429ac3114fc104768f7db6f8"}, - {file = "orjson-3.8.7-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:226bfc1da2f21ee74918cee2873ea9a0fec1a8830e533cb287d192d593e99d02"}, - {file = "orjson-3.8.7-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e75c11023ac29e29fd3e75038d0e8dd93f9ea24d7b9a5e871967a8921a88df24"}, - {file = "orjson-3.8.7-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:78604d3acfd7cd502f6381eea0c42281fe2b74755b334074ab3ebc0224100be1"}, - {file = "orjson-3.8.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7129a6847f0494aa1427167486ef6aea2e835ba05f6c627df522692ee228f65"}, - {file = "orjson-3.8.7-cp39-cp39-manylinux_2_28_x86_64.whl", hash = "sha256:1a1a8f4980059f48483782c608145b0f74538c266e01c183d9bcd9f8b71dbada"}, - {file = "orjson-3.8.7-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d60304172a33705ce4bd25a6261ab84bed2dab0b3d3b79672ea16c7648af4832"}, - {file = "orjson-3.8.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4f733062d84389c32c0492e5a4929056fac217034a94523debe0430bcc602cda"}, - {file = "orjson-3.8.7-cp39-none-win_amd64.whl", hash = "sha256:010e2970ec9e826c332819e0da4b14b29b19641da0f1a6af4cec91629ef9b988"}, - {file = "orjson-3.8.7.tar.gz", hash = "sha256:8460c8810652dba59c38c80d27c325b5092d189308d8d4f3e688dbd8d4f3b2dc"}, -] - [[package]] name = "packaging" version = "23.0" @@ -2494,4 +2440,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "2854a6afe8c9ca83480963c7402e84c12a17e58ed3ab271040867435ed75a028" +content-hash = "f3f69e9b50da6cd6ffd8ca251e747a853358eb723e978deca2d53a9aab8db234" diff --git a/pyproject.toml b/pyproject.toml index 05f50e1f4..783c0941a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ arrow = "1.2.3" beautifulsoup4 = "4.11.2" colorama = { version = "0.4.6", markers = "sys_platform == 'win32'" } coloredlogs = "15.0.1" -deepdiff = "6.2.3" +deepdiff = "6.3.0" emoji = "2.2.0" feedparser = "6.0.10" lxml = "4.9.2" -- cgit v1.2.3 From 24c08d57171bb532a5da882c444aa1e2c2427f9f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:24:50 +0000 Subject: Bump pydantic from 1.10.6 to 1.10.7 (#2481) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 76 +++++++++++++++++++++++++++++----------------------------- pyproject.toml | 2 +- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/poetry.lock b/poetry.lock index df783f364..437a06e4d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1529,48 +1529,48 @@ files = [ [[package]] name = "pydantic" -version = "1.10.6" +version = "1.10.7" description = "Data validation and settings management using python type hints" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9289065611c48147c1dd1fd344e9d57ab45f1d99b0fb26c51f1cf72cd9bcd31"}, - {file = "pydantic-1.10.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8c32b6bba301490d9bb2bf5f631907803135e8085b6aa3e5fe5a770d46dd0160"}, - {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd9b9e98068fa1068edfc9eabde70a7132017bdd4f362f8b4fd0abed79c33083"}, - {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c84583b9df62522829cbc46e2b22e0ec11445625b5acd70c5681ce09c9b11c4"}, - {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b41822064585fea56d0116aa431fbd5137ce69dfe837b599e310034171996084"}, - {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61f1f08adfaa9cc02e0cbc94f478140385cbd52d5b3c5a657c2fceb15de8d1fb"}, - {file = "pydantic-1.10.6-cp310-cp310-win_amd64.whl", hash = "sha256:32937835e525d92c98a1512218db4eed9ddc8f4ee2a78382d77f54341972c0e7"}, - {file = "pydantic-1.10.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bbd5c531b22928e63d0cb1868dee76123456e1de2f1cb45879e9e7a3f3f1779b"}, - {file = "pydantic-1.10.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e277bd18339177daa62a294256869bbe84df1fb592be2716ec62627bb8d7c81d"}, - {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f15277d720aa57e173954d237628a8d304896364b9de745dcb722f584812c7"}, - {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b243b564cea2576725e77aeeda54e3e0229a168bc587d536cd69941e6797543d"}, - {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3ce13a558b484c9ae48a6a7c184b1ba0e5588c5525482681db418268e5f86186"}, - {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3ac1cd4deed871dfe0c5f63721e29debf03e2deefa41b3ed5eb5f5df287c7b70"}, - {file = "pydantic-1.10.6-cp311-cp311-win_amd64.whl", hash = "sha256:b1eb6610330a1dfba9ce142ada792f26bbef1255b75f538196a39e9e90388bf4"}, - {file = "pydantic-1.10.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4ca83739c1263a044ec8b79df4eefc34bbac87191f0a513d00dd47d46e307a65"}, - {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea4e2a7cb409951988e79a469f609bba998a576e6d7b9791ae5d1e0619e1c0f2"}, - {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53de12b4608290992a943801d7756f18a37b7aee284b9ffa794ee8ea8153f8e2"}, - {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:60184e80aac3b56933c71c48d6181e630b0fbc61ae455a63322a66a23c14731a"}, - {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:415a3f719ce518e95a92effc7ee30118a25c3d032455d13e121e3840985f2efd"}, - {file = "pydantic-1.10.6-cp37-cp37m-win_amd64.whl", hash = "sha256:72cb30894a34d3a7ab6d959b45a70abac8a2a93b6480fc5a7bfbd9c935bdc4fb"}, - {file = "pydantic-1.10.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3091d2eaeda25391405e36c2fc2ed102b48bac4b384d42b2267310abae350ca6"}, - {file = "pydantic-1.10.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:751f008cd2afe812a781fd6aa2fb66c620ca2e1a13b6a2152b1ad51553cb4b77"}, - {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12e837fd320dd30bd625be1b101e3b62edc096a49835392dcf418f1a5ac2b832"}, - {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:587d92831d0115874d766b1f5fddcdde0c5b6c60f8c6111a394078ec227fca6d"}, - {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:476f6674303ae7965730a382a8e8d7fae18b8004b7b69a56c3d8fa93968aa21c"}, - {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3a2be0a0f32c83265fd71a45027201e1278beaa82ea88ea5b345eea6afa9ac7f"}, - {file = "pydantic-1.10.6-cp38-cp38-win_amd64.whl", hash = "sha256:0abd9c60eee6201b853b6c4be104edfba4f8f6c5f3623f8e1dba90634d63eb35"}, - {file = "pydantic-1.10.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6195ca908045054dd2d57eb9c39a5fe86409968b8040de8c2240186da0769da7"}, - {file = "pydantic-1.10.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:43cdeca8d30de9a897440e3fb8866f827c4c31f6c73838e3a01a14b03b067b1d"}, - {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c19eb5163167489cb1e0161ae9220dadd4fc609a42649e7e84a8fa8fff7a80f"}, - {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:012c99a9c0d18cfde7469aa1ebff922e24b0c706d03ead96940f5465f2c9cf62"}, - {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:528dcf7ec49fb5a84bf6fe346c1cc3c55b0e7603c2123881996ca3ad79db5bfc"}, - {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:163e79386c3547c49366e959d01e37fc30252285a70619ffc1b10ede4758250a"}, - {file = "pydantic-1.10.6-cp39-cp39-win_amd64.whl", hash = "sha256:189318051c3d57821f7233ecc94708767dd67687a614a4e8f92b4a020d4ffd06"}, - {file = "pydantic-1.10.6-py3-none-any.whl", hash = "sha256:acc6783751ac9c9bc4680379edd6d286468a1dc8d7d9906cd6f1186ed682b2b0"}, - {file = "pydantic-1.10.6.tar.gz", hash = "sha256:cf95adb0d1671fc38d8c43dd921ad5814a735e7d9b4d9e437c088002863854fd"}, + {file = "pydantic-1.10.7-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e79e999e539872e903767c417c897e729e015872040e56b96e67968c3b918b2d"}, + {file = "pydantic-1.10.7-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:01aea3a42c13f2602b7ecbbea484a98169fb568ebd9e247593ea05f01b884b2e"}, + {file = "pydantic-1.10.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:516f1ed9bc2406a0467dd777afc636c7091d71f214d5e413d64fef45174cfc7a"}, + {file = "pydantic-1.10.7-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae150a63564929c675d7f2303008d88426a0add46efd76c3fc797cd71cb1b46f"}, + {file = "pydantic-1.10.7-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ecbbc51391248116c0a055899e6c3e7ffbb11fb5e2a4cd6f2d0b93272118a209"}, + {file = "pydantic-1.10.7-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:f4a2b50e2b03d5776e7f21af73e2070e1b5c0d0df255a827e7c632962f8315af"}, + {file = "pydantic-1.10.7-cp310-cp310-win_amd64.whl", hash = "sha256:a7cd2251439988b413cb0a985c4ed82b6c6aac382dbaff53ae03c4b23a70e80a"}, + {file = "pydantic-1.10.7-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:68792151e174a4aa9e9fc1b4e653e65a354a2fa0fed169f7b3d09902ad2cb6f1"}, + {file = "pydantic-1.10.7-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dfe2507b8ef209da71b6fb5f4e597b50c5a34b78d7e857c4f8f3115effaef5fe"}, + {file = "pydantic-1.10.7-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10a86d8c8db68086f1e30a530f7d5f83eb0685e632e411dbbcf2d5c0150e8dcd"}, + {file = "pydantic-1.10.7-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d75ae19d2a3dbb146b6f324031c24f8a3f52ff5d6a9f22f0683694b3afcb16fb"}, + {file = "pydantic-1.10.7-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:464855a7ff7f2cc2cf537ecc421291b9132aa9c79aef44e917ad711b4a93163b"}, + {file = "pydantic-1.10.7-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:193924c563fae6ddcb71d3f06fa153866423ac1b793a47936656e806b64e24ca"}, + {file = "pydantic-1.10.7-cp311-cp311-win_amd64.whl", hash = "sha256:b4a849d10f211389502059c33332e91327bc154acc1845f375a99eca3afa802d"}, + {file = "pydantic-1.10.7-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cc1dde4e50a5fc1336ee0581c1612215bc64ed6d28d2c7c6f25d2fe3e7c3e918"}, + {file = "pydantic-1.10.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e0cfe895a504c060e5d36b287ee696e2fdad02d89e0d895f83037245218a87fe"}, + {file = "pydantic-1.10.7-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:670bb4683ad1e48b0ecb06f0cfe2178dcf74ff27921cdf1606e527d2617a81ee"}, + {file = "pydantic-1.10.7-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:950ce33857841f9a337ce07ddf46bc84e1c4946d2a3bba18f8280297157a3fd1"}, + {file = "pydantic-1.10.7-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c15582f9055fbc1bfe50266a19771bbbef33dd28c45e78afbe1996fd70966c2a"}, + {file = "pydantic-1.10.7-cp37-cp37m-win_amd64.whl", hash = "sha256:82dffb306dd20bd5268fd6379bc4bfe75242a9c2b79fec58e1041fbbdb1f7914"}, + {file = "pydantic-1.10.7-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8c7f51861d73e8b9ddcb9916ae7ac39fb52761d9ea0df41128e81e2ba42886cd"}, + {file = "pydantic-1.10.7-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:6434b49c0b03a51021ade5c4daa7d70c98f7a79e95b551201fff682fc1661245"}, + {file = "pydantic-1.10.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64d34ab766fa056df49013bb6e79921a0265204c071984e75a09cbceacbbdd5d"}, + {file = "pydantic-1.10.7-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:701daea9ffe9d26f97b52f1d157e0d4121644f0fcf80b443248434958fd03dc3"}, + {file = "pydantic-1.10.7-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cf135c46099ff3f919d2150a948ce94b9ce545598ef2c6c7bf55dca98a304b52"}, + {file = "pydantic-1.10.7-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b0f85904f73161817b80781cc150f8b906d521fa11e3cdabae19a581c3606209"}, + {file = "pydantic-1.10.7-cp38-cp38-win_amd64.whl", hash = "sha256:9f6f0fd68d73257ad6685419478c5aece46432f4bdd8d32c7345f1986496171e"}, + {file = "pydantic-1.10.7-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c230c0d8a322276d6e7b88c3f7ce885f9ed16e0910354510e0bae84d54991143"}, + {file = "pydantic-1.10.7-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:976cae77ba6a49d80f461fd8bba183ff7ba79f44aa5cfa82f1346b5626542f8e"}, + {file = "pydantic-1.10.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7d45fc99d64af9aaf7e308054a0067fdcd87ffe974f2442312372dfa66e1001d"}, + {file = "pydantic-1.10.7-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d2a5ebb48958754d386195fe9e9c5106f11275867051bf017a8059410e9abf1f"}, + {file = "pydantic-1.10.7-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:abfb7d4a7cd5cc4e1d1887c43503a7c5dd608eadf8bc615413fc498d3e4645cd"}, + {file = "pydantic-1.10.7-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:80b1fab4deb08a8292d15e43a6edccdffa5377a36a4597bb545b93e79c5ff0a5"}, + {file = "pydantic-1.10.7-cp39-cp39-win_amd64.whl", hash = "sha256:d71e69699498b020ea198468e2480a2f1e7433e32a3a99760058c6520e2bea7e"}, + {file = "pydantic-1.10.7-py3-none-any.whl", hash = "sha256:0cd181f1d0b1d00e2b705f1bf1ac7799a2d938cce3376b8007df62b29be3c2c6"}, + {file = "pydantic-1.10.7.tar.gz", hash = "sha256:cfc83c0678b6ba51b0532bea66860617c4cd4251ecf76e9846fa5a9f3454e97e"}, ] [package.dependencies] @@ -2440,4 +2440,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "f3f69e9b50da6cd6ffd8ca251e747a853358eb723e978deca2d53a9aab8db234" +content-hash = "2d3a027d954326fcde58b1f5fa0db197dbbfd57ac799ff393e58cb3bc5bb008b" diff --git a/pyproject.toml b/pyproject.toml index 783c0941a..07406f3fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ rapidfuzz = "2.13.7" regex = "2022.10.31" sentry-sdk = "1.17.0" tldextract = "3.4.0" -pydantic = { version = "1.10.6", extras = ["dotenv"]} +pydantic = { version = "1.10.7", extras = ["dotenv"]} [tool.poetry.dev-dependencies] coverage = "7.2.2" -- cgit v1.2.3 From aade5636ef4e487491b3b36f986fdfed9b490263 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:30:21 +0000 Subject: Bump pre-commit from 3.1.1 to 3.2.0 (#2479) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 437a06e4d..e5cac79c2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1373,14 +1373,14 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.1.1" +version = "3.2.0" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "pre_commit-3.1.1-py2.py3-none-any.whl", hash = "sha256:b80254e60668e1dd1f5c03a1c9e0413941d61f568a57d745add265945f65bfe8"}, - {file = "pre_commit-3.1.1.tar.gz", hash = "sha256:d63e6537f9252d99f65755ae5b79c989b462d511ebbc481b561db6a297e1e865"}, + {file = "pre_commit-3.2.0-py2.py3-none-any.whl", hash = "sha256:f712d3688102e13c8e66b7d7dbd8934a6dda157e58635d89f7d6fecdca39ce8a"}, + {file = "pre_commit-3.2.0.tar.gz", hash = "sha256:818f0d998059934d0f81bb3667e3ccdc32da6ed7ccaac33e43dc231561ddaaa9"}, ] [package.dependencies] @@ -2440,4 +2440,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "2d3a027d954326fcde58b1f5fa0db197dbbfd57ac799ff393e58cb3bc5bb008b" +content-hash = "5f63b3a89c3b2078fdc3556844b0656f72b8bd7bbe868342e2df8579583e3637" diff --git a/pyproject.toml b/pyproject.toml index 07406f3fe..ec3ca4777 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,7 @@ flake8-tidy-imports = "4.8.0" flake8-todo = "0.7" flake8-isort = "6.0.0" pep8-naming = "0.13.3" -pre-commit = "3.1.1" +pre-commit = "3.2.0" pip-licenses = "4.1.0" pytest = "7.2.2" pytest-cov = "4.0.0" -- cgit v1.2.3 From 5e57fc4258d54ae8cfbf6d57be746fffaddb07bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 24 Mar 2023 17:34:52 +0000 Subject: Bump beautifulsoup4 from 4.11.2 to 4.12.0 (#2480) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index e5cac79c2..0ac72c156 100644 --- a/poetry.lock +++ b/poetry.lock @@ -227,14 +227,14 @@ tests-no-zope = ["cloudpickle", "cloudpickle", "hypothesis", "hypothesis", "mypy [[package]] name = "beautifulsoup4" -version = "4.11.2" +version = "4.12.0" description = "Screen-scraping library" category = "main" optional = false python-versions = ">=3.6.0" files = [ - {file = "beautifulsoup4-4.11.2-py3-none-any.whl", hash = "sha256:0e79446b10b3ecb499c1556f7e228a53e64a2bfcebd455f370d8927cb5b59e39"}, - {file = "beautifulsoup4-4.11.2.tar.gz", hash = "sha256:bc4bdda6717de5a2987436fb8d72f45dc90dd856bdfd512a1314ce90349a0106"}, + {file = "beautifulsoup4-4.12.0-py3-none-any.whl", hash = "sha256:2130a5ad7f513200fae61a17abb5e338ca980fa28c439c0571014bc0217e9591"}, + {file = "beautifulsoup4-4.12.0.tar.gz", hash = "sha256:c5fceeaec29d09c84970e47c65f2f0efe57872f7cff494c9691a26ec0ff13234"}, ] [package.dependencies] @@ -2440,4 +2440,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.10.*" -content-hash = "5f63b3a89c3b2078fdc3556844b0656f72b8bd7bbe868342e2df8579583e3637" +content-hash = "9073fa02a1c88d59ffbd3a71ef1e0d64ffb3111b499a642c1b3f565abfc6dccd" diff --git a/pyproject.toml b/pyproject.toml index ec3ca4777..577930409 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ pydis_core = { version = "9.5.1", extras = ["async-rediscache"] } aiohttp = "3.8.4" arrow = "1.2.3" -beautifulsoup4 = "4.11.2" +beautifulsoup4 = "4.12.0" colorama = { version = "0.4.6", markers = "sys_platform == 'win32'" } coloredlogs = "15.0.1" deepdiff = "6.3.0" -- cgit v1.2.3 From cc36306547b2b40abfa95a247504aba06a9ea9b6 Mon Sep 17 00:00:00 2001 From: wookie184 Date: Fri, 24 Mar 2023 19:58:42 +0000 Subject: Improve wording in botstrap error --- botstrap.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/botstrap.py b/botstrap.py index 90a954d9b..90c2c2fbc 100644 --- a/botstrap.py +++ b/botstrap.py @@ -18,16 +18,16 @@ GUILD_ID = os.getenv("GUILD_ID", None) if not BOT_TOKEN: message = ( - "Couldn't find BOT_TOKEN in the environment variables." - "Make sure to add it to the `.env` file likewise: `BOT_TOKEN=value_of_your_bot_token`" + "Couldn't find the `BOT_TOKEN` environment variable. " + "Make sure to add it to your `.env` file like this: `BOT_TOKEN=value_of_your_bot_token`" ) log.warning(message) raise ValueError(message) if not GUILD_ID: message = ( - "Couldn't find GUILD_ID in the environment variables." - "Make sure to add it to the `.env` file likewise: `GUILD_ID=value_of_your_discord_server_id`" + "Couldn't find the `GUILD_ID` environment variable. " + "Make sure to add it to your `.env` file like this: `GUILD_ID=value_of_your_discord_server_id`" ) log.warning(message) raise ValueError(message) -- cgit v1.2.3 From a92f8f41fb20f0083c3c44f074badba302270259 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 25 Mar 2023 14:14:09 +0100 Subject: get rid of site config variable --- bot/constants.py | 12 +++--------- bot/exts/filters/antimalware.py | 6 +++--- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 4186472b1..d9e0b755c 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -527,10 +527,9 @@ class _BaseURLs(EnvConfig): github_bot_repo = "https://github.com/python-discord/bot" # Site - site = "pythondiscord.com" - site_schema = "https://" site_api = "site.default.svc.cluster.local/api" site_api_schema = "http://" + site_paste = "https://paste.pythondiscord.com" BaseURLs = _BaseURLs() @@ -545,13 +544,8 @@ class _URLs(_BaseURLs): connect_max_retries = 3 connect_cooldown = 5 - site_staff: str = "".join([BaseURLs.site_schema, BaseURLs.site, "/staff"]) - site_paste = "".join(["paste.", BaseURLs.site]) - - # Site endpoints - site_logs_view: str = "".join([BaseURLs.site_schema, BaseURLs.site, "/staff/bot/logs"]) - paste_service: str = "".join([BaseURLs.site_schema, "paste.", BaseURLs.site, "/{key}"]) - + paste_service: str = "".join([BaseURLs.site_paste, "/{key}"]) + site_logs_view: str = "https://pythondiscord.com/staff/bot/logs" URLs = _URLs() diff --git a/bot/exts/filters/antimalware.py b/bot/exts/filters/antimalware.py index ff39700a6..0a72a6db7 100644 --- a/bot/exts/filters/antimalware.py +++ b/bot/exts/filters/antimalware.py @@ -5,7 +5,7 @@ from discord import Embed, Message, NotFound from discord.ext.commands import Cog from bot.bot import Bot -from bot.constants import Channels, Filter, URLs +from bot.constants import BaseURLs, Channels, Filter from bot.exts.events.code_jams._channels import CATEGORY_NAME as JAM_CATEGORY_NAME from bot.log import get_logger @@ -13,13 +13,13 @@ log = get_logger(__name__) PY_EMBED_DESCRIPTION = ( "It looks like you tried to attach a Python file - " - f"please use a code-pasting service such as {URLs.site_schema}{URLs.site_paste}" + f"please use a code-pasting service such as {BaseURLs.site_paste}" ) TXT_LIKE_FILES = {".txt", ".csv", ".json"} TXT_EMBED_DESCRIPTION = ( "You either uploaded a `{blocked_extension}` file or entered a message that was too long. " - f"Please use our [paste bin]({URLs.site_schema}{URLs.site_paste}) instead." + f"Please use our [paste bin]({BaseURLs.site_paste}) instead." ) DISALLOWED_EMBED_DESCRIPTION = ( -- cgit v1.2.3 From 4af76d0af54de790bf0b6289754617decbef33f6 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 25 Mar 2023 14:22:39 +0100 Subject: rename schema to scheme --- bot/__main__.py | 2 +- bot/constants.py | 2 +- bot/exts/utils/ping.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/__main__.py b/bot/__main__.py index c8843e1a3..003cbbcda 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -66,7 +66,7 @@ async def main() -> None: intents=intents, allowed_roles=list({discord.Object(id_) for id_ in constants.MODERATION_ROLES}), api_client=APIClient( - site_api_url=f"{constants.URLs.site_api_schema}{constants.URLs.site_api}", + site_api_url=f"{constants.URLs.site_api_scheme}{constants.URLs.site_api}", site_api_token=constants.Keys.site_api, ), ) diff --git a/bot/constants.py b/bot/constants.py index d9e0b755c..67c21816a 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -528,7 +528,7 @@ class _BaseURLs(EnvConfig): # Site site_api = "site.default.svc.cluster.local/api" - site_api_schema = "http://" + site_api_scheme = "http://" site_paste = "https://paste.pythondiscord.com" diff --git a/bot/exts/utils/ping.py b/bot/exts/utils/ping.py index 67a960365..20e956e03 100644 --- a/bot/exts/utils/ping.py +++ b/bot/exts/utils/ping.py @@ -38,7 +38,7 @@ class Latency(commands.Cog): bot_ping = f"{bot_ping:.{ROUND_LATENCY}f} ms" try: - async with self.bot.http_session.get(f"{URLs.site_api_schema}{URLs.site_api}/healthcheck") as request: + async with self.bot.http_session.get(f"{URLs.site_api_scheme}{URLs.site_api}/healthcheck") as request: request.raise_for_status() site_status = "Healthy" -- cgit v1.2.3 From c4e896373e35a4aaefe4948816689fbbb893d0d0 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sat, 25 Mar 2023 14:30:46 +0100 Subject: rename site_api to site_api_client inside NominationApi for better differentiation with our site_api constant --- bot/exts/recruitment/talentpool/_api.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/exts/recruitment/talentpool/_api.py b/bot/exts/recruitment/talentpool/_api.py index c00c8c09c..e9e60890a 100644 --- a/bot/exts/recruitment/talentpool/_api.py +++ b/bot/exts/recruitment/talentpool/_api.py @@ -29,8 +29,8 @@ class Nomination(BaseModel): class NominationAPI: """Abstraction of site API interaction for talentpool.""" - def __init__(self, site_api: APIClient): - self.site_api = site_api + def __init__(self, site_api_client: APIClient): + self.site_api_client = site_api_client async def get_nominations( self, @@ -49,13 +49,13 @@ class NominationAPI: if user_id is not None: params["user__id"] = str(user_id) - data = await self.site_api.get("bot/nominations", params=params) + data = await self.site_api_client.get("bot/nominations", params=params) nominations = parse_obj_as(list[Nomination], data) return nominations async def get_nomination(self, nomination_id: int) -> Nomination: """Fetch a nomination by ID.""" - data = await self.site_api.get(f"bot/nominations/{nomination_id}") + data = await self.site_api_client.get(f"bot/nominations/{nomination_id}") nomination = Nomination.parse_obj(data) return nomination @@ -83,7 +83,7 @@ class NominationAPI: if thread_id is not None: data["thread_id"] = thread_id - result = await self.site_api.patch(f"bot/nominations/{nomination_id}", json=data) + result = await self.site_api_client.patch(f"bot/nominations/{nomination_id}", json=data) return Nomination.parse_obj(result) async def edit_nomination_entry( @@ -95,7 +95,7 @@ class NominationAPI: ) -> Nomination: """Edit a nomination entry.""" data = {"actor": actor_id, "reason": reason} - result = await self.site_api.patch(f"bot/nominations/{nomination_id}", json=data) + result = await self.site_api_client.patch(f"bot/nominations/{nomination_id}", json=data) return Nomination.parse_obj(result) async def post_nomination( @@ -110,5 +110,5 @@ class NominationAPI: "reason": reason, "user": user_id, } - result = await self.site_api.post("bot/nominations", json=data) + result = await self.site_api_client.post("bot/nominations", json=data) return Nomination.parse_obj(result) -- cgit v1.2.3 From cb48b72b26edf21554fb34564da93ddc99032c2a Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Sat, 25 Mar 2023 19:14:18 -0600 Subject: Update required wording --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 0fd672cf0..0fb11de8b 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -19,4 +19,4 @@ sorted(list_to_sort) print(list_to_sort) # The list still isn't sorted. Why? ``` -To avoid these errors and unexpected results, it is required to assign the result of `sorted(...)` to a new variable and use `list.sort()` method in the original list. This way, the original list will be sorted and the new list will be created with the sorted elements. +To avoid these errors and unexpected results, you should either use an out-of-place operation `(sorted(...))` and assign it to a variable or use an in-place operation `(list.sort())` without assignment. -- cgit v1.2.3 From 26959a11a06a5ae221dc754bb8a0f762a4eb6d5c Mon Sep 17 00:00:00 2001 From: Brody Critchlow Date: Tue, 28 Mar 2023 15:56:44 -0600 Subject: Change Wording Co-authored-by: dawn <78233879+dawnofmidnight@users.noreply.github.com> --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 0fb11de8b..2813b9e57 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -3,7 +3,7 @@ embed: title: "Out of place and in place" --- -In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object, without creating a new one. These operations return None explicitly. +In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object without creating a new one, and return `None` explicitly. A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. -- cgit v1.2.3 From 701732bf40c83330b6c77bbf126920c054af02be Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 3 Mar 2023 15:05:16 +0100 Subject: Upgrade to Python 3.11 in pyproject.toml This also bumps some dev deps to latest --- poetry.lock | 188 ++++++++++++++++++++++++++++++++++++--------------------- pyproject.toml | 8 +-- 2 files changed, 123 insertions(+), 73 deletions(-) diff --git a/poetry.lock b/poetry.lock index 0ac72c156..4e7cbb9e0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -347,19 +347,89 @@ files = [ [[package]] name = "charset-normalizer" -version = "2.1.1" +version = "3.1.0" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false -python-versions = ">=3.6.0" -files = [ - {file = "charset-normalizer-2.1.1.tar.gz", hash = "sha256:5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"}, - {file = "charset_normalizer-2.1.1-py3-none-any.whl", hash = "sha256:83e9a75d1911279afd89352c68b45348559d1fc0506b054b346651b5e7fee29f"}, +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.1.0.tar.gz", hash = "sha256:34e0a2f9c370eb95597aae63bf85eb5e96826d81e3dcf88b8886012906f509b5"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e0ac8959c929593fee38da1c2b64ee9778733cdf03c482c9ff1d508b6b593b2b"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:d7fc3fca01da18fbabe4625d64bb612b533533ed10045a2ac3dd194bfa656b60"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:04eefcee095f58eaabe6dc3cc2262f3bcd776d2c67005880894f447b3f2cb9c1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20064ead0717cf9a73a6d1e779b23d149b53daf971169289ed2ed43a71e8d3b0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1435ae15108b1cb6fffbcea2af3d468683b7afed0169ad718451f8db5d1aff6f"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c84132a54c750fda57729d1e2599bb598f5fa0344085dbde5003ba429a4798c0"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75f2568b4189dda1c567339b48cba4ac7384accb9c2a7ed655cd86b04055c795"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:11d3bcb7be35e7b1bba2c23beedac81ee893ac9871d0ba79effc7fc01167db6c"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:891cf9b48776b5c61c700b55a598621fdb7b1e301a550365571e9624f270c203"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:5f008525e02908b20e04707a4f704cd286d94718f48bb33edddc7d7b584dddc1"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:b06f0d3bf045158d2fb8837c5785fe9ff9b8c93358be64461a1089f5da983137"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:49919f8400b5e49e961f320c735388ee686a62327e773fa5b3ce6721f7e785ce"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:22908891a380d50738e1f978667536f6c6b526a2064156203d418f4856d6e86a"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win32.whl", hash = "sha256:12d1a39aa6b8c6f6248bb54550efcc1c38ce0d8096a146638fd4738e42284448"}, + {file = "charset_normalizer-3.1.0-cp310-cp310-win_amd64.whl", hash = "sha256:65ed923f84a6844de5fd29726b888e58c62820e0769b76565480e1fdc3d062f8"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:9a3267620866c9d17b959a84dd0bd2d45719b817245e49371ead79ed4f710d19"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:6734e606355834f13445b6adc38b53c0fd45f1a56a9ba06c2058f86893ae8017"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f8303414c7b03f794347ad062c0516cee0e15f7a612abd0ce1e25caf6ceb47df"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aaf53a6cebad0eae578f062c7d462155eada9c172bd8c4d250b8c1d8eb7f916a"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3dc5b6a8ecfdc5748a7e429782598e4f17ef378e3e272eeb1340ea57c9109f41"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e1b25e3ad6c909f398df8921780d6a3d120d8c09466720226fc621605b6f92b1"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca564606d2caafb0abe6d1b5311c2649e8071eb241b2d64e75a0d0065107e62"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b82fab78e0b1329e183a65260581de4375f619167478dddab510c6c6fb04d9b6"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:bd7163182133c0c7701b25e604cf1611c0d87712e56e88e7ee5d72deab3e76b5"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:11d117e6c63e8f495412d37e7dc2e2fff09c34b2d09dbe2bee3c6229577818be"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:cf6511efa4801b9b38dc5546d7547d5b5c6ef4b081c60b23e4d941d0eba9cbeb"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:abc1185d79f47c0a7aaf7e2412a0eb2c03b724581139193d2d82b3ad8cbb00ac"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cb7b2ab0188829593b9de646545175547a70d9a6e2b63bf2cd87a0a391599324"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win32.whl", hash = "sha256:c36bcbc0d5174a80d6cccf43a0ecaca44e81d25be4b7f90f0ed7bcfbb5a00909"}, + {file = "charset_normalizer-3.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:cca4def576f47a09a943666b8f829606bcb17e2bc2d5911a46c8f8da45f56755"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c95f12b74681e9ae127728f7e5409cbbef9cd914d5896ef238cc779b8152373"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fca62a8301b605b954ad2e9c3666f9d97f63872aa4efcae5492baca2056b74ab"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac0aa6cd53ab9a31d397f8303f92c42f534693528fafbdb997c82bae6e477ad9"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c3af8e0f07399d3176b179f2e2634c3ce9c1301379a6b8c9c9aeecd481da494f"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3a5fc78f9e3f501a1614a98f7c54d3969f3ad9bba8ba3d9b438c3bc5d047dd28"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:628c985afb2c7d27a4800bfb609e03985aaecb42f955049957814e0491d4006d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:74db0052d985cf37fa111828d0dd230776ac99c740e1a758ad99094be4f1803d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e8fcdd8f672a1c4fc8d0bd3a2b576b152d2a349782d1eb0f6b8e52e9954731d"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:04afa6387e2b282cf78ff3dbce20f0cc071c12dc8f685bd40960cc68644cfea6"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:dd5653e67b149503c68c4018bf07e42eeed6b4e956b24c00ccdf93ac79cdff84"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d2686f91611f9e17f4548dbf050e75b079bbc2a82be565832bc8ea9047b61c8c"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win32.whl", hash = "sha256:4155b51ae05ed47199dc5b2a4e62abccb274cee6b01da5b895099b61b1982974"}, + {file = "charset_normalizer-3.1.0-cp37-cp37m-win_amd64.whl", hash = "sha256:322102cdf1ab682ecc7d9b1c5eed4ec59657a65e1c146a0da342b78f4112db23"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e633940f28c1e913615fd624fcdd72fdba807bf53ea6925d6a588e84e1151531"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3a06f32c9634a8705f4ca9946d667609f52cf130d5548881401f1eb2c39b1e2c"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7381c66e0561c5757ffe616af869b916c8b4e42b367ab29fedc98481d1e74e14"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3573d376454d956553c356df45bb824262c397c6e26ce43e8203c4c540ee0acb"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e89df2958e5159b811af9ff0f92614dabf4ff617c03a4c1c6ff53bf1c399e0e1"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78cacd03e79d009d95635e7d6ff12c21eb89b894c354bd2b2ed0b4763373693b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de5695a6f1d8340b12a5d6d4484290ee74d61e467c39ff03b39e30df62cf83a0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c60b9c202d00052183c9be85e5eaf18a4ada0a47d188a83c8f5c5b23252f649"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:f645caaf0008bacf349875a974220f1f1da349c5dbe7c4ec93048cdc785a3326"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ea9f9c6034ea2d93d9147818f17c2a0860d41b71c38b9ce4d55f21b6f9165a11"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:80d1543d58bd3d6c271b66abf454d437a438dff01c3e62fdbcd68f2a11310d4b"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:73dc03a6a7e30b7edc5b01b601e53e7fc924b04e1835e8e407c12c037e81adbd"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6f5c2e7bc8a4bf7c426599765b1bd33217ec84023033672c1e9a8b35eaeaaaf8"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win32.whl", hash = "sha256:12a2b561af122e3d94cdb97fe6fb2bb2b82cef0cdca131646fdb940a1eda04f0"}, + {file = "charset_normalizer-3.1.0-cp38-cp38-win_amd64.whl", hash = "sha256:3160a0fd9754aab7d47f95a6b63ab355388d890163eb03b2d2b87ab0a30cfa59"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:38e812a197bf8e71a59fe55b757a84c1f946d0ac114acafaafaf21667a7e169e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6baf0baf0d5d265fa7944feb9f7451cc316bfe30e8df1a61b1bb08577c554f31"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:8f25e17ab3039b05f762b0a55ae0b3632b2e073d9c8fc88e89aca31a6198e88f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3747443b6a904001473370d7810aa19c3a180ccd52a7157aacc264a5ac79265e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b116502087ce8a6b7a5f1814568ccbd0e9f6cfd99948aa59b0e241dc57cf739f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d16fd5252f883eb074ca55cb622bc0bee49b979ae4e8639fff6ca3ff44f9f854"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fa558996782fc226b529fdd2ed7866c2c6ec91cee82735c98a197fae39f706"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f6c7a8a57e9405cad7485f4c9d3172ae486cfef1344b5ddd8e5239582d7355e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ac3775e3311661d4adace3697a52ac0bab17edd166087d493b52d4f4f553f9f0"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:10c93628d7497c81686e8e5e557aafa78f230cd9e77dd0c40032ef90c18f2230"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:6f4f4668e1831850ebcc2fd0b1cd11721947b6dc7c00bf1c6bd3c929ae14f2c7"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:0be65ccf618c1e7ac9b849c315cc2e8a8751d9cfdaa43027d4f6624bd587ab7e"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:53d0a3fa5f8af98a1e261de6a3943ca631c526635eb5817a87a59d9a57ebf48f"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win32.whl", hash = "sha256:a04f86f41a8916fe45ac5024ec477f41f886b3c435da2d4e3d2709b22ab02af1"}, + {file = "charset_normalizer-3.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:830d2948a5ec37c386d3170c483063798d7879037492540f10a475e3fd6f244b"}, + {file = "charset_normalizer-3.1.0-py3-none-any.whl", hash = "sha256:3d9098b479e78c85080c98e1e35ff40b4a31d8953102bb0fd7d1b6f8a2111a3d"}, ] -[package.extras] -unicode-backport = ["unicodedata2"] - [[package]] name = "colorama" version = "0.4.6" @@ -451,9 +521,6 @@ files = [ {file = "coverage-7.2.2.tar.gz", hash = "sha256:36dd42da34fe94ed98c39887b86db9d06777b1c8f860520e21126a75507024f2"}, ] -[package.dependencies] -tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} - [package.extras] toml = ["tomli"] @@ -523,21 +590,6 @@ files = [ [package.extras] dev = ["coverage", "coveralls", "pytest"] -[[package]] -name = "exceptiongroup" -version = "1.1.0" -description = "Backport of PEP 654 (exception groups)" -category = "dev" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, - {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, -] - -[package.extras] -test = ["pytest (>=6)"] - [[package]] name = "execnet" version = "1.9.0" @@ -555,14 +607,14 @@ testing = ["pre-commit"] [[package]] name = "fakeredis" -version = "2.10.0" +version = "2.10.2" description = "Fake implementation of redis API for testing purposes." category = "main" optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "fakeredis-2.10.0-py3-none-any.whl", hash = "sha256:7e66c96793688703a1da41256323ddaa1b3a2cab4ef793866839a937bb273915"}, - {file = "fakeredis-2.10.0.tar.gz", hash = "sha256:722644759bba4ad61fa38f0bb34939b7657f166ba35892f747e282407a196845"}, + {file = "fakeredis-2.10.2-py3-none-any.whl", hash = "sha256:6377c27bc557be46089381d43fd670aece46672d091a494f73ab4c96c34022b3"}, + {file = "fakeredis-2.10.2.tar.gz", hash = "sha256:e2a95fbda7b11188c117d68b0f9eecc00600cb449ccf3362a15fc03cf9e2477d"}, ] [package.dependencies] @@ -591,19 +643,19 @@ sgmllib3k = "*" [[package]] name = "filelock" -version = "3.9.0" +version = "3.10.7" description = "A platform independent file lock." category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "filelock-3.9.0-py3-none-any.whl", hash = "sha256:f58d535af89bb9ad5cd4df046f741f8553a418c01a7856bf0d173bbc9f6bd16d"}, - {file = "filelock-3.9.0.tar.gz", hash = "sha256:7b319f24340b51f55a2bf7a12ac0755a9b03e718311dac567a0f4f7fabd2f5de"}, + {file = "filelock-3.10.7-py3-none-any.whl", hash = "sha256:bde48477b15fde2c7e5a0713cbe72721cb5a5ad32ee0b8f419907960b9d75536"}, + {file = "filelock-3.10.7.tar.gz", hash = "sha256:892be14aa8efc01673b5ed6589dbccb95f9a8596f0507e232626155495c18105"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] -testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.2)", "diff-cover (>=7.5)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)", "pytest-timeout (>=2.1)"] [[package]] name = "flake8" @@ -640,19 +692,19 @@ flake8 = ">=5.0" [[package]] name = "flake8-bugbear" -version = "23.3.12" +version = "23.3.23" description = "A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle." category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8.1" files = [ - {file = "flake8-bugbear-23.3.12.tar.gz", hash = "sha256:e3e7f74c8a49ad3794a7183353026dabd68c74030d5f46571f84c1fb0eb79363"}, - {file = "flake8_bugbear-23.3.12-py3-none-any.whl", hash = "sha256:beb5c7efcd7ccc2039ef66a77bb8db925e7be3531ff1cb4d0b7030d0e2113d72"}, + {file = "flake8-bugbear-23.3.23.tar.gz", hash = "sha256:ea565bdb87b96b56dc499edd6cc3ba7f695373d902a5f56c989b74fad7c7719d"}, + {file = "flake8_bugbear-23.3.23-py3-none-any.whl", hash = "sha256:8a218d13abd6904800970381057ce8e72cde8eea743240c4ef3ede4dd0bc9cfb"}, ] [package.dependencies] attrs = ">=19.2.0" -flake8 = ">=3.0.0" +flake8 = ">=6.0.0" [package.extras] dev = ["coverage", "hypothesis", "hypothesmith (>=0.2)", "pre-commit", "pytest", "tox"] @@ -895,14 +947,14 @@ pyreadline3 = {version = "*", markers = "sys_platform == \"win32\" and python_ve [[package]] name = "identify" -version = "2.5.18" +version = "2.5.22" description = "File identification library for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "identify-2.5.18-py2.py3-none-any.whl", hash = "sha256:93aac7ecf2f6abf879b8f29a8002d3c6de7086b8c28d88e1ad15045a15ab63f9"}, - {file = "identify-2.5.18.tar.gz", hash = "sha256:89e144fa560cc4cffb6ef2ab5e9fb18ed9f9b3cb054384bab4b95c12f6c309fe"}, + {file = "identify-2.5.22-py2.py3-none-any.whl", hash = "sha256:f0faad595a4687053669c112004178149f6c326db71ee999ae4636685753ad2f"}, + {file = "identify-2.5.22.tar.gz", hash = "sha256:f7a93d6cf98e29bd07663c60728e7a4057615068d7a639d132dc883b2d54d31e"}, ] [package.extras] @@ -1341,19 +1393,19 @@ test = ["docutils", "mypy", "pytest-cov", "pytest-pycodestyle", "pytest-runner"] [[package]] name = "platformdirs" -version = "3.1.0" +version = "3.2.0" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.1.0-py3-none-any.whl", hash = "sha256:13b08a53ed71021350c9e300d4ea8668438fb0046ab3937ac9a29913a1a1350a"}, - {file = "platformdirs-3.1.0.tar.gz", hash = "sha256:accc3665857288317f32c7bebb5a8e482ba717b474f3fc1d18ca7f9214be0cef"}, + {file = "platformdirs-3.2.0-py3-none-any.whl", hash = "sha256:ebe11c0d7a805086e99506aa331612429a72ca7cd52a1f0d277dc4adc20cb10e"}, + {file = "platformdirs-3.2.0.tar.gz", hash = "sha256:d5b638ca397f25f979350ff789db335903d7ea010ab28903f57b27e1b16c2b08"}, ] [package.extras] docs = ["furo (>=2022.12.7)", "proselint (>=0.13)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.2.2)", "pytest (>=7.2.1)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-mock (>=3.10)"] [[package]] name = "pluggy" @@ -1373,14 +1425,14 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pre-commit" -version = "3.2.0" +version = "3.2.1" description = "A framework for managing and maintaining multi-language pre-commit hooks." category = "dev" optional = false python-versions = ">=3.8" files = [ - {file = "pre_commit-3.2.0-py2.py3-none-any.whl", hash = "sha256:f712d3688102e13c8e66b7d7dbd8934a6dda157e58635d89f7d6fecdca39ce8a"}, - {file = "pre_commit-3.2.0.tar.gz", hash = "sha256:818f0d998059934d0f81bb3667e3ccdc32da6ed7ccaac33e43dc231561ddaaa9"}, + {file = "pre_commit-3.2.1-py2.py3-none-any.whl", hash = "sha256:a06a7fcce7f420047a71213c175714216498b49ebc81fe106f7716ca265f5bb6"}, + {file = "pre_commit-3.2.1.tar.gz", hash = "sha256:b5aee7d75dbba21ee161ba641b01e7ae10c5b91967ebf7b2ab0dfae12d07e1f1"}, ] [package.dependencies] @@ -1659,11 +1711,9 @@ files = [ [package.dependencies] attrs = ">=19.2.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} [package.extras] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] @@ -1927,18 +1977,18 @@ full = ["numpy"] [[package]] name = "redis" -version = "4.5.1" +version = "4.5.4" description = "Python client for Redis database and key-value store" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "redis-4.5.1-py3-none-any.whl", hash = "sha256:5deb072d26e67d2be1712603bfb7947ec3431fb0eec9c578994052e33035af6d"}, - {file = "redis-4.5.1.tar.gz", hash = "sha256:1eec3741cda408d3a5f84b78d089c8b8d895f21b3b050988351e925faf202864"}, + {file = "redis-4.5.4-py3-none-any.whl", hash = "sha256:2c19e6767c474f2e85167909061d525ed65bea9301c0770bb151e041b7ac89a2"}, + {file = "redis-4.5.4.tar.gz", hash = "sha256:73ec35da4da267d6847e47f68730fdd5f62e2ca69e3ef5885c6a78a9374c3893"}, ] [package.dependencies] -async-timeout = ">=4.0.2" +async-timeout = {version = ">=4.0.2", markers = "python_version <= \"3.11.2\""} [package.extras] hiredis = ["hiredis (>=1.0.0)"] @@ -2141,14 +2191,14 @@ tornado = ["tornado (>=5)"] [[package]] name = "setuptools" -version = "67.5.1" +version = "67.6.1" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.5.1-py3-none-any.whl", hash = "sha256:1c39d42bda4cb89f7fdcad52b6762e3c309ec8f8715b27c684176b7d71283242"}, - {file = "setuptools-67.5.1.tar.gz", hash = "sha256:15136a251127da2d2e77ac7a1bc231eb504654f7e3346d93613a13f2e2787535"}, + {file = "setuptools-67.6.1-py3-none-any.whl", hash = "sha256:e728ca814a823bf7bf60162daf9db95b93d532948c4c0bea762ce62f60189078"}, + {file = "setuptools-67.6.1.tar.gz", hash = "sha256:257de92a9d50a60b8e22abfcbb771571fde0dbf3ec234463212027a4eeecbe9a"}, ] [package.extras] @@ -2241,14 +2291,14 @@ files = [ [[package]] name = "taskipy" -version = "1.10.3" +version = "1.10.4" description = "tasks runner for python projects" category = "dev" optional = false python-versions = ">=3.6,<4.0" files = [ - {file = "taskipy-1.10.3-py3-none-any.whl", hash = "sha256:4c0070ca53868d97989f7ab5c6f237525d52ee184f9b967576e8fe427ed9d0b8"}, - {file = "taskipy-1.10.3.tar.gz", hash = "sha256:112beaf21e3d5569950b99162a1de003fa885fabee9e450757a6b874be914877"}, + {file = "taskipy-1.10.4-py3-none-any.whl", hash = "sha256:b96245d7f2956d36821435acaa822143ef6d2ff6cfecc48cf0a48c4b95456c14"}, + {file = "taskipy-1.10.4.tar.gz", hash = "sha256:0006429f708f530fc7add28ca51fd41f6c6e1fbe86763ff05125e1af3e8bdc7e"}, ] [package.dependencies] @@ -2301,14 +2351,14 @@ files = [ [[package]] name = "urllib3" -version = "1.26.14" +version = "1.26.15" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ - {file = "urllib3-1.26.14-py2.py3-none-any.whl", hash = "sha256:75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1"}, - {file = "urllib3-1.26.14.tar.gz", hash = "sha256:076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72"}, + {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, + {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, ] [package.extras] @@ -2318,14 +2368,14 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [[package]] name = "virtualenv" -version = "20.20.0" +version = "20.21.0" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.20.0-py3-none-any.whl", hash = "sha256:3c22fa5a7c7aa106ced59934d2c20a2ecb7f49b4130b8bf444178a16b880fa45"}, - {file = "virtualenv-20.20.0.tar.gz", hash = "sha256:a8a4b8ca1e28f864b7514a253f98c1d62b64e31e77325ba279248c65fb4fcef4"}, + {file = "virtualenv-20.21.0-py3-none-any.whl", hash = "sha256:31712f8f2a17bd06234fa97fdf19609e789dd4e3e4bf108c3da71d710651adbc"}, + {file = "virtualenv-20.21.0.tar.gz", hash = "sha256:f50e3e60f990a0757c9b68333c9fdaa72d7188caa417f96af9e52407831a3b68"}, ] [package.dependencies] @@ -2439,5 +2489,5 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" -python-versions = "3.10.*" -content-hash = "9073fa02a1c88d59ffbd3a71ef1e0d64ffb3111b499a642c1b3f565abfc6dccd" +python-versions = "3.11.*" +content-hash = "8e6348b5f1932f10723cc464b8c696b60bfb913f254d675f2ac44f50b152bd4e" diff --git a/pyproject.toml b/pyproject.toml index 577930409..ae3984d8d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Python Discord "] license = "MIT" [tool.poetry.dependencies] -python = "3.10.*" +python = "3.11.*" # See https://bot-core.pythondiscord.com/ for docs. pydis_core = { version = "9.5.1", extras = ["async-rediscache"] } @@ -35,20 +35,20 @@ pydantic = { version = "1.10.7", extras = ["dotenv"]} coverage = "7.2.2" flake8 = "6.0.0" flake8-annotations = "3.0.0" -flake8-bugbear = "23.3.12" +flake8-bugbear = "23.3.23" flake8-docstrings = "1.7.0" flake8-string-format = "0.3.0" flake8-tidy-imports = "4.8.0" flake8-todo = "0.7" flake8-isort = "6.0.0" pep8-naming = "0.13.3" -pre-commit = "3.2.0" +pre-commit = "3.2.1" pip-licenses = "4.1.0" pytest = "7.2.2" pytest-cov = "4.0.0" pytest-subtests = "0.10.0" pytest-xdist = "3.2.1" -taskipy = "1.10.3" +taskipy = "1.10.4" httpx = "0.23.3" -- cgit v1.2.3 From e24e94895d5529952c44e3aeeb4558a8d171bd9c Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 3 Mar 2023 15:03:55 +0100 Subject: Upgrade to Python 3.11 in CI & Dockerfile --- .github/workflows/lint-test.yml | 2 +- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index af1d703c0..63dc8a581 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -34,7 +34,7 @@ jobs: - name: Install Python Dependencies uses: HassanAbouelela/actions/setup-python@setup-python_v1.4.0 with: - python_version: '3.10' + python_version: '3.11' # Check all of our non-dev dependencies are compatible with the MIT license. # If you added a new dependencies that is being rejected, diff --git a/Dockerfile b/Dockerfile index 205b66209..794f1573a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.10-slim +FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.11-slim # Define Git SHA build argument for sentry ARG git_sha="development" -- cgit v1.2.3 From c6b2b3b634527094119c324fea43ebef74891241 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Tue, 21 Mar 2023 21:08:44 +0100 Subject: Replace mock._importer with pkgutil.resolve_name in test autospec mock._importer was removed in 3.11 --- tests/_autospec.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/_autospec.py b/tests/_autospec.py index ee2fc1973..ecff6bcbe 100644 --- a/tests/_autospec.py +++ b/tests/_autospec.py @@ -1,5 +1,6 @@ import contextlib import functools +import pkgutil import unittest.mock from typing import Callable @@ -51,7 +52,7 @@ def autospec(target, *attributes: str, pass_mocks: bool = True, **patch_kwargs) # Import the target if it's a string. # This is to support both object and string targets like patch.multiple. if type(target) is str: - target = unittest.mock._importer(target) + target = pkgutil.resolve_name(target) def decorator(func): for attribute in attributes: -- cgit v1.2.3 From 5a16319ebb26a0eea8bcaf398b818df118c7f3cc Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 29 Mar 2023 19:54:00 +0100 Subject: Update base image to new repo org --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 794f1573a..d09cad5bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 ghcr.io/chrislovering/python-poetry-base:3.11-slim +FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:3.11-slim # Define Git SHA build argument for sentry ARG git_sha="development" -- cgit v1.2.3 From ef5ec05e84e69b07f9f50699a823705981ae0325 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 19:34:15 +0000 Subject: Bump regex from 2022.10.31 to 2023.3.23 (#2485) Bumps [regex](https://github.com/mrabarnett/mrab-regex) from 2022.10.31 to 2023.3.23. - [Release notes](https://github.com/mrabarnett/mrab-regex/releases) - [Commits](https://github.com/mrabarnett/mrab-regex/compare/2022.10.31...2023.3.23) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 154 +++++++++++++++++++++++---------------------------------- pyproject.toml | 2 +- 2 files changed, 64 insertions(+), 92 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4e7cbb9e0..089c13c5b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1996,100 +1996,72 @@ ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)" [[package]] name = "regex" -version = "2022.10.31" +version = "2023.3.23" description = "Alternative regular expression module, to replace re." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" files = [ - {file = "regex-2022.10.31-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a8ff454ef0bb061e37df03557afda9d785c905dab15584860f982e88be73015f"}, - {file = "regex-2022.10.31-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:1eba476b1b242620c266edf6325b443a2e22b633217a9835a52d8da2b5c051f9"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0e5af9a9effb88535a472e19169e09ce750c3d442fb222254a276d77808620b"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d03fe67b2325cb3f09be029fd5da8df9e6974f0cde2c2ac6a79d2634e791dd57"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a9d0b68ac1743964755ae2d89772c7e6fb0118acd4d0b7464eaf3921c6b49dd4"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8a45b6514861916c429e6059a55cf7db74670eaed2052a648e3e4d04f070e001"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8b0886885f7323beea6f552c28bff62cbe0983b9fbb94126531693ea6c5ebb90"}, - {file = "regex-2022.10.31-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5aefb84a301327ad115e9d346c8e2760009131d9d4b4c6b213648d02e2abe144"}, - {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:702d8fc6f25bbf412ee706bd73019da5e44a8400861dfff7ff31eb5b4a1276dc"}, - {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a3c1ebd4ed8e76e886507c9eddb1a891673686c813adf889b864a17fafcf6d66"}, - {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:50921c140561d3db2ab9f5b11c5184846cde686bb5a9dc64cae442926e86f3af"}, - {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:7db345956ecce0c99b97b042b4ca7326feeec6b75facd8390af73b18e2650ffc"}, - {file = "regex-2022.10.31-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:763b64853b0a8f4f9cfb41a76a4a85a9bcda7fdda5cb057016e7706fde928e66"}, - {file = "regex-2022.10.31-cp310-cp310-win32.whl", hash = "sha256:44136355e2f5e06bf6b23d337a75386371ba742ffa771440b85bed367c1318d1"}, - {file = "regex-2022.10.31-cp310-cp310-win_amd64.whl", hash = "sha256:bfff48c7bd23c6e2aec6454aaf6edc44444b229e94743b34bdcdda2e35126cf5"}, - {file = "regex-2022.10.31-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4b4b1fe58cd102d75ef0552cf17242705ce0759f9695334a56644ad2d83903fe"}, - {file = "regex-2022.10.31-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:542e3e306d1669b25936b64917285cdffcd4f5c6f0247636fec037187bd93542"}, - {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c27cc1e4b197092e50ddbf0118c788d9977f3f8f35bfbbd3e76c1846a3443df7"}, - {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8e38472739028e5f2c3a4aded0ab7eadc447f0d84f310c7a8bb697ec417229e"}, - {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:76c598ca73ec73a2f568e2a72ba46c3b6c8690ad9a07092b18e48ceb936e9f0c"}, - {file = "regex-2022.10.31-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c28d3309ebd6d6b2cf82969b5179bed5fefe6142c70f354ece94324fa11bf6a1"}, - {file = "regex-2022.10.31-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9af69f6746120998cd9c355e9c3c6aec7dff70d47247188feb4f829502be8ab4"}, - {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a5f9505efd574d1e5b4a76ac9dd92a12acb2b309551e9aa874c13c11caefbe4f"}, - {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5ff525698de226c0ca743bfa71fc6b378cda2ddcf0d22d7c37b1cc925c9650a5"}, - {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:4fe7fda2fe7c8890d454f2cbc91d6c01baf206fbc96d89a80241a02985118c0c"}, - {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:2cdc55ca07b4e70dda898d2ab7150ecf17c990076d3acd7a5f3b25cb23a69f1c"}, - {file = "regex-2022.10.31-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:44a6c2f6374e0033873e9ed577a54a3602b4f609867794c1a3ebba65e4c93ee7"}, - {file = "regex-2022.10.31-cp311-cp311-win32.whl", hash = "sha256:d8716f82502997b3d0895d1c64c3b834181b1eaca28f3f6336a71777e437c2af"}, - {file = "regex-2022.10.31-cp311-cp311-win_amd64.whl", hash = "sha256:61edbca89aa3f5ef7ecac8c23d975fe7261c12665f1d90a6b1af527bba86ce61"}, - {file = "regex-2022.10.31-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:0a069c8483466806ab94ea9068c34b200b8bfc66b6762f45a831c4baaa9e8cdd"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d26166acf62f731f50bdd885b04b38828436d74e8e362bfcb8df221d868b5d9b"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ac741bf78b9bb432e2d314439275235f41656e189856b11fb4e774d9f7246d81"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:75f591b2055523fc02a4bbe598aa867df9e953255f0b7f7715d2a36a9c30065c"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6b30bddd61d2a3261f025ad0f9ee2586988c6a00c780a2fb0a92cea2aa702c54"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ef4163770525257876f10e8ece1cf25b71468316f61451ded1a6f44273eedeb5"}, - {file = "regex-2022.10.31-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7b280948d00bd3973c1998f92e22aa3ecb76682e3a4255f33e1020bd32adf443"}, - {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:d0213671691e341f6849bf33cd9fad21f7b1cb88b89e024f33370733fec58742"}, - {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:22e7ebc231d28393dfdc19b185d97e14a0f178bedd78e85aad660e93b646604e"}, - {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_ppc64le.whl", hash = "sha256:8ad241da7fac963d7573cc67a064c57c58766b62a9a20c452ca1f21050868dfa"}, - {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_s390x.whl", hash = "sha256:586b36ebda81e6c1a9c5a5d0bfdc236399ba6595e1397842fd4a45648c30f35e"}, - {file = "regex-2022.10.31-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:0653d012b3bf45f194e5e6a41df9258811ac8fc395579fa82958a8b76286bea4"}, - {file = "regex-2022.10.31-cp36-cp36m-win32.whl", hash = "sha256:144486e029793a733e43b2e37df16a16df4ceb62102636ff3db6033994711066"}, - {file = "regex-2022.10.31-cp36-cp36m-win_amd64.whl", hash = "sha256:c14b63c9d7bab795d17392c7c1f9aaabbffd4cf4387725a0ac69109fb3b550c6"}, - {file = "regex-2022.10.31-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4cac3405d8dda8bc6ed499557625585544dd5cbf32072dcc72b5a176cb1271c8"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:23cbb932cc53a86ebde0fb72e7e645f9a5eec1a5af7aa9ce333e46286caef783"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:74bcab50a13960f2a610cdcd066e25f1fd59e23b69637c92ad470784a51b1347"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:78d680ef3e4d405f36f0d6d1ea54e740366f061645930072d39bca16a10d8c93"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce6910b56b700bea7be82c54ddf2e0ed792a577dfaa4a76b9af07d550af435c6"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:659175b2144d199560d99a8d13b2228b85e6019b6e09e556209dfb8c37b78a11"}, - {file = "regex-2022.10.31-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1ddf14031a3882f684b8642cb74eea3af93a2be68893901b2b387c5fd92a03ec"}, - {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b683e5fd7f74fb66e89a1ed16076dbab3f8e9f34c18b1979ded614fe10cdc4d9"}, - {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2bde29cc44fa81c0a0c8686992c3080b37c488df167a371500b2a43ce9f026d1"}, - {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:4919899577ba37f505aaebdf6e7dc812d55e8f097331312db7f1aab18767cce8"}, - {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:9c94f7cc91ab16b36ba5ce476f1904c91d6c92441f01cd61a8e2729442d6fcf5"}, - {file = "regex-2022.10.31-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ae1e96785696b543394a4e3f15f3f225d44f3c55dafe3f206493031419fedf95"}, - {file = "regex-2022.10.31-cp37-cp37m-win32.whl", hash = "sha256:c670f4773f2f6f1957ff8a3962c7dd12e4be54d05839b216cb7fd70b5a1df394"}, - {file = "regex-2022.10.31-cp37-cp37m-win_amd64.whl", hash = "sha256:8e0caeff18b96ea90fc0eb6e3bdb2b10ab5b01a95128dfeccb64a7238decf5f0"}, - {file = "regex-2022.10.31-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:131d4be09bea7ce2577f9623e415cab287a3c8e0624f778c1d955ec7c281bd4d"}, - {file = "regex-2022.10.31-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:e613a98ead2005c4ce037c7b061f2409a1a4e45099edb0ef3200ee26ed2a69a8"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:052b670fafbe30966bbe5d025e90b2a491f85dfe5b2583a163b5e60a85a321ad"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aa62a07ac93b7cb6b7d0389d8ef57ffc321d78f60c037b19dfa78d6b17c928ee"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5352bea8a8f84b89d45ccc503f390a6be77917932b1c98c4cdc3565137acc714"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20f61c9944f0be2dc2b75689ba409938c14876c19d02f7585af4460b6a21403e"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:29c04741b9ae13d1e94cf93fca257730b97ce6ea64cfe1eba11cf9ac4e85afb6"}, - {file = "regex-2022.10.31-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:543883e3496c8b6d58bd036c99486c3c8387c2fc01f7a342b760c1ea3158a318"}, - {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b7a8b43ee64ca8f4befa2bea4083f7c52c92864d8518244bfa6e88c751fa8fff"}, - {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6a9a19bea8495bb419dc5d38c4519567781cd8d571c72efc6aa959473d10221a"}, - {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:6ffd55b5aedc6f25fd8d9f905c9376ca44fcf768673ffb9d160dd6f409bfda73"}, - {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4bdd56ee719a8f751cf5a593476a441c4e56c9b64dc1f0f30902858c4ef8771d"}, - {file = "regex-2022.10.31-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8ca88da1bd78990b536c4a7765f719803eb4f8f9971cc22d6ca965c10a7f2c4c"}, - {file = "regex-2022.10.31-cp38-cp38-win32.whl", hash = "sha256:5a260758454580f11dd8743fa98319bb046037dfab4f7828008909d0aa5292bc"}, - {file = "regex-2022.10.31-cp38-cp38-win_amd64.whl", hash = "sha256:5e6a5567078b3eaed93558842346c9d678e116ab0135e22eb72db8325e90b453"}, - {file = "regex-2022.10.31-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5217c25229b6a85049416a5c1e6451e9060a1edcf988641e309dbe3ab26d3e49"}, - {file = "regex-2022.10.31-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:4bf41b8b0a80708f7e0384519795e80dcb44d7199a35d52c15cc674d10b3081b"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cf0da36a212978be2c2e2e2d04bdff46f850108fccc1851332bcae51c8907cc"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d403d781b0e06d2922435ce3b8d2376579f0c217ae491e273bab8d092727d244"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a37d51fa9a00d265cf73f3de3930fa9c41548177ba4f0faf76e61d512c774690"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4f781ffedd17b0b834c8731b75cce2639d5a8afe961c1e58ee7f1f20b3af185"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d243b36fbf3d73c25e48014961e83c19c9cc92530516ce3c43050ea6276a2ab7"}, - {file = "regex-2022.10.31-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:370f6e97d02bf2dd20d7468ce4f38e173a124e769762d00beadec3bc2f4b3bc4"}, - {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:597f899f4ed42a38df7b0e46714880fb4e19a25c2f66e5c908805466721760f5"}, - {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7dbdce0c534bbf52274b94768b3498abdf675a691fec5f751b6057b3030f34c1"}, - {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:22960019a842777a9fa5134c2364efaed5fbf9610ddc5c904bd3a400973b0eb8"}, - {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:7f5a3ffc731494f1a57bd91c47dc483a1e10048131ffb52d901bfe2beb6102e8"}, - {file = "regex-2022.10.31-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:7ef6b5942e6bfc5706301a18a62300c60db9af7f6368042227ccb7eeb22d0892"}, - {file = "regex-2022.10.31-cp39-cp39-win32.whl", hash = "sha256:395161bbdbd04a8333b9ff9763a05e9ceb4fe210e3c7690f5e68cedd3d65d8e1"}, - {file = "regex-2022.10.31-cp39-cp39-win_amd64.whl", hash = "sha256:957403a978e10fb3ca42572a23e6f7badff39aa1ce2f4ade68ee452dc6807692"}, - {file = "regex-2022.10.31.tar.gz", hash = "sha256:a3a98921da9a1bf8457aeee6a551948a83601689e5ecdd736894ea9bbec77e83"}, + {file = "regex-2023.3.23-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:845a5e2d84389c4ddada1a9b95c055320070f18bb76512608374aca00d22eca8"}, + {file = "regex-2023.3.23-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:87d9951f5a538dd1d016bdc0dcae59241d15fa94860964833a54d18197fcd134"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37ae17d3be44c0b3f782c28ae9edd8b47c1f1776d4cabe87edc0b98e1f12b021"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:0b8eb1e3bca6b48dc721818a60ae83b8264d4089a4a41d62be6d05316ec38e15"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:df45fac182ebc3c494460c644e853515cc24f5ad9da05f8ffb91da891bfee879"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7006105b10b59971d3b248ad75acc3651c7e4cf54d81694df5a5130a3c3f7ea"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:93f3f1aa608380fe294aa4cb82e2afda07a7598e828d0341e124b8fd9327c715"}, + {file = "regex-2023.3.23-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:787954f541ab95d8195d97b0b8cf1dc304424adb1e07365967e656b92b38a699"}, + {file = "regex-2023.3.23-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:20abe0bdf03630fe92ccafc45a599bca8b3501f48d1de4f7d121153350a2f77d"}, + {file = "regex-2023.3.23-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:11d00c31aeab9a6e0503bc77e73ed9f4527b3984279d997eb145d7c7be6268fd"}, + {file = "regex-2023.3.23-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:d5bbe0e1511b844794a3be43d6c145001626ba9a6c1db8f84bdc724e91131d9d"}, + {file = "regex-2023.3.23-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ea3c0cb56eadbf4ab2277e7a095676370b3e46dbfc74d5c383bd87b0d6317910"}, + {file = "regex-2023.3.23-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d895b4c863059a4934d3e874b90998df774644a41b349ebb330f85f11b4ef2c0"}, + {file = "regex-2023.3.23-cp310-cp310-win32.whl", hash = "sha256:9d764514d19b4edcc75fd8cb1423448ef393e8b6cbd94f38cab983ab1b75855d"}, + {file = "regex-2023.3.23-cp310-cp310-win_amd64.whl", hash = "sha256:11d1f2b7a0696dc0310de0efb51b1f4d813ad4401fe368e83c0c62f344429f98"}, + {file = "regex-2023.3.23-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8a9c63cde0eaa345795c0fdeb19dc62d22e378c50b0bc67bf4667cd5b482d98b"}, + {file = "regex-2023.3.23-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:dd7200b4c27b68cf9c9646da01647141c6db09f48cc5b51bc588deaf8e98a797"}, + {file = "regex-2023.3.23-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22720024b90a6ba673a725dcc62e10fb1111b889305d7c6b887ac7466b74bedb"}, + {file = "regex-2023.3.23-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6b190a339090e6af25f4a5fd9e77591f6d911cc7b96ecbb2114890b061be0ac1"}, + {file = "regex-2023.3.23-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e76b6fc0d8e9efa39100369a9b3379ce35e20f6c75365653cf58d282ad290f6f"}, + {file = "regex-2023.3.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7868b8f218bf69a2a15402fde08b08712213a1f4b85a156d90473a6fb6b12b09"}, + {file = "regex-2023.3.23-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2472428efc4127374f494e570e36b30bb5e6b37d9a754f7667f7073e43b0abdd"}, + {file = "regex-2023.3.23-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c37df2a060cb476d94c047b18572ee2b37c31f831df126c0da3cd9227b39253d"}, + {file = "regex-2023.3.23-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4479f9e2abc03362df4045b1332d4a2b7885b245a30d4f4b051c4083b97d95d8"}, + {file = "regex-2023.3.23-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e2396e0678167f2d0c197da942b0b3fb48fee2f0b5915a0feb84d11b6686afe6"}, + {file = "regex-2023.3.23-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:75f288c60232a5339e0ff2fa05779a5e9c74e9fc085c81e931d4a264501e745b"}, + {file = "regex-2023.3.23-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c869260aa62cee21c5eb171a466c0572b5e809213612ef8d495268cd2e34f20d"}, + {file = "regex-2023.3.23-cp311-cp311-win32.whl", hash = "sha256:25f0532fd0c53e96bad84664171969de9673b4131f2297f1db850d3918d58858"}, + {file = "regex-2023.3.23-cp311-cp311-win_amd64.whl", hash = "sha256:5ccfafd98473e007cebf7da10c1411035b7844f0f204015efd050601906dbb53"}, + {file = "regex-2023.3.23-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6572ff287176c0fb96568adb292674b421fa762153ed074d94b1d939ed92c253"}, + {file = "regex-2023.3.23-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a610e0adfcb0fc84ea25f6ea685e39e74cbcd9245a72a9a7aab85ff755a5ed27"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:086afe222d58b88b62847bdbd92079b4699350b4acab892f88a935db5707c790"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79e29fd62fa2f597a6754b247356bda14b866131a22444d67f907d6d341e10f3"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c07ce8e9eee878a48ebeb32ee661b49504b85e164b05bebf25420705709fdd31"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86b036f401895e854de9fefe061518e78d506d8a919cc250dc3416bca03f6f9a"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:78ac8dd8e18800bb1f97aad0d73f68916592dddf233b99d2b5cabc562088503a"}, + {file = "regex-2023.3.23-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:539dd010dc35af935b32f248099e38447bbffc10b59c2b542bceead2bed5c325"}, + {file = "regex-2023.3.23-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:9bf4a5626f2a0ea006bf81e8963f498a57a47d58907eaa58f4b3e13be68759d8"}, + {file = "regex-2023.3.23-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:cf86b4328c204c3f315074a61bc1c06f8a75a8e102359f18ce99fbcbbf1951f0"}, + {file = "regex-2023.3.23-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:2848bf76673c83314068241c8d5b7fa9ad9bed866c979875a0e84039349e8fa7"}, + {file = "regex-2023.3.23-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:c125a02d22c555e68f7433bac8449992fa1cead525399f14e47c2d98f2f0e467"}, + {file = "regex-2023.3.23-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:cd1671e9d5ac05ce6aa86874dd8dfa048824d1dbe73060851b310c6c1a201a96"}, + {file = "regex-2023.3.23-cp38-cp38-win32.whl", hash = "sha256:fffe57312a358be6ec6baeb43d253c36e5790e436b7bf5b7a38df360363e88e9"}, + {file = "regex-2023.3.23-cp38-cp38-win_amd64.whl", hash = "sha256:dbb3f87e15d3dd76996d604af8678316ad2d7d20faa394e92d9394dfd621fd0c"}, + {file = "regex-2023.3.23-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c88e8c226473b5549fe9616980ea7ca09289246cfbdf469241edf4741a620004"}, + {file = "regex-2023.3.23-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:6560776ec19c83f3645bbc5db64a7a5816c9d8fb7ed7201c5bcd269323d88072"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b1fc2632c01f42e06173d8dd9bb2e74ab9b0afa1d698058c867288d2c7a31f3"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fdf7ad455f1916b8ea5cdbc482d379f6daf93f3867b4232d14699867a5a13af7"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5fc33b27b1d800fc5b78d7f7d0f287e35079ecabe68e83d46930cf45690e1c8c"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c49552dc938e3588f63f8a78c86f3c9c75301e813bca0bef13bdb4b87ccf364"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e152461e9a0aedec7d37fc66ec0fa635eca984777d3d3c3e36f53bf3d3ceb16e"}, + {file = "regex-2023.3.23-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:db034255e72d2995cf581b14bb3fc9c00bdbe6822b49fcd4eef79e1d5f232618"}, + {file = "regex-2023.3.23-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:55ae114da21b7a790b90255ea52d2aa3a0d121a646deb2d3c6a3194e722fc762"}, + {file = "regex-2023.3.23-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:ef3f528fe1cc3d139508fe1b22523745aa77b9d6cb5b0bf277f48788ee0b993f"}, + {file = "regex-2023.3.23-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:a81c9ec59ca2303acd1ccd7b9ac409f1e478e40e96f8f79b943be476c5fdb8bb"}, + {file = "regex-2023.3.23-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:cde09c4fdd070772aa2596d97e942eb775a478b32459e042e1be71b739d08b77"}, + {file = "regex-2023.3.23-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3cd9f5dd7b821f141d3a6ca0d5d9359b9221e4f051ca3139320adea9f1679691"}, + {file = "regex-2023.3.23-cp39-cp39-win32.whl", hash = "sha256:7304863f3a652dab5e68e6fb1725d05ebab36ec0390676d1736e0571ebb713ef"}, + {file = "regex-2023.3.23-cp39-cp39-win_amd64.whl", hash = "sha256:54c3fa855a3f7438149de3211738dd9b5f0c733f48b54ae05aa7fce83d48d858"}, + {file = "regex-2023.3.23.tar.gz", hash = "sha256:dc80df325b43ffea5cdea2e3eaa97a44f3dd298262b1c7fe9dbb2a9522b956a7"}, ] [[package]] @@ -2490,4 +2462,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.11.*" -content-hash = "8e6348b5f1932f10723cc464b8c696b60bfb913f254d675f2ac44f50b152bd4e" +content-hash = "a6d27f8809406a69ab8ce1d03a55fd2704b902e929285e2102383f9f2bbe26ca" diff --git a/pyproject.toml b/pyproject.toml index ae3984d8d..369f46c11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ python-dateutil = "2.8.2" python-frontmatter = "1.0.0" pyyaml = "6.0" rapidfuzz = "2.13.7" -regex = "2022.10.31" +regex = "2023.3.23" sentry-sdk = "1.17.0" tldextract = "3.4.0" pydantic = { version = "1.10.7", extras = ["dotenv"]} -- cgit v1.2.3 From 96bb34468e50c3cb424e0eeb53eb49e0e4abb6ad Mon Sep 17 00:00:00 2001 From: brody critchlow Date: Wed, 29 Mar 2023 23:16:53 -0600 Subject: Fix InPlace precommit issues --- bot/resources/tags/in-place.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/resources/tags/in-place.md b/bot/resources/tags/in-place.md index 2813b9e57..e2218a7df 100644 --- a/bot/resources/tags/in-place.md +++ b/bot/resources/tags/in-place.md @@ -5,7 +5,7 @@ embed: In programming, there are two types of operations: "out of place" operations create a new object, leaving the original object unchanged. "in place" operations modify the original object without creating a new one, and return `None` explicitly. -A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. +A common example of these different concepts is seen in the use of the methods `list.sort()` and `sorted(...)`. Using `list.sort()` and attempting to access an element of the list will result in an error. ```py # WRONG: -- cgit v1.2.3 From 01c2fc14631dff8f84a3695b788317ccb0d02030 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 12:56:19 +0100 Subject: update channels dict after forum creation --- botstrap.py | 1 + 1 file changed, 1 insertion(+) diff --git a/botstrap.py b/botstrap.py index b77b98f1b..2ed3c17af 100644 --- a/botstrap.py +++ b/botstrap.py @@ -196,6 +196,7 @@ with DiscordClient() as discord_client: if create_help_channel: python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') python_help_channel_id = create_forum_channel(python_help_channel_name, GUILD_ID, discord_client) + all_channels[PYTHON_HELP_CHANNEL_NAME] = python_help_channel_id for channel_name in _Channels.__fields__: channel_id = all_channels.get(channel_name, None) -- cgit v1.2.3 From 54bc9b2c2ffcc2633a20a0174a9ab9a0f6a848fc Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 12:57:29 +0100 Subject: dedent signature --- botstrap.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/botstrap.py b/botstrap.py index 2ed3c17af..05f96282b 100644 --- a/botstrap.py +++ b/botstrap.py @@ -55,10 +55,11 @@ class DiscordClient(Client): def upgrade_server_to_community_if_necessary( - guild_id: int | str, - rules_channel_id_: int | str, - announcements_channel_id_: int | str, - client: DiscordClient) -> None: + guild_id: int | str, + rules_channel_id_: int | str, + announcements_channel_id_: int | str, + client: DiscordClient +) -> None: """Fetches server info & upgrades to COMMUNITY if necessary.""" response = client.get(f"/guilds/{guild_id}") payload = response.json() @@ -73,10 +74,10 @@ def upgrade_server_to_community_if_necessary( def create_forum_channel( - channel_name_: str, - guild_id: str, - client: DiscordClient, - category_id_: int | None = None + channel_name_: str, + guild_id: str, + client: DiscordClient, + category_id_: int | None = None ) -> int: """Creates a new forum channel.""" payload = {"name": channel_name_, "type": GUILD_FORUM_TYPE} -- cgit v1.2.3 From e4903f80dc409d6ebee7170be8ee5e38c242d81d Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 13:13:29 +0100 Subject: append forum channel to category --- bot/constants.py | 1 + botstrap.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/constants.py b/bot/constants.py index ec9130e3e..a0a20373f 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -189,6 +189,7 @@ class _Categories(EnvConfig): # 2021 Summer Code Jam summer_code_jam = 861692638540857384 + python_help_system = 691405807388196926 Categories = _Categories() diff --git a/botstrap.py b/botstrap.py index 05f96282b..8d443b3f5 100644 --- a/botstrap.py +++ b/botstrap.py @@ -17,6 +17,7 @@ GUILD_ID = os.getenv("GUILD_ID", None) COMMUNITY_FEATURE = "COMMUNITY" PYTHON_HELP_CHANNEL_NAME = "python_help" +PYTHON_HELP_CATEGORY_NAME = "python_help_system" ANNOUNCEMENTS_CHANNEL_NAME = "announcements" RULES_CHANNEL_NAME = "rules" GUILD_FORUM_TYPE = 15 @@ -196,7 +197,8 @@ with DiscordClient() as discord_client: if create_help_channel: python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') - python_help_channel_id = create_forum_channel(python_help_channel_name, GUILD_ID, discord_client) + python_help_category_id = all_categories[PYTHON_HELP_CATEGORY_NAME] + python_help_channel_id = create_forum_channel(python_help_channel_name, GUILD_ID, discord_client, python_help_category_id) all_channels[PYTHON_HELP_CHANNEL_NAME] = python_help_channel_id for channel_name in _Channels.__fields__: -- cgit v1.2.3 From ae3db03f95eb157db2c1c11787e7c1725d7883e6 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 13:23:17 +0100 Subject: move all methods under the DiscordClient --- botstrap.py | 227 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 107 insertions(+), 120 deletions(-) diff --git a/botstrap.py b/botstrap.py index 8d443b3f5..df783d1e4 100644 --- a/botstrap.py +++ b/botstrap.py @@ -22,7 +22,6 @@ ANNOUNCEMENTS_CHANNEL_NAME = "announcements" RULES_CHANNEL_NAME = "rules" GUILD_FORUM_TYPE = 15 - if not BOT_TOKEN: message = ( "Couldn't find the `BOT_TOKEN` environment variable. " @@ -43,130 +42,118 @@ if not GUILD_ID: class DiscordClient(Client): """An HTTP client to communicate with Discord's APIs.""" - def __init__(self): + def __init__(self, guild_id): super().__init__( base_url="https://discord.com/api/v10", headers={"Authorization": f"Bot {BOT_TOKEN}"}, event_hooks={"response": [self._raise_for_status]}, ) + self.guild_id = guild_id @staticmethod def _raise_for_status(response: Response) -> None: response.raise_for_status() - -def upgrade_server_to_community_if_necessary( - guild_id: int | str, - rules_channel_id_: int | str, - announcements_channel_id_: int | str, - client: DiscordClient -) -> None: - """Fetches server info & upgrades to COMMUNITY if necessary.""" - response = client.get(f"/guilds/{guild_id}") - payload = response.json() - - if COMMUNITY_FEATURE not in payload["features"]: - log.warning("This server is currently not a community, upgrading.") - payload["features"].append(COMMUNITY_FEATURE) - payload["rules_channel_id"] = rules_channel_id_ - payload["public_updates_channel_id"] = announcements_channel_id_ - client.patch(f"/guilds/{guild_id}", json=payload) - log.info(f"Server {guild_id} has been successfully updated to a community.") - - -def create_forum_channel( - channel_name_: str, - guild_id: str, - client: DiscordClient, - category_id_: int | None = None -) -> int: - """Creates a new forum channel.""" - payload = {"name": channel_name_, "type": GUILD_FORUM_TYPE} - if category_id_: - payload["parent_id"] = category_id_ - - response = client.post(f"/guilds/{guild_id}/channels", json=payload) - forum_channel_id = response.json()["id"] - log.info(f"New forum channel: {channel_name_} has been successfully created.") - return forum_channel_id - - -def is_forum_channel(channel_id_: str, client: DiscordClient) -> bool: - """A boolean that indicates if a channel is of type GUILD_FORUM.""" - response = client.get(f"/channels/{channel_id_}") - return response.json()["type"] == GUILD_FORUM_TYPE - - -def delete_channel(channel_id_: id, client: DiscordClient) -> None: - """Upgrades a channel to a channel of type GUILD FORUM.""" - log.info(f"Channel python-help: {channel_id_} is not a forum channel and will be replaced with one.") - client.delete(f"/channels/{channel_id_}") - - -def get_all_roles(guild_id: int | str, client: DiscordClient) -> dict: - """Fetches all the roles in a guild.""" - result = {} - - response = client.get(f"guilds/{guild_id}/roles") - roles = response.json() - - for role in roles: - name = "_".join(part.lower() for part in role["name"].split(" ")).replace("-", "_") - result[name] = role["id"] - - return result - - -def get_all_channels_and_categories( - guild_id: int | str, - client: DiscordClient -) -> tuple[dict[str, str], dict[str, str]]: - """Fetches all the text channels & categories in a guild.""" - off_topic_channel_name_regex = r"ot\d{1}(_.*)+" - off_topic_count = 0 - channels = {} # could be text channels only as well - categories = {} - - response = client.get(f"guilds/{guild_id}/channels") - server_channels = response.json() - - for channel in server_channels: - channel_type = channel["type"] - name = "_".join(part.lower() for part in channel["name"].split(" ")).replace("-", "_") - if re.match(off_topic_channel_name_regex, name): - name = f"off_topic_{off_topic_count}" - off_topic_count += 1 - - if channel_type == 4: - categories[name] = channel["id"] - else: - channels[name] = channel["id"] - - return channels, categories - - -def webhook_exists(webhook_id_: int, client: DiscordClient) -> bool: - """A predicate that indicates whether a webhook exists already or not.""" - try: - client.get(f"webhooks/{webhook_id_}") - return True - except HTTPStatusError: - return False - - -def create_webhook(name: str, channel_id_: int, client: DiscordClient) -> str: - """Creates a new webhook for a particular channel.""" - payload = {"name": name} - - response = client.post(f"channels/{channel_id_}/webhooks", json=payload) - new_webhook = response.json() - return new_webhook["id"] - - -with DiscordClient() as discord_client: + def upgrade_server_to_community_if_necessary( + self, + rules_channel_id_: int | str, + announcements_channel_id_: int | str, + ) -> None: + """Fetches server info & upgrades to COMMUNITY if necessary.""" + response = self.get(f"/guilds/{self.guild_id}") + payload = response.json() + + if COMMUNITY_FEATURE not in payload["features"]: + log.warning("This server is currently not a community, upgrading.") + payload["features"].append(COMMUNITY_FEATURE) + payload["rules_channel_id"] = rules_channel_id_ + payload["public_updates_channel_id"] = announcements_channel_id_ + self.patch(f"/guilds/{self.guild_id}", json=payload) + log.info(f"Server {self.guild_id} has been successfully updated to a community.") + + def create_forum_channel( + self, + channel_name_: str, + category_id_: int | str | None = None + ) -> int: + """Creates a new forum channel.""" + payload = {"name": channel_name_, "type": GUILD_FORUM_TYPE} + if category_id_: + payload["parent_id"] = category_id_ + + response = self.post(f"/guilds/{self.guild_id}/channels", json=payload) + forum_channel_id = response.json()["id"] + log.info(f"New forum channel: {channel_name_} has been successfully created.") + return forum_channel_id + + def is_forum_channel(self, channel_id_: str) -> bool: + """A boolean that indicates if a channel is of type GUILD_FORUM.""" + response = self.get(f"/channels/{channel_id_}") + return response.json()["type"] == GUILD_FORUM_TYPE + + def delete_channel(self, channel_id_: id) -> None: + """Upgrades a channel to a channel of type GUILD FORUM.""" + log.info(f"Channel python-help: {channel_id_} is not a forum channel and will be replaced with one.") + self.delete(f"/channels/{channel_id_}") + + def get_all_roles(self) -> dict: + """Fetches all the roles in a guild.""" + result = {} + + response = self.get(f"guilds/{self.guild_id}/roles") + roles = response.json() + + for role in roles: + name = "_".join(part.lower() for part in role["name"].split(" ")).replace("-", "_") + result[name] = role["id"] + + return result + + def get_all_channels_and_categories(self) -> tuple[dict[str, str], dict[str, str]]: + """Fetches all the text channels & categories in a guild.""" + off_topic_channel_name_regex = r"ot\d{1}(_.*)+" + off_topic_count = 0 + channels = {} # could be text channels only as well + categories = {} + + response = self.get(f"guilds/{self.guild_id}/channels") + server_channels = response.json() + + for channel in server_channels: + channel_type = channel["type"] + name = "_".join(part.lower() for part in channel["name"].split(" ")).replace("-", "_") + if re.match(off_topic_channel_name_regex, name): + name = f"off_topic_{off_topic_count}" + off_topic_count += 1 + + if channel_type == 4: + categories[name] = channel["id"] + else: + channels[name] = channel["id"] + + return channels, categories + + def webhook_exists(self, webhook_id_: int) -> bool: + """A predicate that indicates whether a webhook exists already or not.""" + try: + self.get(f"webhooks/{webhook_id_}") + return True + except HTTPStatusError: + return False + + def create_webhook(self, name: str, channel_id_: int) -> str: + """Creates a new webhook for a particular channel.""" + payload = {"name": name} + + response = self.post(f"channels/{channel_id_}/webhooks", json=payload) + new_webhook = response.json() + return new_webhook["id"] + + +with DiscordClient(guild_id=GUILD_ID) as discord_client: config_str = "#Roles\n" - all_roles = get_all_roles(guild_id=GUILD_ID, client=discord_client) + all_roles = discord_client.get_all_roles() for role_name in _Roles.__fields__: @@ -177,28 +164,28 @@ with DiscordClient() as discord_client: config_str += f"roles_{role_name}={role_id}\n" - all_channels, all_categories = get_all_channels_and_categories(guild_id=GUILD_ID, client=discord_client) + all_channels, all_categories = discord_client.get_all_channels_and_categories() config_str += "\n#Channels\n" rules_channel_id = all_channels[RULES_CHANNEL_NAME] announcements_channel_id = all_channels[ANNOUNCEMENTS_CHANNEL_NAME] - upgrade_server_to_community_if_necessary(GUILD_ID, rules_channel_id, announcements_channel_id, discord_client) + discord_client.upgrade_server_to_community_if_necessary(rules_channel_id, announcements_channel_id) create_help_channel = True if PYTHON_HELP_CHANNEL_NAME in all_channels: python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] - if not is_forum_channel(python_help_channel_id, discord_client): - delete_channel(python_help_channel_id, discord_client) + if not discord_client.is_forum_channel(python_help_channel_id): + discord_client.delete_channel(python_help_channel_id) else: create_help_channel = False if create_help_channel: python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') python_help_category_id = all_categories[PYTHON_HELP_CATEGORY_NAME] - python_help_channel_id = create_forum_channel(python_help_channel_name, GUILD_ID, discord_client, python_help_category_id) + python_help_channel_id = discord_client.create_forum_channel(python_help_channel_name, python_help_category_id) all_channels[PYTHON_HELP_CHANNEL_NAME] = python_help_channel_id for channel_name in _Channels.__fields__: @@ -229,10 +216,10 @@ with DiscordClient() as discord_client: config_str += "\n#Webhooks\n" for webhook_name, webhook_model in Webhooks: - webhook = webhook_exists(webhook_model.id, client=discord_client) + webhook = discord_client.webhook_exists(webhook_model.id) if not webhook: webhook_channel_id = int(all_channels[webhook_name]) - webhook_id = create_webhook(webhook_name, webhook_channel_id, client=discord_client) + webhook_id = discord_client.create_webhook(webhook_name, webhook_channel_id) else: webhook_id = webhook_model.id config_str += f"webhooks_{webhook_name}__id={webhook_id}\n" -- cgit v1.2.3 From 0d049bcd9ed752f15ed4c53948f5b52f84574b3e Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 13:29:24 +0100 Subject: add type annotation for guild_id --- botstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botstrap.py b/botstrap.py index df783d1e4..79b296288 100644 --- a/botstrap.py +++ b/botstrap.py @@ -42,7 +42,7 @@ if not GUILD_ID: class DiscordClient(Client): """An HTTP client to communicate with Discord's APIs.""" - def __init__(self, guild_id): + def __init__(self, guild_id: int | str): super().__init__( base_url="https://discord.com/api/v10", headers={"Authorization": f"Bot {BOT_TOKEN}"}, -- cgit v1.2.3 From 34f0dc1f38ca0de147788604948d887a0f45fb5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 13:09:00 +0000 Subject: Bump sentry-sdk from 1.17.0 to 1.18.0 (#2497) Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.17.0 to 1.18.0. - [Release notes](https://github.com/getsentry/sentry-python/releases) - [Changelog](https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-python/compare/1.17.0...1.18.0) --- updated-dependencies: - dependency-name: sentry-sdk dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 089c13c5b..35df3d9bd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2122,14 +2122,14 @@ idna2008 = ["idna"] [[package]] name = "sentry-sdk" -version = "1.17.0" +version = "1.18.0" description = "Python client for Sentry (https://sentry.io)" category = "main" optional = false python-versions = "*" files = [ - {file = "sentry-sdk-1.17.0.tar.gz", hash = "sha256:ad40860325c94d1a656da70fba5a7c4dbb2f6809d3cc2d00f74ca0b608330f14"}, - {file = "sentry_sdk-1.17.0-py2.py3-none-any.whl", hash = "sha256:3c4e898f7a3edf5a2042cd0dcab6ee124e2112189228c272c08ad15d3850c201"}, + {file = "sentry-sdk-1.18.0.tar.gz", hash = "sha256:d07b9569a151033b462f7a7113ada94cc41ecf49daa83d35f5f852a0b9cf3b44"}, + {file = "sentry_sdk-1.18.0-py2.py3-none-any.whl", hash = "sha256:714203a9adcac4a4a35e348dc9d3e294ad0200a66cdca26c068967d728f34fcb"}, ] [package.dependencies] @@ -2462,4 +2462,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "3.11.*" -content-hash = "a6d27f8809406a69ab8ce1d03a55fd2704b902e929285e2102383f9f2bbe26ca" +content-hash = "b64b729705938e3b035d97cb4ab8d3c6efe5cb15bb12d44bc056a7e9b811aa77" diff --git a/pyproject.toml b/pyproject.toml index 369f46c11..e5f522ee8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ python-frontmatter = "1.0.0" pyyaml = "6.0" rapidfuzz = "2.13.7" regex = "2023.3.23" -sentry-sdk = "1.17.0" +sentry-sdk = "1.18.0" tldextract = "3.4.0" pydantic = { version = "1.10.7", extras = ["dotenv"]} -- cgit v1.2.3 From b30475b1fbabbf970dfe1af4801152f70d917080 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 22:18:21 +0200 Subject: introduce SilencedDict --- botstrap.py | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/botstrap.py b/botstrap.py index 79b296288..d36222b83 100644 --- a/botstrap.py +++ b/botstrap.py @@ -1,5 +1,6 @@ import os import re +import sys from pathlib import Path from dotenv import load_dotenv @@ -39,6 +40,23 @@ if not GUILD_ID: raise ValueError(message) +class SilencedDict(dict): + """A dictionary that silences KeyError exceptions upon subscription to non existent items.""" + + def __init__(self, name: str): + self.name = name + super().__init__() + + def __getitem__(self, item: str): + try: + super().__getitem__(item) + except KeyError: + log.warning(f"Couldn't find key: {item} in dict: {self.name} ") + log.warning("Please make sure to use our template: https://discord.new/zmHtscpYN9E3" + "to make your own copy of the server to guarantee a successful run of botstrap ") + sys.exit(-1) + + class DiscordClient(Client): """An HTTP client to communicate with Discord's APIs.""" @@ -92,13 +110,13 @@ class DiscordClient(Client): return response.json()["type"] == GUILD_FORUM_TYPE def delete_channel(self, channel_id_: id) -> None: - """Upgrades a channel to a channel of type GUILD FORUM.""" + """Delete a channel.""" log.info(f"Channel python-help: {channel_id_} is not a forum channel and will be replaced with one.") self.delete(f"/channels/{channel_id_}") def get_all_roles(self) -> dict: """Fetches all the roles in a guild.""" - result = {} + result = SilencedDict(name="Roles dictionary") response = self.get(f"guilds/{self.guild_id}/roles") roles = response.json() @@ -113,8 +131,8 @@ class DiscordClient(Client): """Fetches all the text channels & categories in a guild.""" off_topic_channel_name_regex = r"ot\d{1}(_.*)+" off_topic_count = 0 - channels = {} # could be text channels only as well - categories = {} + channels = SilencedDict(name="Channels dictionary") + categories = SilencedDict(name="Categories dictionary") response = self.get(f"guilds/{self.guild_id}/channels") server_channels = response.json() @@ -175,12 +193,11 @@ with DiscordClient(guild_id=GUILD_ID) as discord_client: create_help_channel = True - if PYTHON_HELP_CHANNEL_NAME in all_channels: - python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] - if not discord_client.is_forum_channel(python_help_channel_id): - discord_client.delete_channel(python_help_channel_id) - else: - create_help_channel = False + python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] + if not discord_client.is_forum_channel(python_help_channel_id): + discord_client.delete_channel(python_help_channel_id) + else: + create_help_channel = False if create_help_channel: python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') -- cgit v1.2.3 From 1dd64bb20177f1062304e87069c4fe502784f44d Mon Sep 17 00:00:00 2001 From: shtlrs Date: Thu, 30 Mar 2023 23:03:19 +0200 Subject: converge site_api_scheme & site_api into site_api --- bot/__main__.py | 2 +- bot/constants.py | 4 ++-- bot/exts/utils/ping.py | 2 +- docker-compose.yml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bot/__main__.py b/bot/__main__.py index 003cbbcda..8b640a370 100644 --- a/bot/__main__.py +++ b/bot/__main__.py @@ -66,7 +66,7 @@ async def main() -> None: intents=intents, allowed_roles=list({discord.Object(id_) for id_ in constants.MODERATION_ROLES}), api_client=APIClient( - site_api_url=f"{constants.URLs.site_api_scheme}{constants.URLs.site_api}", + site_api_url=constants.URLs.site_api, site_api_token=constants.Keys.site_api, ), ) diff --git a/bot/constants.py b/bot/constants.py index 67c21816a..b72a70c84 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -527,8 +527,7 @@ class _BaseURLs(EnvConfig): github_bot_repo = "https://github.com/python-discord/bot" # Site - site_api = "site.default.svc.cluster.local/api" - site_api_scheme = "http://" + site_api = "http://site.default.svc.cluster.local/api" site_paste = "https://paste.pythondiscord.com" @@ -547,6 +546,7 @@ class _URLs(_BaseURLs): paste_service: str = "".join([BaseURLs.site_paste, "/{key}"]) site_logs_view: str = "https://pythondiscord.com/staff/bot/logs" + URLs = _URLs() diff --git a/bot/exts/utils/ping.py b/bot/exts/utils/ping.py index 20e956e03..edac4ebca 100644 --- a/bot/exts/utils/ping.py +++ b/bot/exts/utils/ping.py @@ -38,7 +38,7 @@ class Latency(commands.Cog): bot_ping = f"{bot_ping:.{ROUND_LATENCY}f} ms" try: - async with self.bot.http_session.get(f"{URLs.site_api_scheme}{URLs.site_api}/healthcheck") as request: + async with self.bot.http_session.get(f"{URLs.site_api}/healthcheck") as request: request.raise_for_status() site_status = "Healthy" diff --git a/docker-compose.yml b/docker-compose.yml index 694f44507..5f3fbf5ba 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -113,7 +113,7 @@ services: - .env environment: API_KEYS_SITE_API: "badbot13m0n8f570f942013fc818f234916ca531" - URLS_SITE_API: "web:8000/api" + URLS_SITE_API: "http://web:8000/api" URLS_SNEKBOX_EVAL_API: "http://snekbox/eval" URLS_SNEKBOX_311_EVAL_API: "http://snekbox-311/eval" REDIS_HOST: "redis" -- cgit v1.2.3 From 153ca4a1b31024a170222a18e7f1c7772c6d258f Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 31 Mar 2023 01:33:58 +0200 Subject: revert refactoring of site_api_client --- bot/exts/recruitment/talentpool/_api.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/exts/recruitment/talentpool/_api.py b/bot/exts/recruitment/talentpool/_api.py index e9e60890a..c00c8c09c 100644 --- a/bot/exts/recruitment/talentpool/_api.py +++ b/bot/exts/recruitment/talentpool/_api.py @@ -29,8 +29,8 @@ class Nomination(BaseModel): class NominationAPI: """Abstraction of site API interaction for talentpool.""" - def __init__(self, site_api_client: APIClient): - self.site_api_client = site_api_client + def __init__(self, site_api: APIClient): + self.site_api = site_api async def get_nominations( self, @@ -49,13 +49,13 @@ class NominationAPI: if user_id is not None: params["user__id"] = str(user_id) - data = await self.site_api_client.get("bot/nominations", params=params) + data = await self.site_api.get("bot/nominations", params=params) nominations = parse_obj_as(list[Nomination], data) return nominations async def get_nomination(self, nomination_id: int) -> Nomination: """Fetch a nomination by ID.""" - data = await self.site_api_client.get(f"bot/nominations/{nomination_id}") + data = await self.site_api.get(f"bot/nominations/{nomination_id}") nomination = Nomination.parse_obj(data) return nomination @@ -83,7 +83,7 @@ class NominationAPI: if thread_id is not None: data["thread_id"] = thread_id - result = await self.site_api_client.patch(f"bot/nominations/{nomination_id}", json=data) + result = await self.site_api.patch(f"bot/nominations/{nomination_id}", json=data) return Nomination.parse_obj(result) async def edit_nomination_entry( @@ -95,7 +95,7 @@ class NominationAPI: ) -> Nomination: """Edit a nomination entry.""" data = {"actor": actor_id, "reason": reason} - result = await self.site_api_client.patch(f"bot/nominations/{nomination_id}", json=data) + result = await self.site_api.patch(f"bot/nominations/{nomination_id}", json=data) return Nomination.parse_obj(result) async def post_nomination( @@ -110,5 +110,5 @@ class NominationAPI: "reason": reason, "user": user_id, } - result = await self.site_api_client.post("bot/nominations", json=data) + result = await self.site_api.post("bot/nominations", json=data) return Nomination.parse_obj(result) -- cgit v1.2.3 From dace921097e56dc39d6643f384d1ca08befc9560 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 31 Mar 2023 01:52:04 +0200 Subject: bring back the check of python help channel this also updates the logs in SilencedDict --- botstrap.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/botstrap.py b/botstrap.py index d36222b83..d3462c122 100644 --- a/botstrap.py +++ b/botstrap.py @@ -52,8 +52,11 @@ class SilencedDict(dict): super().__getitem__(item) except KeyError: log.warning(f"Couldn't find key: {item} in dict: {self.name} ") - log.warning("Please make sure to use our template: https://discord.new/zmHtscpYN9E3" - "to make your own copy of the server to guarantee a successful run of botstrap ") + log.warning( + "Please make sure to follow our contribution guideline " + "https://www.pythondiscord.com/pages/guides/pydis-guides/contributing/bot/ " + "to guarantee a successful run of botstrap " + ) sys.exit(-1) @@ -193,11 +196,12 @@ with DiscordClient(guild_id=GUILD_ID) as discord_client: create_help_channel = True - python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] - if not discord_client.is_forum_channel(python_help_channel_id): - discord_client.delete_channel(python_help_channel_id) - else: - create_help_channel = False + if PYTHON_HELP_CHANNEL_NAME in all_channels: + python_help_channel_id = all_channels[PYTHON_HELP_CHANNEL_NAME] + if not discord_client.is_forum_channel(python_help_channel_id): + discord_client.delete_channel(python_help_channel_id) + else: + create_help_channel = False if create_help_channel: python_help_channel_name = PYTHON_HELP_CHANNEL_NAME.replace('_', '-') -- cgit v1.2.3 From caaa13f78d8e9a577a08d5b20847bdd597ef6a38 Mon Sep 17 00:00:00 2001 From: shtlrs Date: Fri, 31 Mar 2023 14:41:49 +0100 Subject: return value from SilencedDict --- botstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/botstrap.py b/botstrap.py index d3462c122..ccf6993f5 100644 --- a/botstrap.py +++ b/botstrap.py @@ -49,7 +49,7 @@ class SilencedDict(dict): def __getitem__(self, item: str): try: - super().__getitem__(item) + return super().__getitem__(item) except KeyError: log.warning(f"Couldn't find key: {item} in dict: {self.name} ") log.warning( -- cgit v1.2.3 From aa599595cdc1bd2dd60ec2b2a15797257cf5b6ae Mon Sep 17 00:00:00 2001 From: mbaruh Date: Fri, 31 Mar 2023 21:39:16 +0300 Subject: Add helpering quiz --- bot/constants.py | 1 + bot/exts/info/subscribe.py | 4 +- bot/helper_questions.py | 144 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 148 insertions(+), 1 deletion(-) create mode 100644 bot/helper_questions.py diff --git a/bot/constants.py b/bot/constants.py index 4186472b1..ff03e9445 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -162,6 +162,7 @@ class _Roles(EnvConfig): mod_team = 267629731250176001 owners = 267627879762755584 project_leads = 815701647526330398 + new_helpers = 1088292464051368018 # Code Jam jammers = 737249140966162473 diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py index aff1302bb..90a3d4529 100644 --- a/bot/exts/info/subscribe.py +++ b/bot/exts/info/subscribe.py @@ -12,6 +12,7 @@ from pydis_core.utils import members from bot import constants from bot.bot import Bot from bot.decorators import redirect_output +from bot.helper_questions import HelperingButton from bot.log import get_logger from bot.utils.channel import get_or_fetch_channel @@ -78,7 +79,8 @@ class RoleButtonView(discord.ui.View): self.interaction_owner = member author_roles = [role.id for role in member.roles] - for index, role in enumerate(assignable_roles): + self.add_item(HelperingButton(constants.Roles.new_helpers in author_roles, 0)) + for index, role in enumerate(assignable_roles, start=1): row = index // ITEMS_PER_ROW self.add_item(SingleRoleButton(role, role.role_id in author_roles, row)) diff --git a/bot/helper_questions.py b/bot/helper_questions.py new file mode 100644 index 000000000..a1f69945a --- /dev/null +++ b/bot/helper_questions.py @@ -0,0 +1,144 @@ +from collections import namedtuple +from string import ascii_lowercase, ascii_uppercase +from textwrap import dedent + +import discord + +from bot.constants import Roles + +Question = namedtuple("question", ("question", "answers")) + +questions = [ + Question( + question="How do you print in python?", + answers=( + "`print()`", + "`sys.stdout.write()`", + "None of the above", + "All of the above" + ) + ), + Question( + question=dedent( + """ + A user opens a help channel with the following information: + > Help, my code is broken. + + They are in a hurry, so there's no time for back-and-forth debugging the issue. + Is the solution to their issue: + """ + ).strip(), + answers=( + 'Replace `password == "123" or "456"` with `password in ("123", "456")`', + "Downgrade to 3.10 because `binascii.rldecode_hqx()` was removed in 3.11", + "Restart their computer and try running it again (it worked before)", + ( + "Nothing. They weren't actually getting an error, " + "the import was just greyed out in VSCode because they hadn't used it yet. " + ) + ) + ), + Question( + question="Why is static typing a terrible feature for a programming language?", + answers=( + "It makes it more difficult to apply polymorphism", + "You get TypeErrors before you can even run the code, slowing down development", + "Guido likes static typing now, actually", + "All of the above" + ) + ), + Question( + question="When is Lemon Day?", + answers=( + "January 1", + "April 14", + "August 29", + "Any day that is not Lime Day" + ) + ) +] + +TOTAL_QUESTION_TO_ASK = 4 + +HELPERS_ROLE = discord.Object(Roles.new_helpers) + + +def format_question(question_index: int) -> str: + """Format the question to be displayed in chat.""" + question = questions[question_index] + prompt = f"**Question {question_index+1} of {TOTAL_QUESTION_TO_ASK}**\n\n{question.question}\n\n" + prompt += "\n".join( + f":regional_indicator_{letter}: {answer}" + for letter, answer in zip(ascii_lowercase, question.answers) + ) + return prompt + + +class HelperingView(discord.ui.View): + """A view that implements the helpering logic by asking a series of questions.""" + + def __init__(self, phase: int = 0): + super().__init__() + print(phase) + self.phase = phase + + answers_view = AnswersSelect(phase) + self.add_item(answers_view) + + +class AnswersSelect(discord.ui.Select): + """A selection of answers to the given question.""" + + def __init__(self, phase: int): + question = questions[phase] + answers = [discord.SelectOption(label=answer) for answer in ascii_uppercase[:len(question.answers)]] + + super().__init__(options=answers) + self.phase = phase + + async def callback(self, interaction: discord.Interaction) -> None: + """Move to the next question, or apply the role if enough question were answered.""" + if self.phase + 1 >= TOTAL_QUESTION_TO_ASK: + if isinstance(interaction.user, discord.Member): + await interaction.user.add_roles(HELPERS_ROLE) + await interaction.response.edit_message( + content=":white_check_mark: Added the Helpers role!", view=None + ) + else: + content = format_question(self.phase + 1) + view = HelperingView(self.phase + 1) + await interaction.response.edit_message(content=content, view=view) + + self.view.stop() + + +class HelperingButton(discord.ui.Button): + """The button which starts the helpering process.""" + + def __init__(self, assigned: bool, row: int,): + label = "Add role Helpers" if not assigned else "Remove role Helpers" + style = discord.ButtonStyle.green if not assigned else discord.ButtonStyle.red + super().__init__(style=style, label=label, row=row) + self.assigned = assigned + + async def callback(self, interaction: discord.Interaction) -> None: + """Either remove the Helpers role or start the Helpering process.""" + if self.assigned: + if isinstance(interaction.user, discord.Member): + await interaction.user.remove_roles(HELPERS_ROLE) + self.label = "Add role Helpers" + self.style = discord.ButtonStyle.green + self.assigned = not self.assigned + await interaction.response.edit_message(view=self.view) + await interaction.followup.send("Removed role Helpers", ephemeral=True) + return + + await interaction.response.edit_message(content="Launching Helpering process, good luck!", view=None) + content = format_question(0) + view = HelperingView() + await interaction.followup.send( + content=content, + view=view, + ephemeral=True, + ) + self.view.stop() -- cgit v1.2.3 From 27f2850aa486afb03299d7e0bed7da98bae36c42 Mon Sep 17 00:00:00 2001 From: Steele Date: Sun, 26 Mar 2023 12:35:04 -0400 Subject: New Helper functionality. This cog will tell helpers when someone asks a question in off-topic channels, in an effort to improve question engagement. --- bot/exts/recruitment/helper_utils.py | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 bot/exts/recruitment/helper_utils.py diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py new file mode 100644 index 000000000..9c059e2b3 --- /dev/null +++ b/bot/exts/recruitment/helper_utils.py @@ -0,0 +1,78 @@ +import datetime as dt +import random + +from async_rediscache import RedisCache +from discord import Message +from discord.ext.commands import Cog + +from bot.bot import Bot +from bot.constants import Channels, Roles +from bot.log import get_logger + +OT_CHANNEL_IDS = (Channels.off_topic_0, Channels.off_topic_1, Channels.off_topic_2) +NEW_HELPER_ROLE_ID = Roles.new_helpers + +log = get_logger(__name__) + + +class NewHelperUtils(Cog): + """Manages functionality for new helpers in April 2023.""" + + # RedisCache[discord.Channel.id, UtcPosixTimestamp] + cooldown_cache = RedisCache() + + COOLDOWN_DURATION = dt.timedelta(minutes=10) + MESSAGES = [ + f"<@&{NEW_HELPER_ROLE_ID}> can someone please answer this??", + f"Someone answer this <@&{NEW_HELPER_ROLE_ID}> if you want to keep your role", + f"Where are my <@&{NEW_HELPER_ROLE_ID}> at?", + f"<@&{NEW_HELPER_ROLE_ID}>, Help!", + f"What's the point of having all these new <@&{NEW_HELPER_ROLE_ID}> if questions are going unanswered?", + ] + + def __init__(self, bot: Bot): + self.bot = bot + + @staticmethod + def _is_question(message: str) -> bool: + """Return True if `message` appears to be a question, else False!""" + return ( + ('?' in message) + and any(map( + message.lower().startswith, + ( + 'is', 'are', 'am', + 'was', 'were', + 'will', + 'can', 'does', 'do', 'did' + 'who', 'what', 'when', 'where', 'why' + ) + )) + ) + + @Cog.listener() + async def on_message(self, message: Message) -> None: + """ + This is an event listener. + + Ping helpers in off-topic channels whenever someone asks a question, at most + as often `COOLDOWN_DURATION`. + """ + if message.author.bot or message.channel.id not in OT_CHANNEL_IDS: + return + + last_activation_time = dt.datetime.fromtimestamp( + await self.cooldown_cache.get(message.channel.id, 0) + ) + + if dt.datetime.now() - last_activation_time < self.COOLDOWN_DURATION: + return + + if self._is_question(message.content): + await message.reply(random.choice(self.MESSAGES)) + await self.cooldown_cache.set(message.channel.id, dt.datetime.now().timestamp()) + + +async def setup(bot: Bot) -> None: + """Load the OffTopicNames cog.""" + await bot.add_cog(NewHelperUtils(bot)) -- cgit v1.2.3 From b899a14a6aece6f3071157621fe24656db323caa Mon Sep 17 00:00:00 2001 From: Steele Date: Sun, 26 Mar 2023 16:04:44 -0400 Subject: Change "Help!" to "answer this!" It may occasionally be confusing why the bot thinks people need to "help" if there's a false positive (ie if the message is not a question). --- bot/exts/recruitment/helper_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index 9c059e2b3..df7260c40 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -26,7 +26,7 @@ class NewHelperUtils(Cog): f"<@&{NEW_HELPER_ROLE_ID}> can someone please answer this??", f"Someone answer this <@&{NEW_HELPER_ROLE_ID}> if you want to keep your role", f"Where are my <@&{NEW_HELPER_ROLE_ID}> at?", - f"<@&{NEW_HELPER_ROLE_ID}>, Help!", + f"<@&{NEW_HELPER_ROLE_ID}>, answer this!", f"What's the point of having all these new <@&{NEW_HELPER_ROLE_ID}> if questions are going unanswered?", ] -- cgit v1.2.3 From 729f2288dd48208bae7af5d22136921ec30f21b3 Mon Sep 17 00:00:00 2001 From: Steele Date: Thu, 30 Mar 2023 16:16:43 -0400 Subject: Use broader heuristic for detecting questions. Namely just seeing if there's a question mark in it that isn't part of a URL. --- bot/exts/recruitment/helper_utils.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index df7260c40..3ea8108f6 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -1,5 +1,6 @@ import datetime as dt import random +import re from async_rediscache import RedisCache from discord import Message @@ -14,6 +15,8 @@ NEW_HELPER_ROLE_ID = Roles.new_helpers log = get_logger(__name__) +URL_RE = re.compile(r"(https?://[^\s]+)", flags=re.IGNORECASE) + class NewHelperUtils(Cog): """Manages functionality for new helpers in April 2023.""" @@ -36,19 +39,7 @@ class NewHelperUtils(Cog): @staticmethod def _is_question(message: str) -> bool: """Return True if `message` appears to be a question, else False!""" - return ( - ('?' in message) - and any(map( - message.lower().startswith, - ( - 'is', 'are', 'am', - 'was', 'were', - 'will', - 'can', 'does', 'do', 'did' - 'who', 'what', 'when', 'where', 'why' - ) - )) - ) + return '?' in URL_RE.sub('', message) @Cog.listener() async def on_message(self, message: Message) -> None: -- cgit v1.2.3 From 442d04ca5e3b30a4ab857698235273a23151838f Mon Sep 17 00:00:00 2001 From: mbaruh Date: Sat, 1 Apr 2023 01:14:39 +0300 Subject: Avoid race conditions and stricter cooldown --- bot/exts/recruitment/helper_utils.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index 3ea8108f6..fe264f647 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -2,6 +2,7 @@ import datetime as dt import random import re +import arrow from async_rediscache import RedisCache from discord import Message from discord.ext.commands import Cog @@ -24,6 +25,8 @@ class NewHelperUtils(Cog): # RedisCache[discord.Channel.id, UtcPosixTimestamp] cooldown_cache = RedisCache() + CACHE_KEY = "LAST_PING" + COOLDOWN_DURATION = dt.timedelta(minutes=10) MESSAGES = [ f"<@&{NEW_HELPER_ROLE_ID}> can someone please answer this??", @@ -35,6 +38,11 @@ class NewHelperUtils(Cog): def __init__(self, bot: Bot): self.bot = bot + self.last_pinged = arrow.get(0) # Ready to fire if it can't be loaded from the cache. + + async def cog_load(self) -> None: + """Load the most recent activation time from the cache.""" + self.last_pinged = arrow.get(await self.cooldown_cache.get(self.CACHE_KEY, 0)) @staticmethod def _is_question(message: str) -> bool: @@ -52,16 +60,13 @@ class NewHelperUtils(Cog): if message.author.bot or message.channel.id not in OT_CHANNEL_IDS: return - last_activation_time = dt.datetime.fromtimestamp( - await self.cooldown_cache.get(message.channel.id, 0) - ) - - if dt.datetime.now() - last_activation_time < self.COOLDOWN_DURATION: + if arrow.utcnow() - self.last_pinged < self.COOLDOWN_DURATION: return if self._is_question(message.content): + self.last_pinged = arrow.utcnow() await message.reply(random.choice(self.MESSAGES)) - await self.cooldown_cache.set(message.channel.id, dt.datetime.now().timestamp()) + await self.cooldown_cache.set(self.CACHE_KEY, self.last_pinged.timestamp()) async def setup(bot: Bot) -> None: -- cgit v1.2.3 From 4c55833b189b728c6a716d7c19ab9e0aa5b900ef Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Fri, 31 Mar 2023 20:42:21 -0400 Subject: Make new helper role pingable for help request. Previously, the message from the bot requesting that new helpers answer off-topic questions did not cause a ping. Solved by this commit. --- bot/exts/recruitment/helper_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index fe264f647..8af17fe7a 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -4,6 +4,7 @@ import re import arrow from async_rediscache import RedisCache +import discord from discord import Message from discord.ext.commands import Cog @@ -65,7 +66,8 @@ class NewHelperUtils(Cog): if self._is_question(message.content): self.last_pinged = arrow.utcnow() - await message.reply(random.choice(self.MESSAGES)) + allowed_mentions = discord.AllowedMentions(everyone=False, roles=[discord.Object(NEW_HELPER_ROLE_ID)]) + await message.reply(random.choice(self.MESSAGES), allowed_mentions=allowed_mentions) await self.cooldown_cache.set(self.CACHE_KEY, self.last_pinged.timestamp()) -- cgit v1.2.3 From bd80fb21b86d175fcca56b5c2f1ce4f48dd30323 Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Fri, 31 Mar 2023 20:52:49 -0400 Subject: Add blank line for linting. --- bot/exts/recruitment/helper_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index 8af17fe7a..d53b5e62b 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -4,6 +4,7 @@ import re import arrow from async_rediscache import RedisCache + import discord from discord import Message from discord.ext.commands import Cog -- cgit v1.2.3 From e38c559d422b054a2687fcf30ac07ee202deec1f Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Fri, 31 Mar 2023 20:55:11 -0400 Subject: Fix import order. --- bot/exts/recruitment/helper_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index d53b5e62b..ca8ac3760 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -3,9 +3,8 @@ import random import re import arrow -from async_rediscache import RedisCache - import discord +from async_rediscache import RedisCache from discord import Message from discord.ext.commands import Cog -- cgit v1.2.3 From 2dcfcc899cc459d986f19ba1c1660460c0212d63 Mon Sep 17 00:00:00 2001 From: bradtimmis Date: Sat, 1 Apr 2023 09:36:06 -0400 Subject: Update ping cooldown for helpers --- bot/exts/recruitment/helper_utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py index ca8ac3760..df3e6cd5c 100644 --- a/bot/exts/recruitment/helper_utils.py +++ b/bot/exts/recruitment/helper_utils.py @@ -25,10 +25,8 @@ class NewHelperUtils(Cog): # RedisCache[discord.Channel.id, UtcPosixTimestamp] cooldown_cache = RedisCache() - CACHE_KEY = "LAST_PING" - COOLDOWN_DURATION = dt.timedelta(minutes=10) MESSAGES = [ f"<@&{NEW_HELPER_ROLE_ID}> can someone please answer this??", f"Someone answer this <@&{NEW_HELPER_ROLE_ID}> if you want to keep your role", @@ -40,6 +38,7 @@ class NewHelperUtils(Cog): def __init__(self, bot: Bot): self.bot = bot self.last_pinged = arrow.get(0) # Ready to fire if it can't be loaded from the cache. + self.cooldown_duration = dt.timedelta(minutes=10) async def cog_load(self) -> None: """Load the most recent activation time from the cache.""" @@ -61,7 +60,7 @@ class NewHelperUtils(Cog): if message.author.bot or message.channel.id not in OT_CHANNEL_IDS: return - if arrow.utcnow() - self.last_pinged < self.COOLDOWN_DURATION: + if arrow.utcnow() - self.last_pinged < self.cooldown_duration: return if self._is_question(message.content): @@ -69,6 +68,7 @@ class NewHelperUtils(Cog): allowed_mentions = discord.AllowedMentions(everyone=False, roles=[discord.Object(NEW_HELPER_ROLE_ID)]) await message.reply(random.choice(self.MESSAGES), allowed_mentions=allowed_mentions) await self.cooldown_cache.set(self.CACHE_KEY, self.last_pinged.timestamp()) + self.cooldown_duration = dt.timedelta(minutes=random.randint(10, 30)) async def setup(bot: Bot) -> None: -- cgit v1.2.3 From e476876eac8fcb2c2a8ad8dc7afb1a08c99755b0 Mon Sep 17 00:00:00 2001 From: mbaruh Date: Sun, 2 Apr 2023 07:25:31 +0300 Subject: Remove self-assignable helpers functionality --- bot/constants.py | 1 - bot/exts/info/subscribe.py | 4 +- bot/exts/recruitment/helper_utils.py | 76 ------------------ bot/helper_questions.py | 144 ----------------------------------- 4 files changed, 1 insertion(+), 224 deletions(-) delete mode 100644 bot/exts/recruitment/helper_utils.py delete mode 100644 bot/helper_questions.py diff --git a/bot/constants.py b/bot/constants.py index 9df2a0950..0b75153d3 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -164,7 +164,6 @@ class _Roles(EnvConfig): mod_team = 267629731250176001 owners = 267627879762755584 project_leads = 815701647526330398 - new_helpers = 1088292464051368018 # Code Jam jammers = 737249140966162473 diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py index 90a3d4529..aff1302bb 100644 --- a/bot/exts/info/subscribe.py +++ b/bot/exts/info/subscribe.py @@ -12,7 +12,6 @@ from pydis_core.utils import members from bot import constants from bot.bot import Bot from bot.decorators import redirect_output -from bot.helper_questions import HelperingButton from bot.log import get_logger from bot.utils.channel import get_or_fetch_channel @@ -79,8 +78,7 @@ class RoleButtonView(discord.ui.View): self.interaction_owner = member author_roles = [role.id for role in member.roles] - self.add_item(HelperingButton(constants.Roles.new_helpers in author_roles, 0)) - for index, role in enumerate(assignable_roles, start=1): + for index, role in enumerate(assignable_roles): row = index // ITEMS_PER_ROW self.add_item(SingleRoleButton(role, role.role_id in author_roles, row)) diff --git a/bot/exts/recruitment/helper_utils.py b/bot/exts/recruitment/helper_utils.py deleted file mode 100644 index df3e6cd5c..000000000 --- a/bot/exts/recruitment/helper_utils.py +++ /dev/null @@ -1,76 +0,0 @@ -import datetime as dt -import random -import re - -import arrow -import discord -from async_rediscache import RedisCache -from discord import Message -from discord.ext.commands import Cog - -from bot.bot import Bot -from bot.constants import Channels, Roles -from bot.log import get_logger - -OT_CHANNEL_IDS = (Channels.off_topic_0, Channels.off_topic_1, Channels.off_topic_2) -NEW_HELPER_ROLE_ID = Roles.new_helpers - -log = get_logger(__name__) - -URL_RE = re.compile(r"(https?://[^\s]+)", flags=re.IGNORECASE) - - -class NewHelperUtils(Cog): - """Manages functionality for new helpers in April 2023.""" - - # RedisCache[discord.Channel.id, UtcPosixTimestamp] - cooldown_cache = RedisCache() - CACHE_KEY = "LAST_PING" - - MESSAGES = [ - f"<@&{NEW_HELPER_ROLE_ID}> can someone please answer this??", - f"Someone answer this <@&{NEW_HELPER_ROLE_ID}> if you want to keep your role", - f"Where are my <@&{NEW_HELPER_ROLE_ID}> at?", - f"<@&{NEW_HELPER_ROLE_ID}>, answer this!", - f"What's the point of having all these new <@&{NEW_HELPER_ROLE_ID}> if questions are going unanswered?", - ] - - def __init__(self, bot: Bot): - self.bot = bot - self.last_pinged = arrow.get(0) # Ready to fire if it can't be loaded from the cache. - self.cooldown_duration = dt.timedelta(minutes=10) - - async def cog_load(self) -> None: - """Load the most recent activation time from the cache.""" - self.last_pinged = arrow.get(await self.cooldown_cache.get(self.CACHE_KEY, 0)) - - @staticmethod - def _is_question(message: str) -> bool: - """Return True if `message` appears to be a question, else False!""" - return '?' in URL_RE.sub('', message) - - @Cog.listener() - async def on_message(self, message: Message) -> None: - """ - This is an event listener. - - Ping helpers in off-topic channels whenever someone asks a question, at most - as often `COOLDOWN_DURATION`. - """ - if message.author.bot or message.channel.id not in OT_CHANNEL_IDS: - return - - if arrow.utcnow() - self.last_pinged < self.cooldown_duration: - return - - if self._is_question(message.content): - self.last_pinged = arrow.utcnow() - allowed_mentions = discord.AllowedMentions(everyone=False, roles=[discord.Object(NEW_HELPER_ROLE_ID)]) - await message.reply(random.choice(self.MESSAGES), allowed_mentions=allowed_mentions) - await self.cooldown_cache.set(self.CACHE_KEY, self.last_pinged.timestamp()) - self.cooldown_duration = dt.timedelta(minutes=random.randint(10, 30)) - - -async def setup(bot: Bot) -> None: - """Load the OffTopicNames cog.""" - await bot.add_cog(NewHelperUtils(bot)) diff --git a/bot/helper_questions.py b/bot/helper_questions.py deleted file mode 100644 index a1f69945a..000000000 --- a/bot/helper_questions.py +++ /dev/null @@ -1,144 +0,0 @@ -from collections import namedtuple -from string import ascii_lowercase, ascii_uppercase -from textwrap import dedent - -import discord - -from bot.constants import Roles - -Question = namedtuple("question", ("question", "answers")) - -questions = [ - Question( - question="How do you print in python?", - answers=( - "`print()`", - "`sys.stdout.write()`", - "None of the above", - "All of the above" - ) - ), - Question( - question=dedent( - """ - A user opens a help channel with the following information: - > Help, my code is broken. - - They are in a hurry, so there's no time for back-and-forth debugging the issue. - Is the solution to their issue: - """ - ).strip(), - answers=( - 'Replace `password == "123" or "456"` with `password in ("123", "456")`', - "Downgrade to 3.10 because `binascii.rldecode_hqx()` was removed in 3.11", - "Restart their computer and try running it again (it worked before)", - ( - "Nothing. They weren't actually getting an error, " - "the import was just greyed out in VSCode because they hadn't used it yet. " - ) - ) - ), - Question( - question="Why is static typing a terrible feature for a programming language?", - answers=( - "It makes it more difficult to apply polymorphism", - "You get TypeErrors before you can even run the code, slowing down development", - "Guido likes static typing now, actually", - "All of the above" - ) - ), - Question( - question="When is Lemon Day?", - answers=( - "January 1", - "April 14", - "August 29", - "Any day that is not Lime Day" - ) - ) -] - -TOTAL_QUESTION_TO_ASK = 4 - -HELPERS_ROLE = discord.Object(Roles.new_helpers) - - -def format_question(question_index: int) -> str: - """Format the question to be displayed in chat.""" - question = questions[question_index] - prompt = f"**Question {question_index+1} of {TOTAL_QUESTION_TO_ASK}**\n\n{question.question}\n\n" - prompt += "\n".join( - f":regional_indicator_{letter}: {answer}" - for letter, answer in zip(ascii_lowercase, question.answers) - ) - return prompt - - -class HelperingView(discord.ui.View): - """A view that implements the helpering logic by asking a series of questions.""" - - def __init__(self, phase: int = 0): - super().__init__() - print(phase) - self.phase = phase - - answers_view = AnswersSelect(phase) - self.add_item(answers_view) - - -class AnswersSelect(discord.ui.Select): - """A selection of answers to the given question.""" - - def __init__(self, phase: int): - question = questions[phase] - answers = [discord.SelectOption(label=answer) for answer in ascii_uppercase[:len(question.answers)]] - - super().__init__(options=answers) - self.phase = phase - - async def callback(self, interaction: discord.Interaction) -> None: - """Move to the next question, or apply the role if enough question were answered.""" - if self.phase + 1 >= TOTAL_QUESTION_TO_ASK: - if isinstance(interaction.user, discord.Member): - await interaction.user.add_roles(HELPERS_ROLE) - await interaction.response.edit_message( - content=":white_check_mark: Added the Helpers role!", view=None - ) - else: - content = format_question(self.phase + 1) - view = HelperingView(self.phase + 1) - await interaction.response.edit_message(content=content, view=view) - - self.view.stop() - - -class HelperingButton(discord.ui.Button): - """The button which starts the helpering process.""" - - def __init__(self, assigned: bool, row: int,): - label = "Add role Helpers" if not assigned else "Remove role Helpers" - style = discord.ButtonStyle.green if not assigned else discord.ButtonStyle.red - super().__init__(style=style, label=label, row=row) - self.assigned = assigned - - async def callback(self, interaction: discord.Interaction) -> None: - """Either remove the Helpers role or start the Helpering process.""" - if self.assigned: - if isinstance(interaction.user, discord.Member): - await interaction.user.remove_roles(HELPERS_ROLE) - self.label = "Add role Helpers" - self.style = discord.ButtonStyle.green - self.assigned = not self.assigned - await interaction.response.edit_message(view=self.view) - await interaction.followup.send("Removed role Helpers", ephemeral=True) - return - - await interaction.response.edit_message(content="Launching Helpering process, good luck!", view=None) - content = format_question(0) - view = HelperingView() - await interaction.followup.send( - content=content, - view=view, - ephemeral=True, - ) - self.view.stop() -- cgit v1.2.3