#dev-contrib
1 messages ยท Page 132 of 1
Thank you thank you
hey people
sir-lancebot isnt startin on m1 macs
rapidfuzz is causing it to crash
any workarounds ?
i dont even have docker installed on this computer
it was working fine
before
i run poetry run task start everytime
Hey @desert vessel!
Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:
โข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)
โข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:
yikes
File "~/Library/Caches/pypoetry/virtualenvs/sir-lancebot-b_NkKrJV-py3.9/lib/python3.9/site-packages/rapidfuzz/process.py", line 4, in <module>
from rapidfuzz.cpp_process import extract, extractOne, extract_iter
ImportError: dlopen(~/Library/Caches/pypoetry/virtualenvs/sir-lancebot-b_NkKrJV-py3.9/lib/python3.9/site-packages/rapidfuzz/cpp_process.cpython-39-darwin.so, 2): no suitable image found. Did find:
~/Library/Caches/pypoetry/virtualenvs/sir-lancebot-b_NkKrJV-py3.9/lib/python3.9/site-packages/rapidfuzz/cpp_process.cpython-39-darwin.so: mach-o, but wrong architecture
~/Library/Caches/pypoetry/virtualenvs/sir-lancebot-b_NkKrJV-py3.9/lib/python3.9/site-packages/rapidfuzz/cpp_process.cpython-39-darwin.so: mach-o, but wrong architecture
here
you'll need to run docker with x86 arch, since some deps won't work on arm
I know @patent pivot and @vocal wolf were dealing with this recently
Can't remember what the command was
it was working just fine a week back
we recently switched to rapidfuzz from fuzzywuzzy, due to licensing
yeah I think you had to --platform linux/amd64 @desert vessel
eh i think i can do this
alright :D
was that the thing that worked in the end, or was it the env var before the command
I forget
i wonder if it's worth forcing this in the Dockerfile with FROM --platform=linux/amd64 python:3.9-slim
btw, chris im sorry, im still working on the pr, things just broke with rapid fuzz, im running it on docker now
don't be sorry, like I've said before, there's no rush on any of our issues
if something is really an urgent fix, then it would likely be a staff member dealing with it
isnt there like a time limit ?
no time limit no.
If things are taking a while we may reach out to see if you are still planning on working on it
ah alright
Just in case things have changed and you aren't interested
Hmm k
Is there no way to run on host with the M1s?
thoughts on doing this on all our dockerfiles?
for docker run that works, otherwise you need the env var
yea, thought so
Sure, I don't mind. There are no downsides to this, are there?
run on host works yeah, but no wheels are built for M1
So containers fail because no gcc
which is obscure-ish
so you can set docker to emulate amd64
none that I can imagine, just standardises the platform, so we won't have to worry about some not having wheels
oh is that a thing
I'm pro on that
yupper
it works on my machine, but I think we should have someone on arm test it too before merging
im trying ๐
we need to get it to install rapidfuzz
Bascially docker run --rm --privileged multiarch/qemu-user-static:register, except it will only work on AMD64 because ??
yep
Could you edit the first line in the Dockerfile to FROM --platform=linux/amd64 python:3.9-slim and then try docker-compose up --build
sure
its building now
cool
:0
if it works, I'll PR the change to all our repos
sure :D
Did it start fine?
ah yea might take a bit
yee
nothing is cached on my mac
cuz i removed and installed docker just now
docker*
hah I know the feeling, I recently deleted my cache and freed up ~70GB
xD
docker system prune --all --volumes
ON NO
running this every so often now lol
that's fine, if it's hitting that error it means it built just fine
anyway, if you're using docker you shouldn't need to
since real redis exists
cool
merge conflicts smh
i cant commit the same thing and pull the same line
AHHHH screw git
chris, lemme know when you push, i'll have to reclone
:D
Are you on a branch on your fork?
yep
Once this PR is merged, you'll just need to pull from upstream, and then git rebase main while you have your branch checked out
I'm going through all our repos now and PRing this, so might take a minute
alr, that's all the repos I have checkout locally
awesome
Here's your reminder: :thusky:
[Jump back to when you created the reminder](#dev-contrib message)
damn @green oriole, you're making a linked list of reminders
I don't really have an opinion on this tbh, but then I'm not really contributing anything to the bot ๐
What does the "good first issue" label mean? On PRs at least
It's a good issue for those who are new to contributing/haven't contributed to OSS before. It's not overly complex, has well defined scope and requirements, and shouldn't involve in-depth knowledge of the project itself.
Ah alright
@vale ibex Question for you: do you think a mad libs generator would be ok for @dusky shore ?
Doesn't sound like something we'd be against as a concept
I'd suggest writing up an issue describing what you plan to do ๐
Alr, thanks
!remind 9h gotta work on the pr and fix rapidfuzz on m1 macs and good morning future me
Your reminder will arrive on <t:1630807244:F>!
I have a question - how hard is it to add a new dependency?
I want to use bs4 for something
in sir lancebot
you add it to pyproject.toml relock and check if everything works
It's not hard to add a dependency, but judging by my experience with BS4, I'm not sure how that could work with discord.py.
executors
We have BS4 for the python discord bot I think
ah alright, thank you
Anybody else have like 50 sequential Docker Desktop updates?
Is that new to v2 or has it always been like that?
huh, curious how this hasn't been caught then
If only you used a static type checker ๐
I may need help debugging ddg
Hm, ran into this while trying to update the pyproject.toml and after docker-compose build
Would anyone know as to why this is happening?
Did you just add bs4 as a dependency?
what version is fakeredis on?
Yep,
oh that pain, let me get the command
async-rediscache = {extras = ["fakeredis"], version = "~=0.1.4"}
version 0.1.4
aioredis was pinned recently because it had a new major version, and there are some issues with how async-rediscache pins its deps so it may have updated something inadvertently
that's async-rediscache not fakeredis
@desert vessel DOCKER_DEFAULT_PLATFORM=linux/amd64 docker-compose up (and whatever arguments you want afterward, probably --build to force build)
It says fakeredis in the extras though I think, unless I'm interpreting it wrong with what extras mean
[tool.poetry.dependencies]
python = "^3.9"
aiodns = "~=2.0"
arrow = "~=1.1.0"
fuzzywuzzy = "~=0.17"
beautifulsoup4 = "~=4.9"
pillow = "~=8.1"
sentry-sdk = "~=0.19"
PyYAML = "~=5.4"
"discord.py" = "~=1.7.2"
async-rediscache = {extras = ["fakeredis"], version = "~=0.1.4"}
emojis = "~=0.6.0"
matplotlib = "~=3.4.1"
lxml = "~=4.4"
this is the entire part of the dependencies of the pyproject.toml i edited on my fork to add beautifulsoup4 and lxml
oh @vocal wolf feel free to delete my spam above
questionmark?
Yes, but that tells us nothing about what version is actually being used after you relocked; do pip show on the package or look into the lockfile
ah alright
Version 1.6 for fakeredis
^ this Xith
ah your pyproject is fairly outdated, merge master into your branch
I believe it should work fine after you merge and aioredis gets a version constraint
it be gone.
Why does gpl wanna make my life hell
Well I merged and fixed merge conflicts, but turns out that poetry won't like it if you update its lock file since it had a ton of merge conflicts
don't resolve those, just resolve conflicts in the pyproject and relock before commiting the merge
ah alright
@green oriole regarding cowsay, I found a somewhat drop in replacement using the Apache license. Can I use that instead or is it like GPL in that it's incomparable with MIT?
Well I didn't even edit the poetry.lock anymore and it's still telling me it can't read the lock file
I only fixed the merge conflicts in the TOML
Sorry for the ping btw
.randomcase free software is when you can't do anything with it
freE sOFTWARe is WhEn YOu cAN't Do anYTHiNg WITh iT
Lmfao
Feels
Lmao
@vale ibex I think I caught everything, lance is running in my test server if you wanna have at it.
The only commands I haven't rested so far are those that are month locked and those that need an API key
(if anyone else wants to help test the restructure, let me know and I can send over my test server invite link)
You can temporarily remove the month lock
yeah, I'm just a bit lazy atm >_>
Yis
so far:
an entire folder for snakes? what's in there lol
I'd place int e under core
also, should games_fun be renamed to just fun?
Or utilities. What's in utilities?
Nice
Also, can't the avatar stuff and snakes be under fun?
I'm out atm, can test it later tonight or tomorrow if you can push it to github
So snakes is a whole slew of commands. It was from one of the code jams, so was unsure if we wanted to keep it separate
utilities:
avatar_modification has holiday stuff as well as fun stuff, so I wanted to bring it up a level since it is a bit of an odd ext
Yea, I merged a bunch of commands into one cog, so they could share logic
I see
there is sooo much
I'm fine with moving it under fun, was just unsure if we wanted to give it a bit more visibility due to it being the product of a jam
Personally I think placing it under fun is fine
The cog is notoriously under-maintained, so making it stand out doesn't appeal to me
any objection to me adding some READMEs to folders to help explain stuff? Like a README for that cog to explain its history
Ah I see. int e can go under core then yep
Sounds great
I like that idea!
@thorny obsidian I'd consider adding an events ext and placing aoc and hacktoberfest there
What's under trivia?
right now trivia_quiz, but it's also going to house the trivia night idea I want to do
I may move trivia_quiz under fun, we'll see
The trivia night stuff can be another thing to put under events
Basically separate the nice-to-have stuff, the stuff we use to run the bot, and stuff we use to run the community
The lockfile probably got corrupted by git adding the <<< >>> bits; I think you can probably just remove it & relock afresh? On the other hand if it's trying to read the lockfile before a lock maybe its contents affect the resolution somehow ๐คท
well realitically you can either take yours or theirs, and relock, or just delete the lockfile and relock
its not obvious to me how the latter could be worse
ah its prob reading it because of this feature
Worked
Thanks!
awesome
@thorny obsidian If you're not doing it already, I think it might be nice to normalize spaces in file names. For example, these two (in the main branch of the repo) use different styles
Ah yes conflip
That's fine, but I'm not talking about those specific cases, which ones can be put up to whoever's judgement
But there is inconsistency. Like, conversationstarters.py certainly isn't one word
Yeah
Yeah iirc all file names should be lowercase and have underscores in them (correct me if Iโm wrong though)
you are correct
well, they don't need to have underscores in them if it's one word (like math)
mat_h.py
h
@brisk brook what exactly did you mean by your comment on bot#1804?
"Can we just get a comment that the Infraction converter special-cases last as getting the last infraction from the author?"
Where would such a comment go?
Why do you tag your mats by letter
Also for bot#1806 we seem to always use tuples for in checks, as apposed to sets (can only see one case which uses a direct set) -- will add the comment though
Do we have more room in the doc-string?
Otherwise it would fit fine just above the embed I think?
Which docstring?
For the command group
Hmm
I mean it's clear in the converter that last is handled separately
async def infraction_group(self, ctx: Context, infraction: Infraction = None) -> None:
"""
Infraction manipulation commands.
If `infraction` is passed then this command fetches that infraction.
NB: `Infraction` converter supports 'l', 'last' and 'recent' to get most recent infraction made by `ctx.author`.
"""
```something like this? @brisk brook
I usually prefer doc-strings that read like a page
async def infraction_group(self, ctx: Context, infraction: Infraction = None) -> None:
"""
Infraction manipulation commands.
If `infraction` is passed then this command fetches that infraction. The `Infraction` converter also
supports 'l', 'last' and 'recent' to get most recent infraction made by `ctx.author`.
"""
That's gonna be way past the linting 120 chars though
193 to be exact
Ah wait nvm there's a newline there
Think I'll go with```py
"""
Infraction manipulation commands.
If `infraction` is passed then this command fetches that infraction. The `Infraction` converter
supports 'l', 'last' and 'recent' to get the most recent infraction made by `ctx.author`.
"""```
How does that look with the help command now @static canyon?
fine imo
Maybe "'l', 'last' and 'recent'" but that's ott I think
I think that's good yeah
hurm, so troubleshooting something. One of lancebot's commands creates a local image and inserts it into an embed. If the embed gets edited, the image gets duplicated outside of the embed. Is there a way around this while generating the image on the fly and not pre-hosting it somewhere?
sounds like a discord bug, which command is it?
.ddg, it only happens when it's a local image, if you go to edit it it doubles the image. The only way I can find around it is to host the image from the start, which is difficult with this game
this is what it looks like in my test server: #778705917050486835 message
The only thing that changes with that code is the footer of the embed is edited
.src ddg
Here's your reminder: gotta work on the pr and fix rapidfuzz on m1 macs and good morning future me
[Jump back to when you created the reminder](#dev-contrib message)
!remind 12h this, I'll be out today
Your reminder will arrive on <t:1630850581:F>!
my anagrams command uses an api to check if an word exists but is it possible if u guys would ummm download a txt file instead with a lot of words
hey @fervent sage, ive encountered a few problems with quackstack's seeding and component layering, any chance you could take a look at the issues?
krofner do be typin
thats me
hey cat
will do
lol
gives me smth to do
*within reason
dw i wont raid the server to ping you lmao
On another note, .quack is open to PRs!!
reviewa
reviews
oops
you're going to be in for a painful merge commit
should be easy to resolve with a new file
uh oh
why?
I'm in the midst of significantly revamping lance's entire structure.
should be resolved by quackstack#65
ill review now
one thing, you should maybe link those two issues i opened
updated
Looks good!
lol alec beat you to it
ty alec, im heading out for tonight
night
Ty
python/cpython#1
perhaps
It does you just need to specify the owner/org if it's not pydis repos
ah alright
Also I feel like there should be a topic_add command to sirlancebot kind of like how otn adds a name to the possible names, so it isn't that every time that you need to make an issue to add more topics
something like where helpers and higher or moderators and higher are the only ones who can add topics
I'd prefer it go through a PR review. Off-topic names are silly and only channel names. The topics aren't quite that.
Plus I'm not sure how the interface would work for specifying topics for different channels.
Well, with the current state of Lance it's kind of impossible
(no database kind of makes it impossible)
We do have redis on Lance though and with our settings it's persistent enough
Yeah, as Kat says we've got redis
with our configuration in the event of power loss max data loss is 1 second before outage
we fsync to disk every second and use append only storage so the database gets rebuilt
This already happens without the name for a formal proposals system, someone suggests a name to an admin and it gets added, we don't do issues for off topic names since a lot of suggestions were pretty low quality or not appropriate when we use a GitHub discussion publicly
Hey @clever wraith!
It looks like you tried to attach file type(s) that we do not allow (.html). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
Yep, that should work
Does anyone understand what is meant by this comment on sir-lancebot#732? https://github.com/python-discord/sir-lancebot/pull/732#discussion_r631796170
"You should be importing the Cog at runtime to prevent side effects like defining RedisCache instances too early."
The redis cache is connected when the event loop is running (when the bot starts)
But the comment is wrong, it is okay to import the cog like that
Yea, we sometimes put the import statement inside the setup function to avoid side affects, since as creating redis caches before the event loop is running
EG the help channels cog
but since I can't spot anything that would mean we need to do this for this cog
it could be useful to do it for future proofing, but not needed right now afaik
yeah, that's the reason I had put it there and just to keep "package" cogs to be consistent.
So instead of```py
from ... import Cog
def setup(...):
bot.add_cog(Cog(bot))doingpy
def setup(...):
from ... import Cog
bot.add_cog(Cog(bot))```?
Also for adding a requirement to sir-lancebot do I just put it in the Pipfile? I want to add aiohttp -- getting warnings from Pycharm even though it's part of discord.py
yea
we already have aiohttp, as you say it's part of d.py
might be worth double checking what venv pycharm is using
maybe do another poetry install
but for reference, if you want to add a new dep, then you can add it to the pyproject.toml file, and then poetry lock
Thoughts on hanging indent in docstring to indicate it's part of the previous line?```py
"""
API method data.
An API method is immutable (frozen) by design, to avoid editing constant values. However,
the time of when a request was made is used with caching. A mutable protected
attribute can update request info while the other attributes remain immutable.
"""
Yeah, okay
Apparently the fork I'm using doesn't have the pyproject.toml lol
The issue might be that sir-lancebot#732 is very out of date compared to main
you should try and rebase it to origin/main
Ah, it's on a fork
You'll need to get the fork owner to fetch changes from upstream
or you can push this branch to the main repo
I can do that myself I think
Ah cool, what is output by git remote -v
I mean from commandline may be better idk
nah, that'll be fine
Okay
once you've done that, locally you'll need to check out main branch, and do a git pull
then checkout your branch and do git rebase main
the rebase will likely raise conflicts due to the changes in the branch
C:\Users\tizzy\magicandcode-sir-lancebot>git rebase main
error: could not apply 32c85810... Add Last.fm credentials
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 32c85810... Add Last.fm credentials
Auto-merging bot/constants.py
CONFLICT (modify/delete): Pipfile.lock deleted in HEAD and modified in 32c85810... Add Last.fm credentials. Version 32c85810... Add Last.fm credentials of Pipfile.lock left in tree.
CONFLICT (modify/delete): Pipfile deleted in HEAD and modified in 32c85810... Add Last.fm credentials. Version 32c85810... Add Last.fm credentials of Pipfile left in tree.
you should see in pycharm now there are some files showing as having conflicts
It's not showing what those conflicts are though
Pipfile and Pipfile.lock show as having conflicts
the conflicts are the pipfile and pip lock
so yea, just delete those entriely
since we don't use them anymore
then stage those deletes and run git rebase --continue
How do I stage the deletes?
git add <filepath>
Tried doing git add Pipfile but it says file not found (because I deleted)
try git rm Pipfile
C:\Users\tizzy\magicandcode-sir-lancebot>git rm Pipfile
fatal: pathspec 'Pipfile' did not match any files```
Or rm then delete maybe?
git rm will delete
do yea, maybe restore the files and then do git rm
I usually do this part via the vscode gui lol
error: could not apply 339e834e... WIP: Implement async music toplist command
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 339e834e... WIP: Implement async music toplist command
CONFLICT (modify/delete): Pipfile.lock deleted in HEAD and modified in 339e834e... WIP: Implement async music toplist command. Version 339e834e... WIP: Implement async music toplist comma
nd of Pipfile.lock left in tree.
CONFLICT (modify/delete): Pipfile deleted in HEAD and modified in 339e834e... WIP: Implement async music toplist command. Version 339e834e... WIP: Implement async music toplist command of
Pipfile left in tree.
Guess I can just do "Accept Theirs"
yea, that'll work
nice
ty
now poetry install works ๐
It's safe to use list[x] instead of typing.List[x] etc. btw right? @vale ibex
yup
๐
from bot.utils.pagination import ImagePaginator
from . import api, utils```should the `.` import have a blankline before it?
Can you switch to the full path?
oh wait, yea will need the full path
yeah, whatever path it is
Can't do this though
I don't follow
If this is the path, then import from here
Instead of from . import api, utils do from bot.exts.evergreen.music.app import api, utils?
yeah
Consistency
just more uniform with how we write code in the repo
Fair enough
But other than that I agree, I use relative imports everywhere I can. It helps type checkers and easier to follow generally
Is this import order correct? (all import before doing any from)py import asyncio import logging import time from dataclasses import dataclass, field from typing import Any, Optional from urllib.parse import urlencode
Yes
๐
you can configure pycharm to auto sort
or rather just figure out the key binding
the linter is configured for pycharm import sorting
Yeah, I think I have just not done for this fork
from discord.ext.commands import Cog, Context, group
from discord.ext.commands.errors import BadArgument
```should I shorten this to```py
from discord.ext.commands import BadArgument, Cog, Context, group
```?
Yes those are the same I believe
Ah... It's trying to push all the commits from rebasing main. Is that okay? @vale ibex
Yes, it needs to push the rebased commits of they don't exist on the branch you're pushing to
If you didn't change any of the commits from main it's fine
Right
Can I please get some reviews on bot#1798, bot#1804 and bot#1806? All three are ready to be merged, just need the reviews ๐
Could some also review sir-lancebot#843? It looks like 3 people have already been assigned, just haven't gotten to doing the review yet, which is fine. Here is your reminder ig lol. Thanks so much!
i see you have the images in resources but you are using links instead?
Basically you aren't using the images, but I would not like to use links here and images stored in resources rather
Also did you have a look at the pythondiscord style guide?
Also am not sure about top 1000 words, but maybe we can use the dictionary api to get some words of the day or something?
Ah alright
Ah, let me delete those
Most dictionary APIs require an API key
Here's your reminder: this, I'll be out today
[Jump back to when you created the reminder](#dev-contrib message)
Thanks for this, im starting now ๐
:incoming_envelope: :ok_hand: applied mute to @novel yacht until <t:1630851239:f> (9 minutes and 58 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).
@tranquil topaz
oops, sorry
i wanted to report spam
forgot about the auto mute
While running sir-lancebot via docker-compose I'm getting this recurring error, How can I resolve it? Thanks in advance!!
...
sir-lancebot | 09/05/21 14:00:30 - bot.bot INFO: Cog loaded: CoinFlip
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 660, in _load_from_module_spec
sir-lancebot | spec.loader.exec_module(lib) # type: ignore
sir-lancebot | File "<frozen importlib._bootstrap_external>", line 850, in exec_module
sir-lancebot | File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
sir-lancebot | File "/bot/bot/exts/evergreen/color.py", line 5, in <module>
sir-lancebot | import pillow
sir-lancebot | ModuleNotFoundError: No module named 'pillow'
sir-lancebot |
sir-lancebot | The above exception was the direct cause of the following exception:
sir-lancebot |
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
sir-lancebot | return _run_code(code, main_globals, None,
sir-lancebot | File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
sir-lancebot | exec(code, run_globals)
sir-lancebot | File "/bot/bot/__main__.py", line 31, in <module>
sir-lancebot | bot.load_extension(ext)
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 732, in load_extension
sir-lancebot | self._load_from_module_spec(spec, name)
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 663, in _load_from_module_spec
sir-lancebot | raise errors.ExtensionFailed(key, e) from e
sir-lancebot | discord.ext.commands.errors.ExtensionFailed: Extension 'bot.exts.evergreen.color' raised an error: ModuleNotFoundError: No module named 'pillow'
sir-lancebot exited with code 1
did you run docker-compose up --build
no just docker-compose up as in the guide..
FROM python:3.9-slim
# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
POETRY_VIRTUALENVS_CREATE=false
# Install Poetry
RUN pip install --upgrade poetry
WORKDIR /bot
# Copy dependencies and lockfile
COPY pyproject.toml poetry.lock /bot/
# Install dependencies and lockfile, excluding development
# dependencies,
RUN poetry install --no-dev --no-interaction --no-ansi
# Set SHA build argument
ARG git_sha="development"
ENV GIT_SHA=$git_sha
# Copy the rest of the project code
COPY . .
# Start the bot
CMD ["python", "-m", "bot"]
# Define docker persistent volumes
VOLUME /bot/bot/log /bot/data
I have just cloned the project..
oh
Even this one is resulting in the same error...
Should I have to manually go into the container and install it??
so i have a sm0l fix
find a file called pyproject.toml
search the file for pillow
lemme know if it is there
yep it's there
...
arrow = "~=1.1.0"
pillow = "~=8.1"
sentry-sdk = "~=0.19"
...
Have you run poetry install? @elder belfry
It shouldn't be, but worth trying ๐คท
true :D
Umm nope, I will do it now..
this is a silly thing but make sure you are in sir-lancebot directory while running docker-compose up
yes I'm..
And it didn't work๐ ...
Try without docker maybe? poetry run task start
Wdym by "didn't work"?
I mean, i'm getting the module not found error..
FROM --platform=linux/amd64 python:3.9-slim
# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
POETRY_VIRTUALENVS_CREATE=false
# Install Poetry
RUN pip install --upgrade poetry
WORKDIR /bot
# Copy dependencies and lockfile
COPY pyproject.toml poetry.lock /bot/
# Install dependencies and lockfile, excluding development
# dependencies,
RUN poetry install --no-dev --no-interaction --no-ansi
RUN pip install pillow
# Set SHA build argument
ARG git_sha="development"
ENV GIT_SHA=$git_sha
# Copy the rest of the project code
COPY . .
# Start the bot
CMD ["python", "-m", "bot"]
# Define docker persistent volumes
VOLUME /bot/bot/log /bot/data
Can you copy this
to your docker file
Did the poetry install work though?
and run it again?
yeah it worked
try this tho, its a very straightforward fix
or so i think
Pillow
Do you have any changes in any files? The container on main is fine and doing hacks won't help if the issue is elsewhere (and can't be pushed anyway)
its pillow?
yyeah
my bad
No it's not...
pip doesn't care about case
y- yeah
oh, fair enough
so the color file is raising this error, have you modified this file by chance ?
yeah I'm working on something which is not in the main
oh hmmm
Do you have that pushed somewhere?
^ for reference ?
Umm don't delete those, but use them instead of the links IMO
That wouldnโt work because local files means I have to use the send command every time
I tried it earlier but it looks really ugly
Editing is much smoother than having to delete and post the file everytime
Cool, lemme see whats up with that
oh wait
its PIL
not pillow i believe
import PIL
i have an m1 mac, so i cant test locally cuz of rapidfuzz :(
Ahh yeah, i totally forget it
tysm ๐
of course! i love helping :D
@elder belfry you might wanna fix this
i have to go in 5 mins :(
ping me for anything
yes I will look into it
i can stay up after i come back and help you fix these errors
if you're not through them
i'll be on phone, so ping me if you need me :D
yeah I will
@elder belfry can you tell me how to use the command
i may have fixed the whole thing
.colour #000000
that isnt working
ahh actually I'm not the one who has written that file, so I don't know yet..
in my server
oh right
Hey @desert vessel!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
yeah I think it's not finished yet, it's just a layout..
And moving that file to somewhere else has just fixed the issue..
@elder belfry screw it, here is the fixed version : https://paste.pythondiscord.com/ixasirikat.py
awesome!
thank you so much ๐ ๐ I will look into it
<3
remember to change the aias
alias*
i kept it as bruv
cuz nothing else came to my mind
alright, cya
i gtg
Tysm
Hey @timid sentinel , thanks for the review. I'll get to it as soon as possible. Unfortunately I'm offline so that might not be until tomorrow
No rush at all, the next day is still a pretty fast response to a review ๐
There's no rush with PRs and reviews for non critical code, larger prs can sit around for a few weeks
Okay good, ty ๐
Soon โข๏ธ I'm going to push and open a PR for the lance restructure
@timid sentinel ive decided to manually append the seed to the request url as if i dont the command errors if a seed isn't given, and i dont want to have to set a specific seed
tfw you forget to run poetry run pre-commit install
You can write it to only pass in the seed as a param if you want to set it, something like this
wow im stupid
Not stupid 
The PR has been created
actually, I've spotted a few more places @thorny obsidian, give me a few minutes and I'll update the comment
alr, that should be it
@vale ibex fixed! thanks for catching that
uh oh fiery elmo
huh
would be nice to have merged with .quack
@clever wraith we're not doing CLI on quack-stack
alright
not at the current moment anyway
we'll get a nice API together, integrate lancebot and then anyone can use the public API with a CLI and w/e
@fervent sage where did you land for S3?
eh ill make an unnoficial one then for fun
i kinda made half of one yesterday 
Haven't had much of chance to implement it, been mostly in london with you or asleep 
lol this is true
joeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee, can you add the new non-staff contribs to the review policy thing pls?
i already did it ๐
hmmmm why is D0rs4n's approval not a green checkmark then
which pr?
sir-lancebot#851
The policy-bot took my review in account.
wouldn't they need to be a member for that
it's counting Chris's for core dev & staff, but not yours
we have a way to count non-member's review with policy bot
yeah I'm just thinking of the checkmark on the GUI
I thought 1/2 approvals required meant that I was okay.
.github#5
1 is from me, since you are a contrib, you'd count as the second
but policy bot is case sensitive
Oh, I thought you only count as core-dev, and not the both of them.
Oh, okay. I see ๐


hey ...
hey @vocal wolf
... you should uhhhhhhhhh
review that lance PR :3c
:3c
now that's a lot of damage
how tf do we have so many files in sir lance?
I'm guessing a lot are resource files
snakes. resources. so many games.
SO. MANY. GAMES.
did you know we have a gamerec command?
.gamrec
so what you're saying is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHH
.gamerec
It loops through the same 4 games
lmao
.gamerec
@clever wraith oi m8 what's going to happen to this PR? sir-lancebot#699
!pypi cowpy is our replacement
im gonna get on it soon
Only people part of the organization and considered "maintainers" or "contributors" (not sure what the official term is for GitHub) will get a green checkmark
thanks
nah, it was just cause our review bot policy is case sensitive
Chris has a PR to fix it
I am talking about this
The thing that I cared about was why it wasn't counting here and turning this green:
yeaaaaah, this is the part I care about
what does it conflict with? I pulled it yesterday and there haven't been any merges since
no conflict, but it will need to be updated
I merged a PR to the Dockerfile yesterday
I've done that now
I used to be able to merge
all the opens one conflict with the type annotations PR anyhow
this is just... like an order of magnitude worse
Def not with lance, I think it's still being evaluated for python
hey guys, does anyone know where's the logic for whitelist overrides on lancy? all i found so far is whitelist_override, in_whitelist_check, and whitelist_check, but i'm wondering if there's more
the structure is a little confusing lol, i'm trying to make .bm available for everyone everywhere
heeeey @vale ibex and/or @vocal wolf it miiight be worth making a dev announcement about this since it's a substantial change for existing contribs?
Lovely time to fix my .quack pr
yeah that's a good idea, I'll do it after staff meeting.
I think I have some co-authored commits into both bots
uhhhhhhh i just tried to pull main and no dice
@thorny obsidian welp I guess the restructure is done
oh im dumb i needed to pull upstream
woohoo merged the restructure
also
if you have time please look at sir-lancebot#849
Yass
@thorny obsidian do you have that list of labels that you suggested for @dusky shore's repo?
rip didn't get pinged on the dev announcements ๐
I might've spotted something. It seems like cogs under the folder events are not loaded in.
(It worked before merging the restructure <#sir-lancebot-playground message>)
Looks like it's missing the an init with a setup entrypoint
There's also a missed old import in the aoc helpers file
Yeah, spotted that as well. I was gonna fix it in my next PR there's a missing .event
I think I'll open an issue for that, just for the sake of consistency.
What's missing a .event?
Lol merged that suggestion and now I get an EOF error
Import in the aoc helper file
wouldn't that, yknow, been caught just by nature of running the bot?
It should be โexts.event.[โฆ]โ
Gonna abuse the fact that staff meeting is happening an push for reviews
Yay
The PR I made has just been waiting for reviews but it's been two to three days since I put the PR up so I'm fine waiting since it's only been a few days
@vale ibex a review for a review ๐ฅบ
https://github.com/python-discord/quackstack/pull/65
I've been trying really hard to get you reviews lol
Ty :P
Lol it didn't count
The shit
Your review didn't trigger policy bot
Yeah
Idk
We recently added django_prometheus to the site repo. This now causes the site to fail to build during local dev for bot, since it relies on metricity db to exist.
This is because the bot repo pulls site from site:latest on ghcr, so it doesn't run the init.sql file to create metricity relations
I'm thinking we copy the init file into the bot repo and add a volume to postgres via the dockercompose file.
this seems like the easiest solution, since changes to this init file are unlikely to happen. any thoughts on better solutions?
Wait why aren't the SQL queries ran?
Migrations are done by the site
but the init for metricity aren't in django migrations
Can't we add it? I feel like that should be a migration?
I'm not too familiar with django migrations, metricity isn't a django model
Why does the site work if it doesn't run the metricity queries?
we don't want it in the site image, since we want it in the postgres image
we could have the site do the migration, but we'd need to make sure it doesn't run in prod
@vale ibex why don't we make the site run the script itself if it starts in dev mode rather than psql, so we don't have to deal with keeping the file up to date in two repos
we already have an if self.debug in the site manager init
I'll take a look at doing that
I had a bad experience with prod even vars, so if we can avoid it, uuuh, that'd be nice 
https://github.com/python-discord/sir-lancebot/pull/850 needs revivew. Smol PR.
I typed all those out manually.
no clipboard used besides file names
lol
well it had to be done
I want that to be controlled by the debug env var but I'm not logged into github 
lol, I'm sure it can wait until tomorrow
Sure, if you can fix it
It is an internal discord bug iirc
@brisk brook Did you happen to test what happens if the moderator had no previous infractions?
Context: https://github.com/python-discord/bot/pull/1804#pullrequestreview-746602907
Nevermind, I forgot that I pruned all docker stuff recently so I have a clean database. We're good, it works.

hol up why does it rely on that
discord problem
my code works, theirs doesn't
it works in comments, but not PR approvals
lol, nah, it is indeed broken
no idea
I have a fix
@staticmethod
def run_metricity_init() -> None:
"""
Initilise metricity when running in debug mode.
This is done at run time, since other projects (Like Python bot)
rely on the site initilising it's on db, rather than relying on
an init.sql volume.
"""
import psycopg2
# The database URL has already been validated in `wait_for_postgres()`
conn = psycopg2.connect(database_url=os.environ["DATABASE_URL"])
conn.autocommit = True
with conn as cursor:
cursor.execute(open("postgres/init.sql").read())
lovely
hmmmm, does this mean we need to update bot & site if we change that
this is in site
once I commit any new images will have it
bot/converters.py lines 564 to 569
if not infractions:
raise BadArgument(
"Couldn't find most recent infraction; you have never given an infraction."
)
else:
return infractions[0]```
good programmer with a good idea, that's what I like to see
Raises BadArgument yeah
I just need to update the init.sql to make sure it only runs if there isn't any data already
Thanks! 
๐
i was going to use self.prepare_server() to do this, but this check means it doesn't run when in debug mode. Does anyone with mroe django knowledge than I know if it's safe to remove this check now?
https://github.com/python-discord/site/blob/main/manage.py#L159-L161
manage.py lines 159 to 161
# Prevent preparing twice when in dev mode due to reloader
if not self.debug or in_reloader:
self.prepare_server()```
I can understand not running it when reloading, but nto sure about the debug part
Technically two devs. Or I am Chris alt. Or Chris talked about it and I am blind.
in that ccase two excellent minds
but ultimatley
both are part of the devops hive mind
heard of docker swarm? yeah that's my devops team.
docker swarm do-my-work
Eh we wont be reloading outside of dev so this p much redundant
Haha the devops swarm
I'm gonna do this and people can complain in PR if they want
It was both back in March
Huh, we didn't transfer crispy to lemon, didn't know that
scale
my position in python discord is chief thought leader
i'm like julian assange but ethical
technically the truth
smart config
With the number of pods you murdered you aren't very ethical sir
this is true
it's a config that is smart
Look at the PR
an idea to try simplify config on all our bots โ I think we had some level of plans with bootrapping certain things but I forget
The PR
We like smart things 
We never got any project lead for that one lol
I may pick it up later on, yeah
Mark contributed as much as I did tbh
If not more
The infra cost nothing lol
yea
if we paid, cloudflare is $20/mo, Linode would be around $2000/yr, domains are around $36/yr (all 4 combined, we recently transferred to Cloudflare & enabled DNSSEC)
uhhhh
Sentry would be a few hundred
DNSSEC has been enabled since January, just not on a registrar that had the records, lol
Notion would be a few hundred too
Github would be pricy if we had an actual team plan, not the open source one
Actually don't we have team pro since we have a special status or something
ah yeah that too
sponsorships
we have a lot of good relations with these companies
Plus we have Joe
Who not only has the number of bojo but also biden's
The linode support are good people
Linode are great โ always lovely to chat to about sponsorships & really helpful with any problems too
I think I put one of the support interactions on a public postmortem a while ago
On the disk going zoom, yeah
That was a fun outage
How many days without an incident are we at
What happened again?
i don't think we've had anything quite as significant ssince
django connection surge
Was that the disk one
yeah
it knocked a node into unresponsive
but didn't let the volumes unmount healthily
Right
so I had to do some debugging with linode API and even mounting to a temporary VM and doing fsck.ext4
lol
Kind of works?
I am still waiting on my cloudflare swag
I hope it will include socks
What did you get it for?
do not understand lol
ok lol, it was much more complicated than this
Hahaha
gonna push in a sec, just writing a commit message
you can enjoy my pain
site#583 ๐
Yea, postgres doesn't have CREATE DATABASE IF NOT EXISTS
I'm going to bed now though, so feel free to roast my changes
oh lol, even CI is complaining that metricity doesn't exist
not sure how we feel about running that in debug mode tho
that push should fix it
Almost
Hmm no
The CI is failing here as CI doesn't have metricity either, and django-prometheus now requires it as part of django.setup()
We have two options here, either we can run this new run_metricity_init() func during CI, or we can always run it.
Running it in CI makes the most sense, as it's lower risk
Agreed
I think it does make sense here
We want the CI env to be as close as possible to the prod env
alr lets see if this does it
wait, no
copy-paste error
I noticed before CI failed, so it doesn't count
well how should that work, when you need the database to make the connection to begin with 
you run it while connected to another db
sounds like an extra step to me
its not like you expect a create postgres server if not exists 
ahh right I see the issue, in CI we only do migrations, rather than running
so this code never hits
I mean.. that's kind of what k8s is here for
fair ig
hmmm, not too sure what to do here
but fails on python manage.py migrate since it needs metricity
and we only run our custom logic when running, rather than migrating
I need to head to bed now anyway, so feel free to leave suggestions in the PR
What does this mean? aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host discord.com:443 ssl:default [No address associated with hostname], this occurs if I keep my fork running for a while wihtout closing it
Big Programming languages are coming to steal your freedom! They are becoming higher level by the minute!!! They are lying to the people by not telling us whatโs going on and abstracting stuff!!!! I NEED TO SEE RAw pointers FOR MY FREEDOM โฆโฆ RETURN TO COBOL And THEY HIDE WHAT EVERYTHING MEANS BEHIND โDOCUMENTATIONโ WHO READS IT??? ITS LIKE THE TOS
@trail pilot explain
Fork of what?
hey @brisk brook what did you mean by a converter
It was sarcasm and I think this is the wrong chat lmao
sir lancebot fork
so since you'll just be sticking to discord.py 2, context menus will not be used on this server, isn't it?
Discord.py converter
sometimes this is just file renames, merging with CLI is generally fairly alright, but GitHub web editor can't pick up file renames
When I was restructuring kube repo I got that a lot but when I ran git merge main it actually figured out the renames even if I'd modified the content
I figured out how to fix site#583
agreed
Upgrading to dpy 2 is just a way to get some of the new features such as threads and buttons.
But we're not planning on sticking with dpy forever, as it will gradually become more and more out of date. But we are sticking with it in the near future.
If we ever want something that we can't get with dpy, we might look elsewhere, depending on how much we want it.
tl;dr: the bot development ecosystem in Python is a bit hectic right now, we're not in a rush.
because this small change only really needs 1 commit
probably should have kept them separate and then squashed, but oh well
@timid sentinel Was looking at the talentpool comment you left. I was thinking of removing the refresh cache from reschedule_reviews entirely and doing it on init
we already refresh the cache whenever someone is added or removed from the pool too, so I don't think it's needed in there
@vale ibex yeah that sounds good
I typed https://git.pydis.com/seasonalbot in my browser and took a good second to realize it wasn't right
Actually the link works, oh well
rip SeasonalBot 2021
alright done. I also migrated the tasks to @brazen charm's scheduling.create_task() util, since it adds a callback to log errors
Man, when I woke up today I was really like "What a nice day! I am so excited to replace 51 avatar_url by avatar.url"
so much fun
why such a silly breaking change
lol
rebuilding bot is such a pain atm
since I need to manually migrate metricity each time I rebuild site lol
lancebot isn't too bad nice easy setup
bot is a bit harder since you need to setup all the channels, emojis and webhooks
47 passed, 210 errors in 8.60s
oh that's fun
they removed default arguments for context.bot and context.view ;-;
I will actually cry
lmfao
Finally free enough to boot back to Linux. Re: sir-lancebot#785, how should I resolve the file conflict? Pull down the new tree, re-fix and force-push?
you can start merging, move the file and then commit the merge; or rewriting the commit with a force pusha lso works
Isn't force-pushing kinda frowned upon? I don't know the exact details as I only saw the practice mentioned in memes with a general negative remark
What are the stats for usage of the tag content search commands?
force pushing to public branches is bad, since it messes with people's local copies, force pushing branches is fine as long as other people working on the branch (if any) are told
and there's only me on my branch, that should be good?
yupyup
it's force-pushing time
wdym by tag searching?
the tag search command
It is looking a bit better, I guess
ยป decorators
ยป microsoft-build-tools
ยป modmail
ยป repl
ยป seek
ยป star-imports
ยป windows-path
What's on the y axis?
default output from graphite
IE I have no idea
maybe @patent pivot can give us a cool function to make this make sense?
I was thinking or removing it if it had no uses as it's around 80 lines to maintain but if it's used occasionally it's fine to keep
@vale ibex change stats for stats_counts
there's a template pinned here, not sure how up to date it is
search for discord.new in this channel
you can just create a couple of channels and roles and set multiple keys to those
it is from the d.py source code
how they map external data to internal resources
erm
to give all permissions in guild, but not be picked up by the bot
IE, a superuser has full access to the server, but is still treated as a normal user as far as the bot is concerned
so you can test filters as an example
just tryinm to get 50 messages
?
I am really curious how d.py managed to change their HSV calculation between the two versions
Did they change it more than adding the optional seed for the random colour?
apparently, the test for the role embed is failing
Wat
That's because they change the Blurple colors?
The green tick when approving is only for users in the org
yea, thats it ๐
wasn't too bad to setup
I guess u need to choose option 1
not a single clue 
I personally use RSA/RSA
do you have a key in ~/.gnupg
also
[discord-2.0 2fbe252d] Migrate to Discord.py 2.0a0
28 files changed, 174 insertions(+), 139 deletions(-)
how to solve this error
Hey @umbral rose, please have a look at #โ๏ฝhow-to-get-help
64 is like nothing
yeah rust or node is significantly more lol
it inserts the values from the restart policy
if y'all could have a shot at https://github.com/python-discord/bot/pull/1815 , I would really really really appreciate it. Beside it is our last blocker at starting to use threads publicly 
Since the Discord.py repository has been archived, we can switch to the latest commit of 2.0a0, knowing no breaking change will occur (still pinned to the commit just in case).
This PR fixes any pr...
anything
just has to be set
I think it's on by default
I think it has to be "true"
debug = environ.get("BOT_DEBUG", "true").lower() == "true"
I might be wrong, though.
the second value in the get is the default, so if not set will default to on
I mean, a lot of those things were already under evergreen, so they were never technically seasons
If you have a better term, you can PR it
Hmmm, I see
bot/bot.py line 40
self.loop.create_task(self.send_log(self.name, "Connected!"))```


