#dev-contrib
1 messages Β· Page 8 of 1
lol
how ironic
tests pass, lint passes, bot interacts with the new image fine
PR lgtm
@patent pivot does site sentry not have the github repo linked? https://sentry.io/organizations/python-discord/issues/3523106713/?project=2714379&referrer=slack
Alright, seems like a harmless enough timeout from the github api on a low volume request, so likely not a rate limit
We just need to like increase the timeout period
That's from the netlify side, which is not what timed out
It's the internal request on the site to GitHub, which is at 5
I think that's seconds
It's most likely just a temporary failure though
Network hiccup
not sure if you can see this page, but it is https://sentry.io/settings/python-discord/integrations/github/52311/
Ah, there wasn't a code mapping
added that now
also updated @stable mountain and @dusky shore code mappings to use main instead of master
pydis_site/apps/api/github_utils.py line 176
runs = client.get(f"/repos/{owner}/{repo}/actions/runs", params={"per_page": 100})```
Now it's a question of whether we just dismiss it as a temporary error and ignore it, or if we increase the timeout
For reference, that timeout is only used in two places
All parts of that github request chain for static builds
And showing the github repos on the homepage (cached)
looks like it's currently set to TIMEOUT_PERIOD env var, but I can't see where we set that
or even where the default is set
pydis_site/settings.py line 30
TIMEOUT_PERIOD=(int, 5),```
It can also be set as an env var
ahhh
we should probably decouple the static preview from that number
as that number is also used in other places, that we don't want to extend
Well, it's not used in static previews, that route is on the prod version for that API route
Though theoretically timing out that request would not impact anyone other than API users
For which there should only be netlify (and anyone trying to be sneaky)
Seems fine then
Btw, I retried and it passed
https://app.netlify.com/sites/pydis-static/deploys/6337315b19edaf006c2cb206
Alright I'll just kaizen this into my PR
What is a reasonable timeout
Yes
Thats the only place its used
But I won't change that
Just add a separate timeout for this route
I have absolute faith in your changeset scalios
4 words every developer wants to hear
hates to hear*
if someone else merges it and it breaks at least you can blame it on them
My PRs don't break, morged
π§
@vale ibex for you
https://github.com/python-discord/site/pull/774
Also #dev-alerts lol
site#774
Thanks man, will merge right away
@vale ibex I've updated bot#2283, would be great to have a look whenever you can.
Thanks!
i think .hangman is broken?
last week #dev-alerts message
also fyi interactions fail on .epoch #dev-alerts message
Yeah, looks like it
Last worked end of August from the looks of it
.src hangman
Looks like the commit making the setup async broke it for some reason
Which doesn't really make sense but :shrug:
@vale ibex any ideas?
First stop will be grafana for a traceback
Can't check myself right now
4 new issues in lance from sentry reports
2 seem to be from d.py 2.0 breaking changes, other 2 seem like pre existing problems
Good spot; there was a positional-only argument being passed as a kwarg. Fixed in sir-lancebot#1110
Cool cool, the exact same problem is in the madlibs cog too, on line 96, could you remove it there too?
Fixed π
Thanks :D
that made me curious and I ran pyright on the repo
it found 715 errors 
Lance?
We are very lenient with typing
It contributes a large portion of the issues
yeah, lance
Does pyright raise issues for non-generic type hints?
Like using list instead of collection
that would depend on the Python version, right?
Hm, tbf I haven't tried it on 3.9+, but I remember it's something mypy would always complain about
Was that removed, I can no longer get that error, even on earlier python versions
Now also have sir-lancebot#1111 as a minor bug-fix
Thanks for the reviews @timid sentinel 
If you've got time, would appreciate some reviews on my other two (slightly more complex) PRs:
- bot-core#137 (is blocking sir-lancebot#1062)
- bot#2089 (has been waiting on review for couple of months now
)
Hello Chris I'll approve #2267 tomorrow
Hello @vale ibex
re: https://github.com/python-discord/code-jam-management/issues/21#issuecomment-1264725668
Can I create an issue on.... meta? And create individual [per-repo] PRs from that?
Or would individual [per-repo] issues be required for each repo?
probably just make a tracking issue on the k8s repo would be easiest
Which has a checklist of repos to be actioned, which we can check off as they're fixed
Hmm
https://cs.github.com/?scope=org%3Apython-discord&scopeName=python-discord&q=secrets.REPO_TOKEN shows four more matches then
https://sourcegraph.com/search?q=context:global+repo:python-discord/*+secrets.REPO_TOKEN+archived:yes+&patternType=standard
Oh - because they're private repos
Can I put the name of private repos in a public issue?
yea, those are fine
As requested - kubernetes#140
Will take a look when I get a chance, although I'll be pretty busy over the next week or two so it's possible someone else will get there before me.
No worries, it's nice to have a backup π
If anyone has 30 seconds to review this, it would be great.
bot#2284
Someone in pygen keeps rerolling the .topic command rapidly, and it's kind of obnoxious. can we set a minimum duration between rerolls?
can you open an issue?
are you suggesting that I do work?
wow.
I guess that's fine.
sorry π
@waxen notch Hello, I have removed your post. We do not allow unapproved advertising in the server, and this channel is intended for discussions about Python Discord's projects, not any project in general.
Ok, I'm sorry :/
hey any update on sir-lancebot#1098
You still haven't explained what this is useful for π
Is there any plans to convert commands to slash commands?
I dont believe we have any plans for that, no
is there any chance eval output could be allowed in pygen? or at least stop the bot from deleting the message? itβs really annoying trying to give examples or debug something when the bot is deleting the message and/or you have to go to another channel to see the output
if spam is your worry it shouldnβt be all that hard to have a cooldown and line limit right?
I was just about to say you should make an issue / post here. It's a pretty good idea
Hello @glass pecan,
Could you help review bot#2283 please ?
Or any other <@&295488872404484098> review would be appreciated.
Thanks !
There already is an issue for @stable mountain for that
I see bot#2264 but I think it's different from allowing members to run eval in #python-discussion , with a line limit
Hold on, I didn't?.
Let me quickly go and edit ti
Anyways it's just a fun command like
like .anagram and etc...
Done
I was directed here to share a screenshot. I'm not familiar with your discord bot, but just tested the "I run code" bot in my test server. It works in forum posts (as shown in first screenshot)... Your bot may need additional scope or permissions. Anyway, this server would be much cleaner and more user friendly if you move to the forum channels (in my opinion). Also attached a screenshot to show how we use them (although my server is not near as popular as this one).
we are aware of forum channels and are planning to use them. However, our test server is yet to get access to them, so we can not do any development on them until then.
let's test in production 
Also, the bot currently does much more than just running a python code evaluator with the help system setup
I think you can get access to them by setting your test server as a community server but I'm not sure
It is a community server, we've just not been hit by the rollout yet
Oh
Is there a way to get a URL's path? like in https://google.com/hi it would be "hi". tldextract doesn't deal with that, urllib is annoying, and I'd rather not resort to regex
Does urllib.parse.urlparse(url).path not work as you'd want?
It does weird things if I don't specify the scheme, and if it ends with a / the path will be / instead of being empty. I can handle both edgecases, but was wondering if there's something more robust, because there can be more edges cases as far as I know
Is it not just urlparse().path?
>>> from urllib.parse import urlparse
>>>urlparse("http://docs.python.org:80/3/library/urllib.parse.html?"
... "highlight=params#url-parsing")
ParseResult(scheme='http', netloc='docs.python.org:80',
path='/3/library/urllib.parse.html', params='',
query='highlight=params', fragment='url-parsing')
https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlparse
^
>>> from yarl import URL
>>> URL("https://google.com/hi").path
'/hi'
>>> URL("https://google.com/hi/").path
'/hi/'
What happens with google.com and google.com/?
>>> URL("google.com").path
'google.com'
>>> URL("google.com/").path
'google.com/'
π₯΄
yyyep
I made do with urllib, just manually added the scheme
and stripped any slashes
makes sense
do i just proceed with implementing this and creating a PR or do i have to be assigned to do this
You have to wait for it to get approval first π
Once it has approval, you can comment on it saying you'd like to implement, at which point you can be assigned (if it's something that can be done by non-staff / non core-devs), and then you can implement
In fact, in this specific case, since it's your PR and you've indicated that you want to implement it yourself, you just need to wait for approval
Tl;Dr; wait for approval, then implement & PR
@covert fog
ok
:incoming_envelope: :ok_hand: applied mute to @crimson harbor until <t:1665112758:f> (10 minutes) (reason: duplicates rule: sent 4 duplicated messages in 10s).
The <@&831776746206265384> have been alerted for review.
that's a new one
=about
what's your modmail version?
I assume it isn't the latest one
This is a known wont-fix issue with poetry 1.2 that weβve mitigated on our other repos by
Migrating to https://github.com/HassanAbouelela/actions
Just missed this repo
The error is here fwiw
ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations
@green oriole it has been fixed, just go ahead and update your PR
pulled
CI passed π
FWIW we're not on the new release of modmail just yet
https://github.com/python-discord/modmail is our fork, where the deployment branch is what's running in prod, with CD setup
nah, I just pulled the upstream branches
didn't touch deployment
I deleted my fork because I cba to fix it when they finally picked it up
right
yea it closed automatically, since I deleted my fork
you should update, the new 2.0 interface is more pleasant to work with
it seems kyber is the only one with dockerhub access, so it didn't go anywhere
Yea, we should migrate at some point
it's just updating modmail and then making sure plugins work
could you recover your repository?
I dont want to :)
yea it should be fine
just making loading async
and just check if any internal things we rely on have changed
I'm mildly annoyed they broke all the plugins
it wouldn't have been that hard to provide compatibility
eh it's non-zero effort so why not push it off to 3rd party plugin creators :P
but yea, if you're making a plugin system, you should provide a solid api
and if you make breaking changes provide some sort of migration guide
@cold island was that actually supposed to go in dev-announcements or just in here?
I'm announcing it π
@cold island i know you're currently working on filters, have you seen bot#2266?
I was thinking that filters might have a human readable name ( if they don't already) and upon triggering a filter, we can use that as the Embed's title
Uuh yes we talked about them just today. My branch already handles this one yep
Alright, thanks!
Sneak peak (110 is the filter ID)
Byoutifulle!
@vale ibex I didn't even know you had https://github.com/python-discord/site/pull/744
Is the info still up to date?
Yea, still correct
fwiw there's info on metricity in the guide, just in a separate section
Is it possible to skip tests if only markdown files were changed?
Yea, you can add a paths-ignore section to the trigger
something like ```yml
paths-ignore:
- '**.md'
did your force push remove the merge from main?
Yea, I rebased onto main
ah
I wanted to squash the removal of the metricity part
but I couldn't do that if there was a merge main commit there
Any updates?
sir-lancebot#1098
Re: #dev-announcements message
We reviewed a long time ago, should we review again?
It's currently a draft pending a conclusion on what regex to use, so if you have any thoughts on that feel free to say
I do wonder if the first part is long enough for the new ID length
yeah it is
don't mind me #dev-contrib message
oh yeah that was that time
hm'kay
left a comment
DevOps question: is snekbox not running in UTC?
Hi, this channel is about our server's projects, not anyone's. Also we don't allow offering pay here.
The cluster is in UTC, so the webserver is as well, and Iβd have to assume that the jail would be too. Could test that last part using eval
!e import datetime; print(datetime.datetime.now());
@vale ibex :white_check_mark: Your 3.11 eval job has completed with return code 0.
2022-10-10 08:35:13.313321
yea, utc it seems
oh yea sorry, I forgot one
Thank you
Updated
How weird
Question/idea. A semi-frequent problem is simulating input() in help channels. And while sometimes there are workarounds; it might be nice to add a sort of nomenclature to allow users to specify strings for input.
Something like:
((My input string))
data = input()
print(data)
On the back end we could parse out "my input string" and override the input() function to make it return the given string.
Any appetite for something like that?
I was looking at the bot layout the other night but couldn't quite find where the code is processed. I got up to the comment #this works just ignore it
I don't think its really feasible without modifying stdin/stdout while providing no value,
You can just replace input() directly with the string and that'd work just finr
Well it wouldn't be indifferent to how some browser based interpreters take stdin. And its purpose would primarily be for the help channels for demonstrating input to learners
I've seen many instances where it would be useful.
I'd argue it'd be rather misleading since you already are hardcoding the string into the code which isn't something that'd occur in actual program (ignoring that the example would return a Syntax Error).
While showing an example is good, I think in that case its better to explain to user what the input is and instruct them on how to use it
Just replacing input() with a predefined string and explaining that to user would be helpful
Of course another suggestion would be to accept input as a discord message, however our NsJail setup has time limit so it'd expire prior to getting said input most likely
it's all sent to the snekbox api, see https://git.pydis.com/snekbox
that wouldn't work with the snekbox model, given each !eval is a single web request to the api
Yeah am just discussing what others have suggested before
That could be adjusted but timelimit still exists
Am not sure how NsJail works fully but I doesnt seem that you can dynamically change the max execution time depending on the context without losing the protection that it offers
I could be wrong of course so feel free to correct me
Just replacing input() with a predefined string and explaining that to user would be helpful
I share this sentiment.
Yeah interrupted execution would require a lot of work on snekboxβs side
any updates on sir-lancebot#1116?
assigned
oh
thanks
Hey guys, been working on sir-lancebot#1060, and I'm going to work on this after a long time (exams :/), and I don't know for some reason the bot (on my test server) is not responding. (It shows, it's online and even sends the Connected! text #dev-log ). Could anyone point me in some direction so that I can get the bot running?
I use this command to start my bot:
docker-compose up --build
And I have the following fields in my .env
BOT_TOKEN=--------------------------
BOT_GUILD=884065843321925713
BOT_ADMIN_ROLE_ID=884072561724497953
ROLE_HELPERS=884073931168948234
CHANNEL_ANNOUNCEMENTS=884072300897521694
CHANNEL_DEVLOG=884072344488935504
CHANNEL_COMMUNITY_BOT_COMMANDS=884072410209456168
TMDB_API_KEY=--------------------------
TRASHCAN_EMOJI=π½
Did you enable message intent?
I don't know, could you tell me how can I find if I've enabled it?
enter the developer portal and see what's enabled for your bot
ok one sec..
I didn't, should I enable it?
yeah
Tq it works π
lol
was the k8s repo recently made public?
I feel like that's quite old, isn't it
nope, it was public before I was even in devops :P
Does anyone have time for a review? https://github.com/python-discord/bot/pull/2287
Why did the pfp of the Github webhook in #dev-log change? #dev-log message
Probably just discord pulling a discord and breaking stuff 'cause discord is not discord without its "99 errors per minute" quota
!otn a discord-stop-with-the-errors
@dim pelican re sir-lancebot#1125 it'd be nice to also add og_blurple since that's what pydis uses (if it's not already a thing)
Oh good idea, what's the hex value?
I actually just walked away from my computer lol
This animation shows the old value but I'm on phone and it goes too fast for me to read it 
7289DA
.color hex 7289DA
Hello folks,
bot#2283 needs some love from contributors
I added it as OG Blurple, and I'm not sure what it will do with the fuzzy matching for the two color names
Yeah, fair enough
I'm quite busy today but if I'll remember I'll review it tonight
!remind 4h Am I free?
Your reminder will arrive on <t:1666026782:F>!
!remind edit duration 5293 5h
That reminder has been edited successfully!
Here's your reminder: Am I free?
[Jump back to when you created the reminder](#dev-contrib message)
I don't get it, where's the blanket noqa?
Missed :ΒΏ
tnx
Thanks for the review!
I've noticed that the .colour command doesn't use the name lookup json for hsv/hsl/cmyk (works for name/rgb/hex). Is this intentional?
The name lookup is based on the hex code, and I think based on the rounding / conversion from the different bases it can change the hex value
Hmm, I see
It's a tricky one
Is that something we want to address? Maybe look for a similar hex code?
Depends how far off it is I guess
Or we change the json structure
I have no idea how I'd start to tackle it to be fair
At one point I think someone mentioned having a named colorspace of coordinates, and then choosing the closest named point to default to, but there are issues with that too
HSV to HEX of 235, 63, 95 gives #5A66F2, which is what's stored?
So not sure what you mean
What tool are you using to convert?
From what I remember it was all done manually
I get 5a66f2, not 5865f2
Oh right, 5865f2 is what's stored π€¦
Now I understand lol
So yeah, we'd want to either change the json structure to include a hsv/hsl/cymk lookup, or allow for close matches (if we do anything)
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/opt/poetry/cache/virtualenvs/sir-lancebot-TFcQMFAJ-py3.10/lib/python3.10/site-packages/discord/ext/commands/bot.py", line 934, in _load_from_module_spec
sir-lancebot | spec.loader.exec_module(lib) # type: ignore
sir-lancebot | File "<frozen importlib._bootstrap_external>", line 879, in exec_module
sir-lancebot | File "<frozen importlib._bootstrap_external>", line 1017, in get_code
sir-lancebot | File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
sir-lancebot | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
sir-lancebot | File "/bot/bot/exts/holidays/easter/egghead_quiz.py", line 68
sir-lancebot | total_no = sum([len([user async for user in r.users()]) for r in msg.reactions]) - len(valid_emojis) # - bot's reactions
sir-lancebot | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sir-lancebot | SyntaxError: asynchronous comprehension outside of an asynchronous function```
> sir-lancebot | SyntaxError: asynchronous comprehension outside of an asynchronous function
But... it's not? It's in a command, so `async def`
@commands.command(aliases=("eggheadquiz", "easterquiz"))
async def eggquiz(self, ctx: commands.Context) -> None:
...
total_no = sum([len([user async for user in r.users()]) for r in msg.reactions]) - len(valid_emojis)```
python semantics puts things in a comprehension in another scope
you nest the async for in a regular for which doesn't have an asynchronous scope
So how d I fix that?
I can't make the other one an async for since it's a list, which doesn't support that
for statement and list.append maybe?
So it can't be done as a comprehension?
i guess so
Fair enough
@commands.Cog.listener()
async def on_reaction_add(self, reaction: discord.Reaction, user: Union[discord.Member, discord.User]) -> None:
"""Listener to listen specifically for reactions of quiz messages."""
if user.bot:
return
print(user, user.bot) # OUTPUTS TizzySaurus#9615 False
if reaction.message.id not in self.quiz_messages:
return
if str(reaction.emoji) not in self.quiz_messages[reaction.message.id]:
return await reaction.message.remove_reaction(reaction, user)
if await self.already_reacted(reaction.message, user):
return await reaction.message.remove_reaction(reaction, user)
@staticmethod
async def already_reacted(message: discord.Message, user: Union[discord.Member, discord.User]) -> bool:
"""Returns whether a given user has reacted more than once to a given message."""
users = []
for reaction in message.reactions:
async for user in reaction.users():
users.append(user.id)
print(user) # outputs TizzyBot (my bot)
return users.count(user.id) > 1 # Old reaction plus new reaction```I'm so confused how `user` is changing here
In on_reaction_add it's me, and in already_reacted it's my bot
you're reusing the user var in your async loop
so user will be whatever user was in the last iteration
can I get approval for bot#2294
@dim pelican I am very sorry in the squash merging of your PR I accidentally changed the spelling in the commit message from color to colour, was very much a mistake and not on purpose at all 


Hello
Typo in https://github.com/python-discord/sir-lancebot/commit/6bbb12e9ad904cd6e0d3506d2b2c2ab9142830ef
Should be "colors"
Please fix
Thanks
π
Rejected, low effort
color and colour are both correct
it's just American Spelling vs British Spelling
When choosing between color and colour, keep in mind that both spellings are correct. The shorter one, color, is the preferred spelling in the United States. The rest of the English-speaking world uses the longer form, colour.
~ Grammarly
Please come with me sir
We'll get you help
(I was just playing into the existing joke)
(ok)
me: quickly runs and jumps out of the server
me: calls simulation services
rings...........
me: Hello, Simulation Services, you may have to update the grammar to 1e0
me: cuts and leaves the phone booth
also me: forgets and leaves the mobile phone in the server
Hello @timid sentinel π
I've hopefully resolved your comments on sir-lancebot#1126, and also left an implementation query on sir-lancebot#1121.
what is time/memory/output limits for snek?
i found limit for uploading and printing output: https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py#L69 & https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py#L296
but i cant find memory and time limits
bot/exts/utils/snekbox.py line 69
MAX_PASTE_LENGTH = 10_000```
`bot/exts/utils/snekbox.py` line 296
```py
output = output[:11] # Limiting to only 11 lines```
config/snekbox.cfg line 8
time_limit: 6```
`config/snekbox.cfg` line 107
```cfg
cgroup_mem_max: 52428800```
6 seconds and 50mb
i will check it
i think you have a bug
!e
import time as t
t.sleep(6)
print('hi')
@timber pelican :warning: Your 3.11 eval job timed out or ran out of memory.
[No output]
!e
import time as t
t.sleep(5)
print('hi')
@timber pelican :white_check_mark: Your 3.11 eval job has completed with return code 0.
hi
yes, it is actual limits, i tested it, thank you
What's the bug?
eval job timed out or ran out of memory message when snek actually ran out of time
im blind, sorry
i didnt noticed timed out or part of message π€¦ββοΈ
π
fwiw, NsJail uses the same error code for both of those things, so we can't tell the difference without some custom stuff that we haven't seen the need to write
@vale ibex the only thing i've done recently on the repos is merge bot#2293
i'm not sure how that zen-args-fix branch got made/pushed?
https://github.com/python-discord/bot/commits/zen-args-fix
no idea then lol
hmmmmmmMMMMMM
... Couldn't you just change the error messages to be different?
Or does the bot just receive a generic "error: timed-out", and throw that message on there?
Dont think you can do that if NsJail throws same error both, it can be either and theres no context that you can grab to know what exactly occured
Yeah, that was my question
So snekbox does just throw a generic error, so the bot has no context when catching it
Cool
Maybe one day I'll be smart enough to understand snekbox and I'll work on that
How much of a PITA would it be to try and use botcore on a multi-server bot?
depends on your definition
@stable mountain is a multi server bot
botcore is also mostly opt-in funcitonality
so use as much or as little was you want
Definition: multiple guild IDs, so there would be no such constants.Guild.id(?) for things like wait_until_guild_available
yea, you'd need to overwrite those functions in your subclass
because there's a few "correct" things to do there
do you wait for all guilds? Do you maintain a list of guilds that are available?
so yea that can be implemented in a subclass
Huh
My "fun weekend project" is already turning into an architecture problem
And it's only Thursday!
hah yea sounds fun
probably just feed wait_until_guild_available the context guild id
I hope for your sanity that you're not implementing a cross-guild functionality
@static canyon were you able to look at the suggestion I left on sir-lancebot#1126 ? Other than that it looks good to approve.
I agree that the logic isn't the best within the command, but I feel it's out of scope for the PR, as Wookie said in his review.
I think in this instance I'll implement since I'm editing that bit of code anyway, but I don't want the PR to spill into a general "improving eggheadquiz"
If I remember I'll do it tonight, otherwise over the weekend.
!remind 20h
Your reminder will arrive on <t:1666444083:F>!
at this point it might be worth reading the entire lib changelog since that's the third or fourth pr that fixes issues with removed or changed code
I mean, it's not like your refactored changed the efficiency from before, but since you're already editing that segment :p, ultimately up to you though.
Just pushed it :)
!remind delete 5309
Successfully deleted the following reminder(s): 5309
RE bot-core#141, or more specifically, constants on bot-core (CC @gritty wind @cold island @timid sentinel as the commenters on the issue).
Has there been any kind of internal chatter about the next steps for this? There's other PRs stalled by it, and I'd like to avoid them not being implemented because we couldn't come to a conclusion on this (albeit important to not rush this decision).
As for my opinion on the matter, (as stated on the issue) I think a good option is a constants.py file on bot-core, that has all the constants that are required on both bot and lancebot (my understanding of bot-core is that it's supposed to unify "common assets" across projects, so this fits perfectly), with the option to leave other constants as-is within their own respective repo, since they're not "common across projects".
I believe this approach is akin to what @gritty wind suggested, and then @timid sentinel expanded on(?).
There was some conversation, I don't remember exactly where it ended
But my suggestion still works if you want to unblock this specific PR
If you're looking for something more long term then we'll need to come back to it later
Is the source code to this kind of evaluation piece of code shareasble/findable on the githubs or is this bot source code closed source?.. i kinda wanted to write something like this too!
It is open source! https://github.com/python-discord/snekbox
How long did it take to write this!?
I didn't write it so i'm not sure haha :P
Can i get help here ?
If it's not related to one of our projects, you should check out #βο½how-to-get-help
Can someone help me figure out wtf is https://github.com/python-discord/bot/blob/main/bot/exts/filters/security.py ?
it's a cog that adds 2 global checks
what part were you unsure about?
what... does it do?
and how is it related to filtering
check_not_bot means no commands can be invoked by bots check_on_guild means commands can not be ran in DMs
I guess it's filtering in the more broad sense
So it just adds these two checks to every command?
as in filtering out commandds we don't care about
it adds them to the bot as a whole, so yea every command will have them
Sorry for the big diff, it's not that bad I promise
@timid sentinel you stole my line for when the filters rewrite is out
Haha
Hello folks,
In BotCore's API client, I noticed that we use the request method for all HTTP methods except for the delete where we use the session's delete method instead of request("DELETE", ...
It got me curious, why is that ?
Yeah, fair enough. For now I've just gone with your suggestion so that the PR can be merged and others are unblocked
The request method allows you to have the type of request as a variable. If you know that you're trying to do a specific type of request then there's no reason not to use the dedicated method
The delete can potentially return None which the others can't, so it can't use the same generic method
And in what case do we not know what type of request we're going to use in advance ?
I mean that the request method doesn't care what type of request it gets, it does the same thing. You could use the dedicated get, post patch methods of the session but you would just repeat the same code
I see, so the only reason we did that is we want to check if we should throw before returning the response ?
It's so that we didn't need to duplciate ```py
async with self.session.request(method.upper(), self._url_for(endpoint), **kwargs) as resp:
await self.maybe_raise_for_status(resp, raise_for_status)
return await resp.json()
just replacing the method
Understood, thank you both !
Is this link still supposed to be functional ?
https://logs.modmail.dev/example
If it's in the readme, I assume so. However, that project is not managed by python discord, it's independent. There's a link to their discord there I believe
Yup, very top there's a sticker that says discord
I didn't pay attention to the fact that it was a fork, I'll notify them.
Thanks !
Yup yup, thanks for reporting anyway π
this is absolutely irrelevant to this channel as well as the server.
Where are we currently at for whether we want to move forward on snekbox#103?
I'd be interesting in working on it if possible
Seems to be approved and ready to be worked on.
not sure if Mark wanted to do it himself though
feel free to assign yourself
As for where we are at: we know we want to do it, but how to do it is still a bit up in the air
Seems like the best proposal so far is b64 still. If you want to explore other options that'd be good.
I was wondering how we should do the actual byte output
getting people to actually write bytes to stdin seems a bit complicated
I was thinking we can additionally patch some sort of display for libraries like matplotlib so plt.show() works
since there's no network connection I assume 99% of images are just matplotlib and maybe turtle?
This issue is only concerned with snekbox. Design only needs to consider that clients will be able to actually read the bytes. But what they do with them/how they use them is a separate issue that's out of scope.
but yeah stdout bytes to base64 seems reasonable
For example, the bot will read the bytes from snekbox's response, and it will either guess (based on magic numbers or whatever) or know from context of the command execution what the actual file type is.
I don't think snekbox needs to return any more info than just the bytes and the normal stuff it currently returns.
should we always return the encoded format, even with text? that might be easier than trying to have 2 modes and detection
I think I played around with this a while ago and got stuck with matplotlib as it seemed to require write access to a temporary directory for some internal stuff. Not necessarily relevant to this issue but if that's the end aim it's something to keep in mind
Yes, that is what I was in favour of. From my issue description:
I think it makes sense to maintain a single endpoint and simply add a parameter to change from text to byte mode, but I'm still open to discussion on making it a separate endpoint.
oh? π
Though we probably don't even need a parameter
Would it make sense for the bytestream itself to contain metadata about what is being returned? e.g start with a filename
This was quite a while ago so I can't really remember, it's possible there might be a workaround or something or things have changed, idk
Ah, I think I know why I wrote that it should use a parameter: backwards compatibility.
are we doing filesystems in this as well? since iirc it's not enabled currently
snekbox#114
well, we don't need to, but it would be useful to know whether we're getting text out, or an image etc.
we don't necessarily have to do file io before byte io, but yeah that could be interlinked
How would snekbox have that info?
hmmm
I suppose we would with file (extension mime)
but raw bytes not really
or if we patched an extension just for matplotlib obviously we can inject something
I am not a fan of having to maintain patches for external libs
is there a code example that would deliver a representation of an image?
With text you can just print it
but with images you.. imshow?
asking people to just save a file and reading it would be the most compatible way it seems
I think the bot should be able to determine what the file type is from context e.g. by having separate commands to output different file types.
Trying to guess it sounds like it could be unreliable. I suppose some file types are easier to detect than others. Even then, the user may not always have the intention to actually render the file.
I guess just json base64 like an API?
"content": {"image/png": {...}}
then python bot can read that and decode/show
while the snekbox feature is independent, I think it would be useful to understand how exactly a user can output image/sound by evaluating code
Snekbox will just output whatever is in stdout as bytes. So to output an image, just write the bytes of the image to stdout.
When the bot receives those bytes, it'll be up to the bot to determine how they should be interpreted and presented.
I guess
seems a bit awkward though, since people will need to know how to convert it to bytes and output it
We can add some utility functions to make that easier, if that is a concern.
I believe the bot already wraps the user's input code for some timing stuff
That's true.. I guess it can come with a built-in imshow function
Though polluting global namespace is a bit yucky and unexpected
We can alternatively create a proper package and install it within the snekbox env as we do with other packages like numpy
But that has added maintenance burden so I dunno
Even if we do, the user would need to know to import it. At that point it might be easier to say in the help embed "use this magic function like a print"
How do notebooks do it? Anyone have experience with those?
Good find. So we should explore using those dunders.
IPython/core/display_functions.py lines 261 to 266
from IPython.core.interactiveshell import InteractiveShell
if not InteractiveShell.initialized():
# Directly print objects.
print(*objs)
return```
jupyter detects some special dunders it seems
so it first resolves _ipython_display_ which completely offloads rendering to the object. or any of the format reprs
if we were to do that I suppose we'll need to stop running them with -c and need to setup our own ipython "interpreter" which evaluates objects line by line
or create a library method like show() which users can call on any object and we'll try to grab a displayable image via the ipython methods
I'm wondering if it's not easier to just have a method show() which will try to parse the object on its own. In 99% of cases it will be either a numpy array or a Pillow image
though plt.show() probably won't work with that
since instead of objects we decided module globals are a better idea for plotting 
hm, I wonder what happens now
!e
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('abc')
plt.show()
ah
@fossil veldt :x: Your 3.10 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 1, in <module>
003 | ModuleNotFoundError: No module named 'matplotlib'
There wasn't a decision on that. i think I was the only one who expressed an opinion on that matter.
I meant the decision by matplotlib :p
Ah, sorry
lib/matplotlib/pyplot.py lines 223 to 226
global _backend_mod
# make sure the init is pulled up so we can assign to it later
import matplotlib.backends
close("all")```
tbh this stuff looks pretty cursed by normal standards π₯΄
the mimebundle one looks interesting. But not all objects are guaranteed to have it?
Cause it would be nice to only worry about a single dunder
essentially I think
or everything that can be displayed in jupyter / ipython
So are you saying they will all have that dunder?
On second thought the mimebundle may not be so useful anyway
apparently not, hm
pillow only has these for example
I think mime is only for if the format is not one of the defined reprs?
I'm assuming this is sort of a top to down attempt mro thing
What theme is that?
GitHub? 

I suppose we could just check all of these in sequence for a match, not too difficult
The code snekbox executes could use these dunders to determine which data to send to stdout (via some custom function we expose somehow). However, I am unsure of how to communicate which representation it chose. Maybe it's easier to tell snekbox which type is desired, so the client knows how to interpret the bytes it receives. Snekbox could fail with an error if it cannot get the requested type.
I don't think this stuff has to be done on snekbox's side. It could be code injected via the bot
Which I would prefer. I like keeping snekbox simple.
if we make it a pypi package (interpreting ipython objects into base64 encoding) I suppose it can just be a dependency in our snekbox installation?
or I suppose only outputting to bytes stdout
and snekbox would just implement bytes to base 64
though if snekbox did encoding, we would need to put the mime format inside the bytes 
Yeah it could. Maintaining a package may not be worth the added burden though.
Hereβs a one word change PR if anyoneβs keen on reviewing (site#785)
site#785
Hmm one is not very many
Could we get a couple more words?
Bot's are having a hard time
Give them a bit
Mine took a long time to send the embed too. Was that what the Sentry alert was about?
brb gonna request access to our patreon paypal
14 alerts in 6 minutes 
@stable mountain plz
Just breathe buddy
!ping
65.841 ms
Healthy
102.660 ms
.ping
Gateway Latency: 103ms
&ping
Gateway Latency: 117ms
smh inconsistent ping format
I like the lancebot colorful embed
is snekbox using venvs or?
what do these things do π
No, it does not. Why do you ask?
I mean like the repository package manager
Its dependencies. Generated by pip compile from pip tools
If you want to use a venv for development purposes then you have to create it yourself
@stable mountain doesnβt seem to be feeling too well. I assume youβve gotten some alerts already?
Yep
!ping
68.052 ms
Healthy
104.681 ms
See #dev-oops
@tawdry vapor @fossil veldt have you tried playing around with installing and importing matplotlib in snekbox (even without the support for output yet)?
When we were working on lanceβs latex features, there was an insane flat memory cost just to import it, it might cause issues with the memory limits
not really, might try it I guess 
what was our memory limit for nsjail?
Uhhh
oof i just noticed that 2310 wasn't even reported to the discord lib
If I'm reading this right, it's 50MB, including the python process
cgroup_mem_max: 52428800
I could test installing it on prod for now
It seems to straight up error on import, it expects to have a user
very cool
We can set an env var for that, but it still requires a writable directory
What kinda library does so much on import
https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/__init__.py#L581-L582 why doesn't it exist then...
lib/matplotlib/__init__.py lines 581 to 582
- Lastly, it looks in `β`β$MATPLOTLIBDATA/matplotlibrc`β`β, which should always
exist.```
lmao
I think it just doesn't get to that point
lt doesn't expect Path.home to error
Hmmm, yeah this will only be resolved in a good manner with snekbox#114
Yes that seems to be the problem
We could try setting MATPLOTLIBRC env var to whatever os.path.join(get_data_path(), 'matplotlibrc') is supposed to resolve to, though we'd have to hard-code the path
Yeah, I got around this issue by setting HOME so it resolved, but then it errors when it tries to write to the temp directory. We could technically just put the config on the system ourselves globally, but I'm not sure if matplotlib needs more temporary stuff
#bot-commands message
RE your comment on the PR, there isn't much more context
I just said, this works, and is more consistent with how we do this pattern
Rather than trying to patch something that's only used in this one place
hm... I'm trying to use a locally built snekbox and bot isn't connecting to it
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host localhost:8065 ssl:default [Connect call failed ('127.0.0.1', 8065)]
does seem to be up here though
# config.yml
snekbox_eval_api: "http://localhost:8060/eval"
snekbox_311_eval_api: "http://localhost:8065/eval"
snekbox-311:
<< : *logging
<< : *restart_policy
build:
context: ../snekbox
dockerfile: Dockerfile
init: true
ipc: none
ports:
- "127.0.0.1:8065:8060"
privileged: true
are you running the bot in docker or locally?
docker
Try changing localhost in your config to 127.0.0.1
Wait, are you running snekbox from the same compose?
Or have you built it separately?
uh, yeah 
π
It's 8060 if you're hitting the service directly
It's only 8065 if you're connecting from outside the container network
ah I see 
yup that worked, thanks π
Cool cool
External:internal
so how does it route which one, hostname?
It means expose the internal port 8060 to the host network at 8065
It's only used if the bot is running on the host, outside docker, or if you want to hit snekbox from your machine outside of docker
For container to container networking on the same network its not needed
oh hm.. so I guess I should just do the normal single port then for dev?
:8060 for snekbox and :8065 for snekbox-311?
If you're running the bot in docker, snekbox:8060 will hit snekbox, snekbox-311:8060 will hit 3-11
If you're running the bot on host you will need to do localhost:8060 for snekbox and localhost:8065 for 3-11
Yea, since it's all in one compose file, they can talk to each other using docker dns, the domain names will be the service names in the compose.yml
also how does the 3.11 / 3.10 thing work?
the snekbox repo dockerfile seems to be only 3.10?
Yea 3.11 is something I manually built and pushed to the snekbox ghcr repo
If you remove -dev from the image name, you'll get the one used in prod
It's much bigger since it has all the deps
also there's an image and a build in the snekbox compose?
is it using the image then or the local build? 
I haven't looked at snekboxes compose file much, so I'm not sure what it's doing
docker-compose.yml line 55
snekbox:```
`docker-compose.yml` line 58
```yml
image: ghcr.io/python-discord/snekbox:latest```
`docker-compose.yml` line 67
```yml
snekbox-311:```
`docker-compose.yml` line 70
```yml
image: ghcr.io/python-discord/snekbox:3.11-dev```

Oh wait I misunderstood what you were looking at
From first glance it pulls the dev stage from ghcr and then targets the venv stage during building
Likely to save you waiting for build deps to install
That's supposed to happen
#community-meta message
Almost done :D
postgres upgrade time
ah alright shouldβve checked
:D
are yβall still hosting on linode?
i remember the netcup host stuff being talked about
We're mid migration yeah
xithrius currently on a triage spree
Earning that role
rightfully so
Re bot#1941, have we had issues with available help channels dissapearing recently? If we haven't I'm wondering if it's still worth doing.
Oh alright, that's annoying
Have we narrowed down the cause of the issue? Do we believe it's just the discord API lying about moving the channels?
sir lance now only has 1 pr, very nice
Personally I haven't bothered investigating, as I'm not sure it's worth time investment to fix
Since we're going to be using forum channels at some point
just close it no one needs buttons 
lol
I believe so. There isn't really much else that could fail in the claim func, at least not without causin an exception
HUH
Lancebot has no PRs
@vale ibex is Lance dead?
Are we just using @stable mountain now?
I see
I'll go close it
Thanks
What's the advantage that forum channels offer compared to the current approach? Question /subject visibility?
Visibility is questionable but it offers quite a few nice benefits
First is each question gets a channel which is nicer for history
Itβs easier for users to find their channels, and itβs easier for them to claim since itβs a native feature
Itβs much easier to archive and search through the archive
There isnβt a real limit to the number of channels, so we can stop running out
Itβs a collection of smaller problems that have caused us a lot of pain
No two people trying to claim the same channel, can filter by tags, no need to restart the cog whenever some hiccup causes there to be less than three available channels
It won't stop functioning because of API issues
and we get to delete/disable a bunch of code
and claimant gets an op tag which is a frequently requested feature for our help system.
yea, one day we might get forum channels in our test server
yea we are, we just don't have a test server with them enabled so can't do much beyond planning
lolwut
@vale ibex! can you hear us!?
We'll get you out of the branch! Just hold on!!
The fact that my test server has them before our actual one is more than a bit amusing
have we tried just asking discord for it
what repo is that?
i've noticed that before
guess web is different
yeah it's the app on mobile
@tawdry vapor is there a reason we need to do this instead of just stdout.read(self.max_output_size) ?
https://github.com/python-discord/snekbox/blob/main/snekbox/nsjail.py#L117-L122
snekbox/nsjail.py lines 117 to 122
while nsjail.poll() is None:
chars = nsjail.stdout.read(self.read_chunk_size)
output_size += sys.getsizeof(chars)
output.append(chars)
if output_size > self.max_output_size:```
Looks like it could be if .read takes a number of characters to limit to but the code wants to limit to a number of bytes?
But I think that wouldn't work to do that anyway
because iirc the number of bytes that each character in a string takes up is determined by the highest number of bytes needed by any character
So sys.getsizeof(''.join(output)) could be quite a bit bigger than output_size
I don't know. I did not write this bit. I assumed it was somehow related to character encoding
hm, okay
There should be tests for this already. Unless those are flawed, I think this code is fine
Here's my idea so far for a transmission scheme for sending files over stdout to snekbox
// Fixed Header
[0] 01 "<SOH>"
[1] 1C "<FS>"
[2:5] 73 6E 65 6B "snek"
[6] 1D "<GS>"
// Version
[7] 00
// File name size (big endian uint32)
[8:12] 00 00 00 0C (12)
// File name (utf-8)
[13:A] ..
[A+1] 1F "<US>"
// File size (big endian uint32)
[A+2:A+13] 00 00 17 D9 (6105)
// File bytes
[A+14:B] ..
[B+1] 17 "<ETB>"
Is the idea to make the bot post the file in chat as part of the result?
Are you working on a separate issue?
This is apparently for sending files, not receiving them
@last patio wdym by authentication? it seems to work and the bot is able to connect, so I'm assuming it's fine
quick suggestion: make !rule hw an alias to !rule 8
The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.
Made an issue about it π
Also suggested 'eng' for rule 4
Yep, found it, bot#2309
Hmm, isn't that just for getting info about what keywords there are?
That adds discoverability of what the existing keywords are. Anonymous is suggesting a few more keywords
Ahhh gotcha, mb
well this is just getting bytes out of snekbox into the API response. Python bot will then have to implement reading that to show an image / file
and we'll also need a python instance side package to encode the file output and send it to stdout
@sharp crag This is a good example of using that view
https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py#L163-L181
https://github.com/python-discord/bot/blob/main/bot/exts/utils/snekbox.py#L360-L362
The alternative is to delete the warning message itself after timeout
ty - if we're to allow other moderators in the chat to cancel the view, this would be good
if it's only restricted to the mod who ran the ban command on a helper it might be overkill
Yea, it has two benefits, it both allows easy checks, but also it removes the button form the message on timeout
rather than leave the button there that doesn't work
@sharp crag 
don't thank me
it was a 13 line diff

@static canyon hi
π
So, have you already made the changes? @worldly gate
And if so, where did you do them?
I did the changes but i have not saved yet
i forked the repo and clone it to local system but the changes were small so I have changed the code in github itself but not saved yet
You should really still do it locally
I myself have made the mistake of thinking "it's small, so it won't matter" but it does definitely help doing it locally
I'd also say to keep spacing consistent with how it is now, so only one blank line above the self.add_reactions()
ok
is it okay now?
Yeah, that looks better. I'd maybe remove the blank line between the two await calls but not a big deal
Make sure that you're not on the main branch too
Before committing, you can do poetry run task precommit, which will install commit hooks that basically prevents you from committing code to the project that has lint errors (such as unused imports)
what should I do here?
That's fine π
It's saying it's going from your branch into the pydis main branch
Which is what you want
do I have link issue with pull request?
just make "Closes #issuenumber." the first line of the PR
added like this Closes#1122
ok thanks @static canyon and @vocal prairie
You don't actually need the hyperlink btw. It's added automatically :)
@sharp crag when a ban is actually applied the button seems to stay there forever? 
Ah shoot, does it? Let me check
feel free to use not ionite as test subject :p
No need I think it should be a one line change
@fossil veldt fixed & pushed, ty for feedback
lolwut
banned myself again and crashed discord
I guess their codebase has even more problems π₯΄
me when the crash exploit 
I'm trying to run bot using docker, but get a ModuleNotFoundError: No module named 'botcore' error
Any ideas how to solve it?
Try doing a poetry install
I did that earlier, but how would that help when using docker?
Right, I meant to say docker-compose run bot --build
When was the last time you pulled and rebuilt the image?
(Which will reinstall dependencies by doing poetry install, amongst other things)
Basically now. I deleted the (very old) containers I had and did docker-compose up
I don't think docker-compose up rebuilds
If there are no containers, it should build
no, it just spins up a container from the existing image
So you might still have to rebuild a new image. Deleting the container is different
Have you tried this? @obsidian patio
It's working in the background while we speak
you might need docker compose build --no-cache --pull
for building the image from scratch
What's the difference between that and what I sent?
up --build doesn't invalidate the layer cache
Right.... and what's the layer cache?
the concept thanks to which you copying in requirements.txt and pip installing it doesn't need to be done again if you don't change it afterwards
Right, but wouldn't that mean that doing what I sent wouldn't fix requirements then (when it has for me) if it doesn't invalidate the layer cache?
if they do have the right poetry.lock, but still get that error, it wouldn't trigger the poetry install again
But it has for me?
Hmm
Progress. There's a new error
As in, whenever I do docker-compose run bot --build it has always redone the poetry install --no-dev
hmmm, that's strange
So would that just mean I've not had the latest poetry.lock every time I've done it or something?
if you do poetry install on the host, does it update the poetry.lock? if yes, then you have an outdated poetry lock
It's giving me this now: ```
bot_1 | redis.exceptions.ConnectionError: Error -3 connecting to redis.default.svc.cluster.local:6379. -3.
bot_1 | 2022-10-30 17:29:04 | bot | CRITICAL | Unknown Startup Error Occurred.
I have a feeling that a faulty config might be to blame?
actually I don't think poetry works like that, IIRC it strictly adheres to the lock file, whether or not it's updated
yeah, that redis host is k8s specific
(sir-lancebot-py3.10) PS C:\Users\tizzy.000\Documents\Repos\sir-lancebot> poetry install
Installing dependencies from lock file
No dependencies to install or update
```but a `docker-compose up sir-lancebot --build` still runs `poetry install --no-dev` and says like "Installing ..." for each of the dependencies
that's definitely weird to me
I guess because PyCharm uses a venv? So poetry install is installing to the venv, and docker isn't using the venv?
But then each re-run does it, when theoretically only the first should because then the stuff is installed π€·
the docker image is now (since the poetry 1.2 upgrade) using a venv (not the same venv as the host)
Do you know what an appropriate docker dev config with fakeredis would be for the test server?
The one I got in #helpers is giving me this issue
Isn't fakeredis just USE_FAKEREDIS=truein the .env?
<aside>
π‘ If the bot is running on docker, make sure to update these lines in the file below:
1. `site: &DOMAIN "localhost:8000"`β `web:8000`
2. `snekbox_eval_api: "http://localhost:8060/eval"` β `"http://snekbox:8060/eval"`
3. `host: "localhost"` β `host: "redis"`
</aside>
<aside>
π‘ To persist Redis data, set `use_fakeredis` to `false`.
</aside>
this is what the Notion page says
Done that now, but still getting the same error
Is there any other info to the error?
Here's the full error: https://paste.pythondiscord.com/xajatabuda. Nothing more relevant in there as far as I can tell
if it's bot the config is in the config.yml not the .env
Right (I've got lancebot open so that's why I said .env)
I don't see why it's still trying to connect to the k8s specific host
No clue. I'll send my current config here
Change these two for docker compose
(the same thing happens when I have &DOMAIN too)
FAKE_REDIS didn't seem to work for me
this looks fine, are you still getting errors?
still the redis.exceptions.ConnectionError: Error -3 connecting to redis.default.svc.cluster.local:6379. -3. error? Are you definitely editing the config.yml not default-config.yml, and saving the file?
does anyone have an example of the flake8 action annotations
perhaps a screenshot
of when ci fails and it annotates it
Yeah
that's weird
is there a line in the logs saying Found `config.yml` file, loading constants from it.?
Not that I can find. This is the second log from bot
If it finds the config.yml it should print out that log line, not finding it would explain why you're getting a redis error.
I don't know why it wouldn't find it though
No clue
reaps and kills children
Dang yβall killing children while working on nsjail?
You aren't?
Pip-tools throws the most random ass NoneType error if the python version is mismatched
Upgrading everything does resolve it tho so
@gritty wind I am aware of the coveralls action but my concern was that we will not control which version of coverage.py it uses, which may cause problems if there is a significant change between our version and theirs.
That's a fair concern, however I don't think it works like the python action
Under the hood it's javascript and it just uploads the lcov files as is which are processed by coveralls itself
I'm not sure why the coveralls package doesn't do that tbh
Oh I forgot to generate it lol
Hmm okay let's try it then
We still generate the lcov report with our own coverage fwiw
Force push now just upgraded the black version in the initial commit with all the other upgrades, and added the missing instructions to the workflow
Ah I need to bump black now
So it has its own coverage parser rather than relying on coverage.py for parsing?
Well, not really it doesn't parse it per-se
Rather we generate the lcov report that's normally expected by the website
Actually I think I understand the package now, it literally just calls coverage lcov and uploads the result
I unpacked that to explicitly call coverage now and upload using the action instead
The coveralls package would fail so frequently I guess because there isn't a good programmatic way to call the report generation function? That part I don't understand yet
this is a nice benefit
okay very nice
Seems black doesn't respect the configuration in pyproject, at least as far as the version stuff is concerned
Doesn't seem to respect it in the pre-commit file either
Github actions deprecated so much stuff, it's made the summary window basically useless
@tawdry vapor any idea why actions are failing?
The workflow is not valid. python-discord/snekbox/.github/workflows/lint.yaml@dfa6f9f667d896a23acf1ec7e832acf12f869134: While scanning a multi-line double-quoted scalar, found wrong indentation. Unexpected type '' encountered while reading 'root'. The type 'MappingToken' was expected.
Actions were working until I made this push
https://github.com/python-discord/snekbox/compare/2f0e71755e21b110514b94a1a37006b867a542a8..17d6dc98e6dbb5bab468cbcbf11830e63edb5acd
But it doesn't touch anything related
No, I'm not sure
The lint workflow is identical to the main branch besides changing the python version
I don't see why changing 2 characters would make it fail to parse
I suspect it might be pointing to the wrong file, but I don't see why/how
I wish there was a good way to test action stuff, beside pushing and waiting for it to rhn
You can try https://github.com/nektos/act
woah
Ah it does not support reusable workflows
I wonder if I can get it to use the specific workflow
Yeah it ran fine locally
Yeah I've dropped all commits and it's still failing, I think actions is just borked
Alright, managed to fix it
Here is the bug, clearly:
diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml
index b4b69ac..cccdb89 100644
--- a/.github/workflows/lint.yaml
+++ b/.github/workflows/lint.yaml
@@ -29,8 +29,8 @@ jobs:
with:
path: ${{ env.PRE_COMMIT_HOME }}
key: "precommit-0-${{ runner.os }}-${{ env.PRE_COMMIT_HOME }}-\
- ${{ steps.python.outputs.python-version }}-\
- ${{ hashFiles('./.pre-commit-config.yaml') }}"
+ ${{ steps.python.outputs.python-version }}-\
+ ${{ hashFiles('./.pre-commit-config.yaml') }}"
# Skip the flake8 hook because the following command will run it.
- name: Run pre-commit hooks
Thanks github
Thank you Scaleios π₯π₯π₯π₯ You The Man
try docker compose exec bot cat config.yml after docker compose up -d
to see if the config is updated
or you could try running the with docker compose up --build --force-recreate
Not sure if anyone has asked yet, but are you sure the config.yml you are editing is in the project's root dir? (The same dir as config-default.yml)
it would be worth double checking that is the case, rather than assuming you've already checked that, just to be sure
because this suggests it either isn't in the right dir, or isn't being put into the container by the volume.
some internal change by github
probably means you'll have a lot of changes to make across a bunch of repos until tests pass again
Our test server, despite being community enabled, does not have forum channels.
Don't forget to upgrade your control panel OpenSSL version
in most cases it is vulnerable to self signed segfaults
because certificate parsing is done without establishing a chain of trust
@last patio I fixed everything approve please thanks https://github.com/python-discord/sir-lancebot/pull/1095
helo, on my way, thanks
we did it
.bm
Click the button to be sent your very own bookmark to [this message](#dev-contrib message).
bookmark the moment to remember it forever
legend π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯π₯
what was the reason to get rid of the π emoji from the button? this text seems verbose
I guess it's a bit more clear, especially since discord already has the concept of "pins", which isn't what it does.
yeah, that works quite nicely too
It's over. It's done.
the urge to go in and make a PR right now
n0
xith can i have your approval to make a PR to unitalicize the help descriptions for lance? we did it in bot. π π
I've had my moment here. You have my permission.
lmfao
i'll do it assuming docker actually works
...i was wondering why docker wasn't appearing in wsl when it was enabled until i realized i didn't have it installed >.>
oh yes i remember now. i forgot to install it because i was trying to figure out why its website though i was on macos.
Hey, is making more guides (https://www.pythondiscord.com/pages/guides/) something you guys think is needed or worthwhile? I've been back on the server after months of not paying attention to it and wanted to finally contribute beyond helping in the help channels.
Made by us, for you.
I was thinking of making a guide for how to add Python to Path on Windows, which I see come up a lot in help channels, and I can never find an article on google that mentions all the details fully.
Yes, I think that would be both helpful and definitely worthwhile.
For the specific thing you mentioned, there is this open Pull Request, if you want to take a look and provide a review/comments/suggestions: https://github.com/python-discord/site/pull/773
Thanks I'll look into that! And I found https://www.pythondiscord.com/pages/guides/pydis-guides/how-to-contribute-a-page/ which I'll be sure to follow


