#dev-contrib
1 messages · Page 115 of 1
site is deploying™️
hold up, do i need to make a separate pull of the site to work on the bot?
because i get this: ```
bot_1 | 2021-05-17 19:41:38 | bot | CRITICAL | Could not connect to site API. Is it running?
bot_1 exited with code 69
What was the purpose of the windows path tag? Seems like it just explains how to invoke py in a bit verbose way. I recall it being discussed somewhere but I think that was before tags were files on the bot
i mean, kudos to you all for choosing code 69
Are you using docker?
yes
as a bonus, you could also run redis
just add redis to the end of the command up there
also check out the contrib guide
it'll help
a lot
A guide to setting up and configuring Bot.
im using fakeredis
Have you configured the urls?
yes
i think
shit
im so dumb
did i seriously type web:8080
you gotta be shitting me https://paste.pythondiscord.com/vupezohisu.sql
any errors in the site container?
nope
yes
can you show the last few log messages?
Deleting 'images/navbar/pydis_banner_no_square.svg'
Deleting 'images/navbar/discord.svg'
Deleting 'images/waves/wave_white.svg'
Deleting 'images/waves/wave_dark.svg'
Deleting 'images/events/100k.png'
Deleting 'images/events/summer_code_jam_2020.png'
236 static files copied to '/var/www/static'.
Creating a superuser.
Admin superuser already exists.
Existing bot token found: badbot13m0n8f570f942013fc818f234916ca531
Starting server.
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
May 17, 2021 - 19:57:08
Django version 3.0.14, using settings 'pydis_site.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
``` in site
you're running the site locally?
with docker
from the site repo?
ok, just checking, since those logs should be prepended with bot_web_1
Bot's also in docker?
i copied them directly from the bot_web_1 logs as the bot_bot_1 is bootlooping
yes
can you do docker-compose down and docker-compose up --build
sure, but im gonna stop the bot cause its bootlooping again
@vale ibex it seems the api is not starting
There's a bunch cut off from the start it seems
also, this line bot_1 | 2021-05-17 20:01:34 | discord.client | WARNING | PyNaCl is not installed, voice will NOT be supported suggests you might be on an old commit?
what branch do you have checked out?
The output of git log -1 would be good
main
Why would it suggest that?
since we don't have voice extras on d.py anymore
huh, I thought that log wouldn't show now that we removed the voice extras for d.py
My mistake.
i refreshed my fork this morning
I assume the log shows up because they were removed and it can't find them
what im seeing is the api isnt starting
So your urls config looks something like this?
site: &DOMAIN "web:8000"
site_api: &API !JOIN ["api.", *DOMAIN]
site_paste: &PASTE !JOIN ["paste.", *DOMAIN]
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
site_schema: &SCHEMA "http://"
urls:
# PyDis site vars
connect_max_retries: 3
connect_cooldown: 5
site: &DOMAIN "web:8000"
site_api: &API "api.web:8000"
site_api_schema: "http://"
site_paste: &PASTE !JOIN ["paste.", *DOMAIN]
site_schema: &SCHEMA "http://"
site_staff: &STAFF !JOIN ["staff.", *DOMAIN]
paste_service: !JOIN [*SCHEMA, *PASTE, "/{key}"]
site_logs_view: !JOIN [*SCHEMA, *STAFF, "/bot/logs"]
# Snekbox
snekbox_eval_api: "http://snekbox.default.svc.cluster.local/eval"
# Discord API URLs
discord_api: &DISCORD_API "https://discordapp.com/api/v7/"
discord_invite_api: !JOIN [*DISCORD_API, "invites"]
# Misc URLsw
bot_avatar: "https://raw.githubusercontent.com/python-discord/branding/main/logos/logo_circle/logo_circle.png"
github_bot_repo: "https://github.com/python-discord/bot"
oh @vale ibex its working now
im on a nightly docker and i was using docker compose instead of docker-compose
You'd want to update your snekbox url to http://localhost:8060/eval too
If you're running through docker I'd also suggest to configure redis and snekbox normally
I believe it'd be http://snekbox:8060/eval when it's all within docker, same for redis but with redis
huh, yeah that'll probably be better, since it's more verbose descriptive
but localhost works too
iirc localhost will fail if it's not exposed in some way through docker when it's all ran within it, but not sure as I run the bot outside of docker
hmmm, I might be wrong then, let me actually run the container
No, you are right. I must have updated my config for the test server recently.
I remember setting it up, and localhost is what it's currently configured to
so I put 2 and 2 together and got 5
@fervent sage
Here's your reminder: this.
[Jump back to when you created the reminder](#dev-contrib message)
!remind 2h ^
Your reminder will arrive in 2 hours!
yeah exactly
if you don't have the voice extras, discord py displays that message
yes, pretty much
what's up?
Ooh, such a nice numbered pr with really nice goals
That doesn't sound too hard to do after the migrations are over
Any idea why we have bs4 listed as a dep in lance?
can't see anywhere where it's used
Also, pytz isn't needed since we have arrow
ping
Looks like it was used for the AoC cog's initial implementation
Ahhh, that makes sense
its not directly #dev-contrib related, & i did fix it, partly
ah
its partially related since i had to fix it on my sir lancebot as well
i'll type it up in #ot2-never-nester’s-nightmare
Whenever an exception is raised in a project
The sentry sdk sees it
and ships off to sentry.io
https://sentry.io fwiw
Where we can see all our exceptions
you can always selfhost 
I STAND CORRECTED
yeah sentry is oss
@fervent sage
Here's your reminder: ^.
[Jump back to when you created the reminder](#dev-contrib message)
lmao
luckily it's easy fix too
yep
Woohoo my first bot pr is up
Nice! 😄
Is it fine that I've been ignoring the error in .aoc join lol
wait it doesn't error for lancebot for some reason 🤔
Is it an empty sequence error?
ye
Yea, that's from not having any leaderboards locally
Is America/Chicago EST timezone?
@short snow
Here's your reminder: do now.
[Jump back to when you created the reminder](#dev-contrib message)
lol you reviewed before the reminder came
!remind 14h do now 
Your reminder will arrive in 14 hours!
no lol
America/Detroit
America/NewYork
Chicago is CST/CDT. So one hour before EST/EDT
sure? Chris had set that as EST timezone in the aoc pr
Silly brit, not knowing our confusing and inconsistent american timezones
bot/exts/christmas/advent_of_code/_helpers.py lines 50 to 52
# Create an easy constant for the EST timezone
EST = "America/Chicago"```
hang on are you telling me the whole US isnt UTC-5 ??!!! 
EST is UTC-5 though
its like the rest of the world..... India is worse even.
I meaaaan. The best part of the US is
Arizona fucks up everything timezone wise
mhm. Daylight savings.
indiana doesn't even do it iirc
what would be the right EST timezone?
New York, we're in EDT currently though. But for AOC we should be in EST.
which we will when it occurs lol
so est/edt is the proper timezone
bump
is this sir-lancebot?
yeah
the extensions are loaded in bot/__main__, so there
same way using a async loop?
I have no idea what you want to do actually, I thought you were asking where to run code before extensions are loaded
what's this for?
Its for https://github.com/python-discord/sir-lancebot/issues/705, I want to call that function get_unloaded_extensions before I start loading all the cogs
yeah, at first glance I don't see why you couldn't just get the loop and do cog loading/skip loading there
while you're at it extensions.py has a module level constant EXTENSIONS, you should probably walk that rather than call walk_extensions() again
alright, just wanted to know if that's the best way to do it
Is this fine?
for testing, I am injecting them manually just after redis gets connected
Can you post that to #dev-alerts btw? (Not sure where it is atm)
Aaaaa
I hate timezones
I even spent a good 3 minutes on Google
yeah, its getting posted there
look at this, how to get cog name from a cog object, before the cog is loaded 🤦♂️
is there a better way
this works for all cases except
when you put a object in the file name
cog.qualified_name?
that would return the cog name not bot.ext.everygreen...
f"{inspect.getmodule(cog).__name__}.{cog.qualified_name}" maybe?
oops yeah that's what I did, sorry forgot to reply earlier.
https://github.com/python-discord/sir-lancebot/pull/745/checks?check_run_id=2609367724 has been running from 31 minutes
Chris 👀
@vale ibex
is that because of the stuff you did to workflows?
lemme take a look
huh, it's not even in progress
it's stuck starting
lemme check other repos
🤔
@patent pivot Could you take a look at the org level workflow view? Are we hitting concurrency limits?
Welcome to GitHub's home for real-time and historical data on system performance.
looks like github is having issues with actions atm
This doesn't seem related to my recent changes, but do keep an eye out anyway, since thing we're using is still in beta
hmmmmm
Update - We have confirmed that run starts are delayed for a number of customers. We have identified the issue and are working on a fix.
from an hour ago
probably just need to wait it out
Can always restart it
oh alright, I thought iceman's actions worked out and I had WIP on earlier to the checks didn't run.
object why did you thumbs up your own issue lmao
lol
sounds like something he'd do
yeah its just that issues are fucked atm
https://github.com/python-discord/bot/pull/1594#discussion_r633759351
@sleek steppe shouldn't this return a Coroutine object that isn't lowercase?
!e
async def test():...
print(type(test()))
@sleek steppe :white_check_mark: Your eval job has completed with return code 0.
001 | <string>:2: RuntimeWarning: coroutine 'test' was never awaited
002 | RuntimeWarning: Enable tracemalloc to get the object allocation traceback
003 | <class 'coroutine'>
oh lol
in that case, nevermind
@fervent sage poke https://github.com/python-discord/bot/pull/1594
!reminders
expiration
:/
It would be cool is remind list had that root alias 👀
im porting it to a site guide soon™️
@short snow the cowsay command art is broken on mobile, and beavis was fine on my side
see what i just commented
I just saw, do you suggest beavis is removed?
or should we tighten the character limit on beavis
I feel like it should sent an error message if it gets an HTTPException
yes
sir-lancebot#740 and sir-lancebot#741 are both small bug fixes that needs a core dev approval
I explained the links here yesterday
what are you struggling with?
the technical implementation is mostly this
the visual part is mostly up to you
You'll wanna do it using the path from the URL
You should be able to do it on the page that renders the markdown pages. (the button)
for example the contributing home page is at:
https://pythondiscord.com/pages/guides/pydis-guides/contributing/
The visual design is completely up to you
There is an example positioning on the issue itself
I like it there, but if you figure another place it works, that's fine too
@fervent sage
Here's your reminder: do now :mmLol:.
[Jump back to when you created the reminder](#dev-contrib message)
out of interest, where did the need for unwrap come from?
You don't need to manually write css
Github is still having issues with actions, might be a while until things get merged/deployed
https://www.githubstatus.com/
oh this isn't gonna get merged any time soon
The Bulma button is what's used across the site, so I'd say you should use that to ensure concistency.
You can style the outline to look like what it has in the issue using Bulma too.
Is that a custom button?
https://bulma.io/documentation/elements/button/ You need the button class too
the class is what applies the bulma styling, it won't apply via the <button>
is-flex
That will also make it so that if a person's screen is too small, it'll go onto two lines.
is-inline should work too, but it'll force it all onto one line even if it's a small screen.
I wonder why is-flex didn't work.
Can you share the html?
That should be on the parent element btw.
Put is-flex next to content
And remove is-inline
Oh crap
One sec
I know what went wrong
<section class="section">
<div class="container">
<div class="content">
<div class="is-flex">
<h1 class="title is-inline">{{ page_title }}</h1>
<button class="button is-inline">This is a button</button>
</div>
{% block page_content %}{% endblock %}
</div>
</div>
</section>```
is-inline will force it onto one line, even if they have a small screen.
Which looks really messy
vertical end?
You want it to be at the bottom of it's horizontal container?
is-align-content-flex-end maybe?
On the button, not the div above
maybe it's a good idea to hook it into the ToC area for guides
yeah implementation will be different there
Hey @short snow, two things about sir-lancebot#745:
-
Should https://github.com/python-discord/sir-lancebot/blob/98f3cec4886586d398bfe567129b2e56c8ce4e7b/bot/bot.py#L50 be there? Or did you forget to remove it?
-
Once your branch is updated, should this part be changed? https://github.com/python-discord/sir-lancebot/blob/main/bot/exts/evergreen/latex.py#L96-L101
bot/bot.py line 50
await self.unloads_cache.set("unloaded", 'bot.exts.evergreen.catify | bot.exts.evergreen.xkd')```
`bot/exts/evergreen/latex.py` lines 96 to 101
```py
# As we have resource issues on this cog,
# we have it currently disabled while we fix it.
import logging
logging.info("Latex cog is currently disabled. It won't be loaded.")
return
bot.add_cog(Latex())```
It seems I was half right about the path
Pages that start with pages in the path are in the content app
Pages that start with resources are in the resources app
Why do I get this error when running docker-compose up in snekbox?
Creating snekbox_dev ... error
ERROR: for snekbox_dev Cannot create container for service snekbox: invalid volume specification: '.::rw': invalid mount config for type "volume": field Target must not be empty
ERROR: for snekbox Cannot create container for service snekbox: invalid volume specification: '.::rw': invalid mount config for type "volume": field
Target must not be empty
ERROR: Encountered errors while bringing up the project.
Hey @tawdry vapor do you know any fixes for this? Also, I'm not sure how to go about writing the test for nsjail args
What OS are you on
windows 10
change line 27 in the docker-compose to .:./
Now I get
Creating snekbox_snekbox_run ... error
ERROR: for snekbox_snekbox_run Cannot create container for service snekbox: invalid volume specification: '.../PyDis/snekbox:./:rw': invalid mount config for type "bind": invalid mount path: './' mount path must be absolute
ERROR: for snekbox Cannot create container for service snekbox: invalid volume specification: '.../PyDis/snekbox:./:rw': invalid mount config for type "bind": invalid mount path: './' mount path must be absolute
That's wrong
I believe coverage results will be incorrect if the same path isn't used
It's PWD on both sides for a reason
You can't use relative paths on the right
And I don't know of a PWD equivalent on Windows
PWD isn't a command on windows
So, basically it will never work on Windows
There's no way to make it cross platform
its pwd if on powershell
yep, but on cmd it is cd
github actions seem to be good now
I'm going to kick off the jobs that failed on main
alright that should be all the failed jobs re running now
you missed sir-lancebot though 😔
no one cares about sir lancebot
lol true
which runs failed
I ran them 😛
I care about sir lance!!
ah I thought you were talking about the errored lint jobs
Ahh nah, those are from when i tried to re-run the same one again
Use flake8, they said. Use poetry, they said. It'll make your life easier, they said.
its scanning the site packages ;-;
any way to fix this
If your venv is in your project’s directory (it really shouldn’t), mark it as ignored
its not
insert into messages select generate_series(11,150), 'user_id_here', 'f', NOW() + (random() * (NOW()+'90 days' - NOW())) + '30 days', 1234;
a quick sql statement I ran to seed metricity, in case it's useful for anyone
the weird time stuff is so that you get enough time blocks to pass voice gate
its not
Not really sure what to tell ya
Why is flake scanning your venv folder
Is that something your IDE is doing
it could be
well my lance clone isn't having issues anymore
so gonna move to #tools-and-devops since i'm still having issues
congrats on whoever made the blocking tag
@tawdry vapor for the nsjail args test, how would that work? I'm not sure what are valid nsjail args
It doesn't matter
It's even sufficient to pass "poop" as an argument and just check that it ends up where it's suppose to
ah I see
nsjail passing gas
whiiiiich staff member wants to review a literal 2 line change to a markdown file? https://github.com/python-discord/site/pull/507
D:
god I loathe coveralls
Coveralls has the same energy as fucking clippy
okay, review policy altered
just don't use it
ez
manually merge it lol
it took longer than that to upload than it took for joe to merge it smh
I've added a review policy item so site content can be shortcutted by 1 admin approval or 2 staff
everything is slower rn since flake8 is scanning my entire hard disk it seems
I tried multiple times
see either #help-donut or #tools-and-devops and Imma go to it with you
latter
I swear clippy was just a virus embedded into Microsoft office
Is there any reason the !eval command has code as optional but sends the help command when nothing is passed 🤔
Doesn't it have to be optional so it can show help when nothing is passed?
The error handler catches it and sends the help message
and tells you you're missing an argument
Snekbox's lint & test is failing 🤔
So for your first question, I kept it so that reviewers can test it out, and I could remove that towards the end.
coming to the second question, I wasn’t sure if I had to remove it so didn’t, I could do that now.
Sounds good 👍
why are these on different bots?
it seems related enough that it should be on the same bot
It's just something many commands do to show help when invoked without arguments. I suppose it is redundant.
I don't remember if help was always shown with the error.
git should be installed. there's a CI step for it
Hmm, wonder why it error'd then
Is there any other reason that error should be raised?
The install git job passed but the pre-commit just fails
I don't know. You'd have to check the log
How do you do that 🤔
Edit the workflow to cat the log file
Then rerun it
Would be a good permanent addition
If you can figure out how to make that step run only when precommit fails
How do you do that?
Do you know what cat means?
It's a command?
Are you asking how to use the cat command or how to edit the workflow?
How to edit the workflow
it's in the .github/workflows directory
Oh so you want me to commit the change
Yes, because you cannot run the workflow any other way.
Which is why debugging CI is annoying.
Try making it a separate step instead, like I originally suggested
ah
Feel free to amend and force push so you don't end up with a bunch of commits for debugging CI
Keep in mind it normally won't run subsequent steps if a step fails
You need to configure it to run even on failure, or ideally, run only on failure of the precommit step.
I think I found a way to do that
yeah that didn't work
@tawdry vapor I got it
and it failed
The log would be inside the container
ah my bad
Alright it worked this time
@tawdry vapor is it because it isn't in a git repository?
Hey <@&267628507062992896> you might know already but the github actions status embeds are down
Probably; the .git directory doesn't get copied.
I don't understand why it even wants it though.
It's set to run on all files.
Might be a recent update that changed the behaviour
this is the version of pre-commit for snekbox https://github.com/python-discord/snekbox/blob/main/Pipfile#L26 and this is the version for bot https://github.com/python-discord/bot/blob/main/pyproject.toml#L47
Pipfile line 26
pre-commit = "~= 2.9.3"```
`pyproject.toml` line 47
```toml
pre-commit = "~=2.1"```
Should I try downgrading and see if that works?
Maybe we should just copy the git directory over
Or git init && git add . might be simpler.
I think this one would work
but how do you do that?
git clone?
No you'd have to copy the .git folder over. I actually think initiating a new repo would be easier
Yeah, but it says .pre-commit-config.yaml does not exist
What the fuck
How did this ever work before
I don't understand how. My best guess is that the .dockerignore was not being respected in CI.
Maybe we should just unignore the config and the git directory?
I don't really like putting stuff in the container that's only used for CI, but I suppose it won't make a big difference on size. Plus, tests are already being included anyway.
Actually, copying over the git directory may fuck up the ability to cache layers.
Oh, I see how it was working. I completely forgot volumes are a thing in Docker.
It just relies on docker compose to mount the cwd
Since you changed the docker-compose volume, it broke everything
And as I said, that mount is wrong for other reasons anyway.
Didn't I only change it locally?
No. It's checked in.
Ah that's my mistake
So.... yeah just rebase and drop that commit along with the attempted CI fixes, though I suppose leaving the log cat is okay.
Ah it's part of some other commit so you can't just drop it, but you can rebase and edit it.
bot#1120 should be moved to lance
Ah nice it worked, I can't believe I made a mistake like that lol
I wonder if it's still valid 🤔
yeah it probably is
For bot#1597, do we even filter invites?
I transferred that issue
I don't understand what you are trying to say
That's interesting. I can't find a lot about it, except for runs that show an error stating that GitHub Actions encountered an internal error. It seemed to have been temporary, but I'll look into it later to day to see what was up.
haha
for the adding Off topic names using post request to the site, why are we passing the ot-name as a query param instead of passing it in the request body?
no, but typically with a post request, the data is in the request body
we could avoid some code in the backend as the ModelViewSet could handle it if we used request body
just don't, pass it with the context
you can't xD
@clever wraith off the top of my head, custom template tags
oh yes, that could work as well
we should have a custom template tag implementation in another app in the repo, you can use that for reference
pydis_site/apps/home/templatetags
Now that we've upgraded to python 3.9, sir-lancebot#610 isn't needed right?
Since those codes were added to http package
hmmm, I might need to re-read the PR, since it's removing the package entirely and relying on what the APIs respond with
might be something we want regardless
Depends on how we want to validate codes
Using the http module did save on requests out
but also it's not a huge worry, since it's not really a highly used command
i guess the question now is, are there codes supported by the status cat/dog API that aren't by the http module
i don't think there are any right now
!e ```py
from http import HTTPStatus
print(*(h.value for h in HTTPStatus), sep='\n')
@vale ibex :white_check_mark: Your eval job has completed with return code 0.
001 | 100
002 | 101
003 | 102
004 | 103
005 | 200
006 | 201
007 | 202
008 | 203
009 | 204
010 | 205
011 | 206
... (truncated - too many lines)
Full output: https://paste.pythondiscord.com/mojigoxoxo.txt?noredirect
there are 60 codes in httpcat
and 59 on status dog
62 in http
but that's not a real test, since they may not overlap
Its best to request them, or maybe just run a task every x hours to get all the codes from the site
I'd rather keep it simple within the bot.
I think we should just iter over the codes in http and check if both APIs support them
if so, we can close this PR
I can do it later after work if someone else hasn't by then.
Hmmm, so to only keep the codes supported by both apis?
We want to see if the codes supported by Python 3.9 are a superset of the codes supported by the two APIs
if that's the case, then we can use the http package to validate codes, as we are now
Alright, have you tested or should I do it quickly now?
Ah right, all the unofficial ones
I'm surprised about 306 though
I guess it's because it's no longer used /s
and
599 is present in cat but not in dog
306 is present in dog but not in cat
i don't even know half of them
I think we go ahead with this PR and drop the http module
it'll be more fun to be able to use the non-official codes
You don't know any of them, because there are only like 10 codes ever actually used
yep, chris
lol yes
Thoughts of ending codeblocks like these when the rest of the content is truncated?
420: Enhance your calm
Yea, 429 is too mainstream
yes it is kind of unnecessary imho. I even hate the bot randomly dm'ing me I hope there is a feature to opt out of bot dms when a channel is claimed.
yup was definitely not expecting it, prefer to keep it in the actual channel.
But definitely nice to have a log of your previous questions
Hey Sebastiaan, I've got them up and running for a few repos of mine, are they still down?
main.py lines 68 to 75
@app.get("/details")
async def get_details() -> Dict[str, Any]:
"""Get details about accessories which can be used to build ducks."""
return {
"hats": list(DuckBuilder.hats.keys()),
"outfits": list(DuckBuilder.outfits.keys()),
"equipments": list(DuckBuilder.equipments.keys()),
}```
it doesn't list manducks
should add a query parameter for duck and manduck?
cc @fervent sage
is the call to .keys() there superfluous? Since if you cast a dict to a list, you'll just get the keys anyway
They're up again, just not configured for snekbox
yeah, and that return type hint can be Dict[str, list[str?]]
Because 3.9
Yeah, I can mention that too
might also give a bump to quackstack to use python3.9?
yep
go for it
i'd rather
/details/duck and /details/manduck as separate endpoints
If we add more features, that would keep on increasing, I had like ?type=duck/manduck
or with some other query name
/details/{type}
before the details endpoint changes I'd also like to restructure the manduck assets so that they are structured the same as normal ducky for consistency
hey, I want to start contributing to open source, someone suggested me to try sir lancebot, can anyone help me out, all the issues are too overwhelming.
umm, well that would be third time we are changing asset structure lol, but i will look into later
btw, what happened about the deepmerge lib?
another question for that, what all do i list, just the accesories?
anything customisable that's related to a static asset
{
"hats":...,
"outfits":...,
"equipments":...,
"gender":...,
}
``` I think that's it
@fervent sage https://github.com/python-discord/quackstack/pull/45 pong, small PR, give it a look once you are free
I'll give it a review
alright, ty!
Does anyone know how to set the minimum width of a box in Bulma?
once that's done I can upgrade it to python3.9, already tested and it works perfectly 😄
does quackstack not give specific return type hints?
fastapi doesn't use return annotations
oh I thought it did
FastAPI framework, high performance, easy to learn, fast to code, ready for production
ah I see
The response model is declared in this parameter instead of as a function return type annotation, because the path function may not actually return that response model but rather return a dict, database object or some other model, and then use the response_model to perform the field limiting and serialization.
Well, I still think we should use the response model
why is it using query params instead? it's just more confusing and /details/{type} works fine
already done, not pred yet
alright, I will do a quick fix for that
could we swtich to uvicorn? its faster than hypercorn and supports reloads in docker containers
the second point is not really a point since we don't use that, but still
pushed, alec and toxic.
just curious, is it possible to support both path and query parameters for the same parmeter, type in this case
uvicorn is good
who is kgolawaski?
yep, is that a yes or a no?
toxic and his nitpicks 🙇♂️
I don't know about Hypercorn, but my experience with Uvicorn and FastAPI has been good
can we add that kek here 🥺 ?
and about upgrading to python3.9 on quackstack, i could do that together
Yeah, I think they can both be changed in that PR
alright, just need to get the approve then now
merge merge 
toxic can merge 👀 you got powers boy
I dont want to switch to uvicorn because it's not fun dealing with the "why didnt you use hypercorn its better" which is the reason i went with hypercorn to start with, and as for speed im pretty sure quackstack gets all of 1 request a month, and the slow bit is image generation not the asgi stuff anyway
I just noticed the green merge button after I approved lol
When is this PR going to happen? just curious
soon, currently working on smth else
i am talking about startups, i personally saw uvicorn starts apps faster
lol :stonks:
hypercorn starts up faster for me /shrug
👀 alright, lets just leave it then, and python3.9 upgrade?
that's exactly what i said lmao, ok
i like uvicorn more just as a general thing, and I can just tell people who get annoyed at me for using it "lol /shrug"
I hereby give you permission to tell people to "get wrekt" if they ask about hypercron or uvicorn since it.. really doesn't matter
hmm, i saw people moving from hypercorn to uvicorn but never the other way around
That's one tool I never looked into and I don't plan to
I only used hypercorn because i was told by 2 people "ew dont use uvicorn hypercorn is better"
I like uvicorn better ¯_(ツ)_/¯
It looks so uninteresting
so i decided to give it a shot
the tool here is? akarys
ty, i got the source of kek 🙃 for #community-meta
Uvicorn and the similars
oh
also we can continue the other issues on quackstack now, since we have enough features on the api now
and not deffer them, like i commented on the flesh out readme issue
I still need to specify S3
we should also have a landing page
probably something similar to https://policy-bot.pythondiscord.com/
I dont have a way to test s3 stuff locally 
just project logo and docs
lol I'll just provision you creds, but minio is good for self-hosted S3
not for S3, no
minio is a self-hosted S3 server
quackstack will eventually send uploaded images to an S3 bucket, since ideally we don't want to serve static files
Basically, making the setup complex lol
not really
S3 is simple
you just plug in your endpoint and it's usually just one call to upload
like
simple really is in the name
S3 stands for Simple Storage Service
Yeah, I am reading his biography right now, but I would need to get Amazon services account.
pydis would be using linode's S3 compatible object storage not amazon btw
yeah
:)
Oh right
need devops daddy approval
Joeeeeeee
btw, is ledger still in development didn’t see any progress on it in a while?
linky link
pending me finishing exams
quackstack#46
Oh gl
Alright @short snow those changes you asked for have been made
Yeah, I have approved it already
I don't think that was the right change
Which one? Link?
🚀
Weeee
Joe I demand you to look at #community-meta or any other admin seeing thi
Alright, will still have a look
Uh oh, that’s not what I meant
Also I think for quackstack#12 , it should be done by someone who contributed to the project or has watched it closely, since only that person would be able to explain it properly
If quackstack is stable enough, site#465 isn't stalled anymore, right?
Yeah, quackstack is stable enough
@clever wraith conflicts still need to be resolved (just pull from upstream/main and run poetry lock). Regarding your comment, if I did
.cowsay abc <three backticks> new stuff
It would place the zero width pace between a and b
I don't see the point of doing that
how difficult would it be to have prettyprinted eval output
by the time eval output reaches the bot, it's already a string
so we'd need to do that inside the sandboxed process
I think it's also clearer to the user if they receive the direct output their code generated, can always pprint in your code
yeah
Waiting for a consensus on https://github.com/python-discord/bot/issues/1545 if anyone has a bit of time
There are role restricted tags?
The feature is there, no tags that use it afaik
Ah I see it now
@patent pivot do you mind if I implement the S3 thing, I have a couple ideas and I'd love to get more familiar with object storage in general :P

lmk if you want an S3 bucket
to test prod with
i ahve free linode credits so I'm gonna put them to good use before theyre gone
Is someone implementing the upgrade to python 3.9 on quackstack? If not I could do that 😛
feel free, im not 100% on what i actually need to change so im not touching rn 
I think you get 100$ for new linode account for 2months
^
@trim cradle can you edit the issue description to say that off topic names are going to be rerolled and set as in-active or soft-deletes them instead of delete?
https://github.com/python-discord/bot/issues/1559
I just ran lint in quackstack and every single file got changed 🤔
I also see we forgot to update README.md
so your goal is to implement both the reroll and archiving-of-old-names functionality in one PR?
the reroll will be followed by the archive
we wanna change the channel name and mark the old name as inactive, meaning, it won't be considered to channel names in the future
https://github.com/python-discord/site/issues/490
here is the site issue
approved by joe
@eternal owl I don't think I have the bandwidth to wrap my head around what changes you're moving forward with. Do you think you can leave a comment on the issue in question?
you want me to leave a comment about the site issue and updated implementation? not sure what you mean by in question 😓
you asked me to change an issue description. I'm asking if you can leave a comment on that issue
ah right
Since snekbox#108 was merged, can I continue bot#1234 in a seperate PR?
probably LF -> CRLF line endings
they likely won't make it to the actual repo on push
ah I see
Also quackstack#47 👀
Oh right
@patent pivot if you don't mind reviewing 👀
done
ty
yes
What doesn't let you?
Just rm -r .venv assuming the directory is named .venv
It shows the full path right there
You can use rm -r to delete it
You technically don't even have to delete it but it'd just be wasted space
For the helpdm on/off command should we delete the command the user sent and the embed that the command sends?
Like after 5 seconds or something like that
Global opt in/out
ah, then don't worry about deleteing
alright
Don't see a reason for it to be allowed outside of #bot-commands where nobody cares about the history
Yeah, just an idea hemlock threw out there just wanted to check before I did it
@tawdry vapor can give me superuser in the test server? I was told you can do that.
Yes
Thanks
the easiest solution would've been running deactivate first
seems you got it resolved in the end
@patent pivot If your still evaluating/busy thats fine but just want to make sure you didnt miss the requested re-review of sir-lancebot#733
I saw, but am busy until the end of the week I'm afraid!
That is perfectly fine thanks for letting me know!
This comment seems unresolved https://github.com/python-discord/sir-lancebot/pull/733#discussion_r632995532
done :)
how do y’all host y’all postgres server
sir-lancebot#614 and sir-lancebot#649 need one core dev approval each, both have 2 staff aproval as of now
on our Kubernetes cluster
for 614, I think we should ask #dev-branding to make us a highres icon and host it on our branding repo
rather than rely on the discord cdn link
it uses the same link used by @stable mountain, i think which is a emoji on the emoji server, since there are few which use the cdn links
will allow us to keep it consistant if we use it in future
hmm, which command on python uses it?
Again, this might not be needed, but could be a good idea to start doing
the error handler, its command suggestions
@vale ibex what icon is this?
QUESTION_MARK_ICON = "https://cdn.discordapp.com/emojis/512367613339369475.png"
in 649
!hep
oh, yea mods don't get suggestions
kosa you are doing it? I will scratch out my message in #dev-branding then
you can leave it for now incase anyone else wants to do it
Btw it was used as cdn link, since you can't put emojis in set_author.icon_url
yea, having a cdn link is fine
was just mentioning that we could take this as an opportunity to make and host our own icon
but not needed
alright 👍
Could you resolve conflicts, I'll give it a quick look and then merge
sir-lancebot#649
nice
free for another one lol 🙃
You don't lint locally?
"used github itself" 😛
Shaking my smh
weee
.ielp
is it free?
It isn't, no
We pay around $120/mo for hosting, there are much cheaper solutions available, but an entirely free DB is probably hard to come by
Yea, we're looking into it
should be back now
ok yeah, what was the issue?
jaegger issue afaik
mem leak
GoLang being GoLang
Lol
!sf 844950388368998502 844950408933015583
844950388368998502
Created at 2021-05-20 14:51:11.006000 (37 seconds ago).
844950408933015583
Created at 2021-05-20 14:51:15.909000 (32 seconds ago).
844950630317555713
Created at 2021-05-20 14:52:08.691000 (9 seconds ago).
844950634931421234
Created at 2021-05-20 14:52:09.791000 (8 seconds ago).
It's pretty fast now
!sf 788119126450765844
You are not allowed to use that command here. Please use the #bot-commands channel instead.
For the !timeit command, it runs the code like 5 million times. So, if you have any print statements, it's 100% going to get terminated because snekbox limits outputs to 1 MB. What should I do about that? (Keep in mind it's possible to limit the amount of time it runs)
Limiting the number to like 1000 seems to be fine, but then again, doing !e print("a" * 1_000_000) also gets the process terminated. Maybe it's just enough to put a note in the docstring?
I just did python -m timeit and it ran 50 million times
that's how it gets a more accurate number
Any reason why ok_handbutflipped isn't in constants if not I just added it and I will push it whenever I finish this issue.
Or is it in the actual running bot just not in the repo?
I could've sworn I have seen it with infractions and stuff
What's the url at the time when it fails?
Nvm it's not
What's one set?
what link is it bringing you to?
Can you show one PyDis url and the corresponding GitHub url that it takes you to?
Okay. But what's one actual example where it fails?
Then why don't add .md
This is supposed to be /contributing.md, not /contributing/
https://github.com/python-discord/site/blob/main/pydis_site/apps/content/resources/guides/pydis-guides/contributing.md takes you to this, which is what that page actually is
I think when you are parsing the md files, add a variable to store the file location too from root, I am not familar with the site source
Any thoughts on this?
Patch sys.stdout to use a fake devnull object I'd say
Yeah but doesn't timeit need to print
Oh hmm
can probably use contextlib.redirect_stdout then
If you do use it, don't forget to delete it from the scope before calling the user code though
I'd keep the stdout as is. I don't think anyone really has a reason to time prints and if you intend to do it from invoking the module directly then you're just adding complexity
In what way do you plan to implement the command?
For the workflow to run?
It passes the ["-m", "timeit"] args to python and finds the n loops, best of 5: n <unit> per loop at the end of the stdout
Does timeit adjust the runs and loops depending on the runtime?
Yes, unless you pass the --number | -n argument and it isn't 0
It would be cool if timeit redirected the output but ¯_(ツ)_/¯
oh, okay
is your IDE not saving to disk immediately after you stop typing?
I think so
Well, at least when you tab out
It should be fine
Both should work fine. I've been doing the latter, and nothing different happens
I like the first on because the second one doesn't let me put spaces between = in .env
It means it wants you to have a docstring like this```py
"""
Attempt to display a tag by interpreting the command name as a tag name.
The invocation of tags get respects its checks. Any CommandErrors raised will be handled
by `on_command_error`, but the `invoked_from_error_handler` attribute will be added to
the context to prevent infinite recursion in the case of a CommandNotFound exception.
"""
not like thispy
"""
Attempt to display a tag by interpreting the command name as a tag name.
The invocation of tags get respects its checks. Any CommandErrors raised will be handled
by on_command_error, but the invoked_from_error_handler attribute will be added to
the context to prevent infinite recursion in the case of a CommandNotFound exception.
"""
https://github.com/python-discord/site/blob/308d39b4b4e3679c5e2519a97223da7230e5431d/pydis_site/apps/content/views/page_category.py#L76 why not add a parameter for link?
pydis_site/apps/content/views/page_category.py line 76
def _get_page_context(path: Path) -> t.Dict[str, t.Any]:```
https://github.com/python-discord/bot/blob/b0b90c8b52f55e19e287e5cbe075967b887169c7/bot/exts/utils/snekbox.py#L13 I'm never trusting pylance auto import again lol
bot/exts/utils/snekbox.py line 13
from discord.ext.commands.core import Command```
!d django.http.HttpRequest.get_full_path just get the full path and append it at the end of the GitHub, no need to worry about the host, btw yes that looks right
HttpRequest.get_full_path()```
Returns the `path`, plus an appended query string, if applicable.
Example: `"/music/bands/the_beatles/?print=true"`
lol
You didn't see this?
Umm, so you can get the full path and append it after the GitHub link
but yeah I'm about to force push again 😛
Toxic is not that toxic yet, so be happy 😃
I think I'm ready to PR
I know I am bad at explaining this, haven’t worked with django much, so what you are right now are doing is replacing the host right? That is the path I.e. the url after the host remains the same. So you can just get that full path after the host and add to the GitHub link you were switching the host with.
Example, a.com/a/c/d, say this is the url, so full path is a/c/d. You can just put this after the GitHub link.
You can get the full path like said here, #dev-contrib message
except that you'd replace pages with content IIRC
I should've known there were tests for snekbox 😔
especially because of bot#1600
Also tests that I haven't edited are also failing
Should I also write tests for the timeit command?
@eternal owl feel free to assign yourself on the issue if that's something you want to work on.
ty ty
I think I broke something in the tests, because when I ran it locally, it got stuck, and the tests have been running for ten minutes https://github.com/python-discord/bot/pull/1602/checks?check_run_id=2633490481
I've cancelled that run for now then
I found the problem though
That's a very big number 👀
bot#1602
@sleek steppe did you get in contact with the owner of bot#1234 before going ahead with your PR?
cuz he might still wanna continue working on it
the pr is marked as up for grabs
ah okay, mb did not see that
Yeah it was up for grabs and stalled until snekbox#108 was merged
@sleek steppe do you think bot#1234 should be closed now that you're working on the other PR?
oh wait yeah I'm totally closing this, nvm
yes
Run .reddit in #sir-lancebot-playground 😄
O 😂 mb
Yeah, it was on @stable mountain before, but it was migrated to @dusky shore recently
if there any interest from literally anyone other than me in having the ability to run commands inline {!e print("lol inline command")} 
!e print("lol inline command")
@fringe sphinx :white_check_mark: Your eval job has completed with return code 0.
lol inline command
🤨
He means that a command would be invoked if it's {!e print("in these brackets")}
oh yeah that would be neat
ive made a proof of concept before and the implementation is like 10 lines
Does it check if there's a backslash before it 👀
actually yes
oh nice
it's not perfect because its regex not an actual handwritten parser
but its not awful either
when it's working you should make a pr or smth cuz I'd use that
what for lol
for message context
like 'here's how this will work: !e print("here's how it works")'
my main motive i'll be honest - and this would work as a standalone feature - is embedded tags, so for example the message:
Hey, there's actually a brief tag explaining how to do that: {!customcheck}
that would be useful too
meaning i no longer need some weird phrasing like !customcheck this tag explains...
mhm
cause i like to give context when sending a tag rather than just drop it there, but 99.9% of my usage of tags is in discord.py which often has a fair amount of slowmode, so being able to easily explain and invoke in one message is 
yeah the same for me and pygen
know what i'mma make an issue for that now
That would be nice
!e what's wrong with invoking like this?
print("hi")
@balmy sparrow :white_check_mark: Your eval job has completed with return code 0.
hi
!customhelp foo bar baz these words do not matter
Custom help commands in discord.py
To learn more about how to create custom help commands in discord.py by subclassing the help command, please see this tutorial by Stella#2000
but does it also check if its part of a code block?
btw there's a regex for that in the eval cog
@sleek steppe @eternal owl I had mentioned your changes on the wikiguess PR, if you could give it another go 😄
link: https://github.com/python-discord/sir-lancebot/pull/618
FYI: Scheduled downtime of PyDis Site from 21:00-23:00 UTC today.
I noticed that the async-rediscache repo no longer sends github events to #dev-log since the transfer to @hardy gorge's account, is that a conscious decision? It still feels like a project tightly related to the pydis infrastructure and having an event feed may be good to raise awareness of existing issues & generate more interest in contribution
@green oriole I had a question with bot#1588 , for start and stop time, will it be passed as integer or datetime string which is to be parsed.
Like: !modpings schedule 7 20 so from 7am to 8pm
or like: !modpings schedul 7am 3pm?
Can we do both with a custom parser?
It should be able to handle 7, 7am, 7:30 and 7:30am
7 and 7:30 is ambiguous though right
I'd expect 7 and 7:30 to convert to the AM equivalent
yeah, by 7 and 20 I meant 24 hour format
sure!
So yea, Akarys's point of a custom parser would be good
similar to what we have for the duration one now
So user could do either of your examples and they'd both work
or even mix and match
have we considered just using dateutil's parser?
Yeah, my example wasn't clear
Like that
there's a dehumanize thing I've seen
which might be appropriate
but that's from memory, so might serve a different purpose
I'm getting Site matching query does not exist trying to log into the admin of a fresh django setup for site
I have set up the hosts file, so I'm trying to hit http://pythondiscord.local:8000/admin
I was looking at the scheduler, it doesn't support repeating events as of now, so i think there are two options right now for scheduling modpings.
- Allow scheduler to support repeating events.
- In
coroutinewhich is ran on hiting the event, we can just add that event again by shifting it by 1 day
I am not really familiar with how scheduler is implemented, so I think I would go with option 2
Does anyone know if there's an easier way to add a custom filter other than using get_queryset? I am very not familiar with DRF
...I need a guinea pig on the test server, if anyone's available for that?
||me||
👀
I'm in the server, feel free to do whatever to my account
I could make this really complex but let's.. not
If you need a second user, you can have fun on me too
So I've added a types filter, a permanent filter, and expires_at_gte and expires_at_lte
give me a ping when someone responds
At the moment it simply runs the rescheduler until the api informs it that there's none left that it might need to reschedule in the future, then it stops
Are you using SearchFilter and OrderingFilter from drf @sharp timber ?
No
hmm why not?
They wouldn't apply?
wouldn’t they?
Searchfilter is for searching a field, right?
I'm not searching, I'm applying a filter
I mean, you can use it to only return infractions that has active=true for example
that’s the search filter
what
Oh wait
no, that's specified via filter_fields right?
Yeah yeah