#dev-contrib
1 messages · Page 118 of 1
It’s not a feature in poetry, it is in pipenv
Ah
The second one there shouldn’t use a task though
We don’t have a task called pre-commit
Or just pre-commit without the task if you want to run pre-commit
Yeah
@vale ibex one of the workflows failed on @dusky shore after your commits were pushed 👀
specifically, build
worked now 👍
https://github.com/python-discord/bot/pull/1487 needs review
Are you waiting for another review before addressing mine?
Yes.
Making sure what needs to work, works, before taking more time to see if refactoring should be done.
Repository labels need changes according the python versions
Bot still has python37 label, and Lance has python38
Also, https://github.com/python-discord/bot/pull/1446 needs a review
have you addressed kwzrd's latest review in that PR?
There a few questions I had with it, they told me they were gonna reply to it last week, probably got busy.
I have commented on the changes
i don't see any "required changes" added in the PR after this review
the review comment directly after that which you marked as resolved is also not seen in the PR
One second, lemme see
Aha, that last comment, I had mentioned it locally, forgot to unresolve it when you told me to only resolve on pushes
I haven’t pushed since i was waiting to push all changes together
when you told me to only resolve on pushes
I don't remember saying that
I haven’t pushed since i was waiting to push all changes together
that's not really a good idea, since kwzrd wouldn't know that you've addressed his review comments then
Yup 👍
@brazen charm would you mind if I took bot#943, or would you like to do it?
You can take it
Thank you.
xith the changes you've asked for on sir-lancebot#758 are done. please review when time suits you.
ty
Dawn had done a PR to add a few more superstarify names, https://github.com/python-discord/bot/issues/662 this could probably be closed then.
I don’t think this is needed any more, https://github.com/python-discord/bot/issues/716 the guide pretty much sums it up.
Guide here points to, https://github.com/python-discord/bot/tree/main/tests
what do you guys use for python bot eval
https://github.com/python-discord/snekbox , it runs the python process in a sandboxed environment
What does it mean?
log = logging.getLogger(__name__)
__name__ is a built in for the current file’s name
So where we can see the logs ? In which file
@dusky shore
I don’t think that writes to a file
bot/bot.py line 14
log = logging.getLogger(__name__)```
That part has nothing to do with the output stream besides formatting
Line 49 of the init defines the handlers
It outputs to bot/log/hackbot it seems
Is that compulsory to create logs?
I don’t understand your question
it's giving the log instance a name, in this case it's being set to the name of the module
so in the log output you can see which module is writing which logs
it looks like the logs should show up in bot/logs/hackbot.log
bot/__init__.py line 46
log_file = log_dir / "hackbot.log"```
Ya, I got it, it will going to create file
ye, so the log format is being set here: https://github.com/python-discord/sir-lancebot/blob/4970d9642f2a3eed8a3db5e1c438ee8cd4be72d9/bot/__init__.py#L73-L74
bot/__init__.py lines 73 to 74
logging.basicConfig(
format="%(asctime)s - %(name)s %(levelname)s: %(message)s",```
name is the logger's name
which is being set by this in each module:
log = logging.getLogger(__name__)
so each module has its own logger instance with its name set to the module's name, and as a result, each line in the output will contain the name of the module that made the log
Okay, Thank you
What does that /do?
Path("/foo") / "bar" = Path("/foo/bar")
i uh....
nocturnal 
ye as Toxic demonstrates above, pathlib joins path components with the division operator
or rather lets you join them with it, its not the only way to do it
I let myself hold the opinion that it's unnecessary, ugly, unexpected, and borderline operator abuse

That's horrible and I completely forgot about division which is why I was forgetting here
agreed
same
im pretty sure when laundmo first showed me it i was like "what the fuck? thats horrible...!"
It's both cool and horrible abuse of the system
Cool because it shows you can change that behavior
it came up in pygen too, today
Horrible because it's horrible, bad, and operator abuse
But it does show something I wouldn't have realized otherwise
Is anyone against me turning off auto-restart of lance and bot?
I'm getting frustrated whenever I start up docker desktop that I need to stop both of those before I can use postgres/redis in another container
since we use the same ports for each across the board
What was the initial reason for setting it to always? unless-stopped or on-failure seem more fitting depending on what it was
You can override it in a docker-compose.override.yml file in the meantime
Ah, yea that's a good point, I'll do that for now
Yea, one of those other two seem better
It's currently always
Yea, probably. Since if it crashes it restarts automatically
original reason was so that it restarts if api/db arent reachable but thats long since solved way better
i have nothing against it
I get annoyed by auto-restart, so I'm definitely not against it
i've seen joe use an sys.exit() to restart the bot lol
yea docker-compose is only for dev, k8s is what's used in prod
I'll push PRs in a bit now then
I'm thinking unless-stopped is best here
schould be a 1 line change
oh, how?
does it not run in docker on kubers?
not with docker compose, no
hm
okay
ah
inb4 pythondiscord/mainifests
ah
lol
that's the official installer lmao
ah
use
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python -
install-poetry.py not get-poetry.py
lovely lol
1.2 is breaking
got bot#1625 and sir-lancebot#770 up for the changes to docker-compose
How about now?
@vale ibex both PRs you made can be merged now.
oh lmao i thought i finished the review on it
i just left the tab open without clicking the submit button
lol
@fervent sage ty for review
I've never gotten unit tests to work this fast, I think I'm finally understanding them
there anything else that needs reviewing (preferably on lancebot because it doesnt require site to be up lol)?
Take this for now: https://github.com/python-discord/sir-lancebot/pull/756
that was a very relaxing non-code review, very nice
lol, compared to last time take this as a relaxation therapy
yeah lol, when i only need to review (mostly) non-code stuff i dont have to checkout the branch (or worse, fork) and i can just run through and look at stuff
that being said I have a grudge against the current quiz system that will need a code change
website code updated, i'll fire up pycharm and get started now :D
why are question answers in the format "answer1, answer2" not ["answer1", "answer2"]
ah... long story
basically it was easier to manipulate in the code using strings instead of json lists
json is nice because it does have structures like lists lol
true. when our cat devs was in phase one - gathering up quiz entries for "math" and "science", we first went for "ans1, ans2", then changed to list, then changed back
what if i want to use a , in an answer though?
the forbidden question, one which i have so long avoided, has been asked
simple: just don't add those answers-
thats not a good answer lol
when i made the linear system of equations dynamic question, i changed the format to a & b instead of a, b
if the workaround to a problem that shouldnt exist is "dont do it" thats bad lol
so just avoid it
😔 true
@fervent sage all your changes have been implemented, mind doing review time ™️ #2?
trivia_quiz.json is typing...
eh the trivia quiz is static questions which should be editable by pr
so json is good (that being said, i wouldnt mind yaml
)
ah okay
@fervent sage i deleted the word "public", it seems as if when i deleted it the first time it didn't save or something
@sleek steppe all your changes have been implemented :D
@patent pivot this is like one of the randomest things ive suggested so far lol, but what're the chances we (pydis) can have some sort of "Learn to API" type repo that people can just add cool features to as requested, kinda like lancebot but fastapi
This is 100% not at all related to the benedict cumberbatch discussion 
hmmm, an interesting idea
probably one to raise as an org ticket, and one that I can also raise with core devs
time to put on my spec writing hat
I think it's a bit out of scope, and without a clear direction for an API could potentially be more harmful than educational, but I'd be open to a discussion on it
starlette > fastapi
opinion
fastapi abstracts too much away imo
not if youre making it so there's a really low bar to entry
ig..
CI is currently running the branch for pytest-xdist
Hoping to see some nice performance improvements
Oooh it's done
Coverage broke, but it's down to 50 seconds from 90 which is pretty nice
Ah right, that makes sense
I didn't include the test directory in the new coverage
It didn't make much sense for it to be included in the first place
You aren't testing your tests
Should be ignored then
Why not? You should make sure that every test runs, and there are helpers under the tests dir which are tested
the first .rcaps r
yeah ik that, i am talking about This year 2021 is not yeat supported
oh aight!
I can't reproduce it
yeah even I can't dunno how that popped up
do i need to have redis locally?
did a system reinstall due to some problems so had to make the setup again
https://pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/#environment-variables
A guide to setting up and configuring Sir Lancebot.
the yellow box
@exotic ember regarding #dev-log message, should make a dynamic question object or should I make those class constants file constants but they don't get used anywhere else
another option would be to add () in each call
Also regarding your main comment, i think that should be mentioned in a separate PR, it isn't really related to what I am working on
in that case I think classmethods are best suited
I don't feel like the fixes for these should go in this PR, so just keep in mind the above quirks for this game so the bot still works for this topic until the fix is made. A separate issue should be created after this PR.
ah didn't reach that part yet. SHould I open a issue for it? I don't think I would be able to mention it anytime soon, got units coming and already have few issues assigned
I'll open that issue, no worries
alright 🙂
in ttt, there is a usecase that when before all emojis are loaded, if we kinda click on any emoji, it does not play that move.
in practice, that isn't too much of a problem, simply removing and readding the reaction will work
trying to handle that scenario brings up some pain points to me, like what if after emojis load there are multiple reactions added by the user
makes sense
also i have a linting question
in js, eslint is good enough to enforce us to use const if we don't manipulate variable, while altho its not a headache, can some linting be done in terms of lists to enforce to convert them as tuples(if they are constant)?
I don't think that's currently possible
oh i see, so do we define the rules or we use some standards? i think we use pep8 right?
we enforce certain linters in our projects, I just don't think any of them check for unchanged mutable variables
oh i see. alright thanks.
kosa question about no infinte loops of fetch, earlier i did such that it will run until it has 10 questions and error responses are below 3, should i do the same?
what happens if error responses reach 3?
it would unload the cog and do a error log
why not disable the wikipedia topic and allow others?
sounds better, will do that
i found something that i see is going to be really great integrated into the discord . i dont want to tell anybody about it until i've looked further into how the python bots operate . id be upset if someone else got into integrating it before i could get into it . i see it is a large addition and is going to work to solve a problem for the community 🙂
if you open an issue we can reserve implementation for you
when you open an issue you can optionally select to add it yourself and then it's yours until you do it
i will create an issue thread when i have become more familiar with the bots' code and post a screenshot of this pair of messages in the issue.
hey @clever wraith just in case you didn't notice sir-lancebot#760 failed linting
I'll give it another look once it's passed
Cool, I'll take a look after work
kay, thanks
The year 2021 is not yet supported.
This else is updating the message_caches on every message... for every channel on the guild... Is this the wanted behaviour?
Personally I would have expected that type of functionality to be on the bot, not within the cog specifically for help channels.
https://github.com/python-discord/bot/blob/main/bot/exts/help_channels/_cog.py#L466-L470
bot/exts/help_channels/_cog.py lines 466 to 470
if channel_utils.is_in_category(message.channel, constants.Categories.help_available):
if not _channel.is_excluded_channel(message.channel):
await self.claim_channel(message)
else:
await _message.update_message_caches(message)```
update_message_caches() has a check that the message is from an in-use help channel
it only actually updates ^ https://github.com/python-discord/bot/blob/main/bot/exts/help_channels/_message.py#L51
bot/exts/help_channels/_message.py line 51
if is_in_category(channel, constants.Categories.help_in_use):```
ahh ok
IG that could be moved for clarity
We could if we wanted to
well if the redist is global, might as well be on the bot instance. right?
^
as that represents the whole instance
IE ```py
if channel_utils.is_in_category(message.channel, constants.Categories.help_available):
if not _channel.is_excluded_channel(message.channel):
await self.claim_channel(message)
elif channel_utils.is_in_category(message.channel, constants.Categories.help_in_use):
await _message.update_message_caches(message)
and then we can remove the check in the func

wdym? This is on the bot right?
Yeah, should someone make an issue for that?
Yea, I'd be hesitant to just make this change, since there might be a reason for it to be this way
IE another piece of code calling that func or something
its in the help_channels cog. pretty sure you can have event listeners on the Bot class itself.
If it only needs to cache message channel message. then it makes sense, I just assumed from the name it was all channels
Yea you can, but I'm not sure why having a message listener that is only used for the help channel system makes more sense outside of the help system cog
mhm, it was a misunderstanding from the name. I thought it was all message caches
Nah, the caches used are specifically the help system ones
Just checked, there isn't 😛
➜ bot git:(main) grep -r "update_message_caches" .
./bot/exts/help_channels/_cog.py: await _message.update_message_caches(message)
./bot/exts/help_channels/_message.py:async def update_message_caches(message: discord.Message) -> None:
damnit why do you have to be faster
Oh lol
lol
It's because I used ripgrep
i should just keep a terminal open for all popular pydis projects ready to grep as needed
Lol Griff abusing mod power
He must be dealt with
This is why you don't drive
hello, i'd like to work on https://github.com/python-discord/site/issues/391, is there anything blocking it or preventing me from taking over it?
pythondiscord.com - A Django and Bulma web application. - python-discord/site
Doesn't seem like it
It may have been blocked at some point due to dewiki or something, but I don't realistically see a blocker now
excellent
👍. It's sort of an issue that will solve itself since when we split out API and use https://github.com/python-discord/logcord then the subdomains will go, but I see no problem making that shift now.
the other django apps in site will still need subdomain change though, no?
ah, i missed that staff already has an url
Yeah, I fixed it
unless it failed again
it did
fml
it is currently failing, at this very moment
or you can do poetry run task precommit which won't let you commit unless lint passes
You can do both
true
sorry about that.
np
If you messed up the one, you have to do both
no worries 😄
My only suggestion would be setting up the pre-commit hook locally
will save a lot of effort 😄
@twilit juniper If you have build failing locally, you can git commit --amend --no-edit. Source: https://dangitgit.com/#change-last-commit.
Yeah lol I will from now on.
git add the changes first though
tbh you should read that site if you haven't already
it has the good stuff
There's also fixups and rebases for mistakes that are older in the history
getting an error while executing poetry run task start , starting the python bot
server for the first time. (running in virtualbox)
#help-grapes
#help-grapes message
Hmm, I'm getting linting errors trying to do this in a function sig requested_state: allowed_strings("yes", "no")
undefined name 'yes' flake8(F821)
same on no too
anyone seen this before?
happens in vscode and when I run poetry run task lint
Use a noqa to ignore it
yea, was just confused where it's coming from lol
It interprets the strings as forward refs
ahh right
makes sense how it's happening now we've gone to py3.9 and wasn't before
since I'm assuming this is due to the string annotations added in 3.9
What do you mean? Forward refs are included in PEP 484 and all uses of that annotation should be noqa'd unless there is a coincidentally existing name in the scope
ohh right, it's my misunderstanding then
I'm confused how this line doesn't raise the linting error though https://github.com/python-discord/bot/blob/c89e3fd7e10b686acc1ecb1182d78abbafaea1b1/bot/exts/moderation/metabase.py#L94
bot/exts/moderation/metabase.py line 94
extension: allowed_strings("csv", "json") = "csv"```
both of them are valid names
oh, yea ofc, they're builtins
Being stdlib doesn't matter much, but they're imported at the top which defines them so the linter is happy that they could be resolved if it was an actual forward ref
Joking aside, that has fallen behind a bit, and should be updated
there are 9 env vars in the config, yet only 5 are documented
whats the metabase for?
I wonder whether there’s a place on GitHub for issues about documentation/install process of the python bot . Documented a report of the process while installing the bot locally for the first time . Consists of issue, then comment
I see It’s long to post in this channel
I see maybe on the site project GitHub (instead of the bot)
Are you following our contributing guide? I know we looked into updating it a bit ago and I think had an issue open for feedback
question regarding modpings schedule issue, should this be implemented along side the current modpings on/off feature.
If yes, should the role be handed in even if they are on the break?
~~Also to implement parsing, ca I add dateutil parsing, https://dateutil.readthedocs.io/en/stable/parser.html~~
bot uses this
You may want to take a look at https://pythondiscord.com/pages/guides/pydis-guides/contributing/site/
A guide to setting up and configuring Site.
going afk, ping me when you answer
so we can pull data out of metabase and play with it on the bot
primarily for moderation stufff
The fastest, easiest way to share data and analytics inside your company. An open source Business Intelligence server you can install in 5 minutes that connects to MySQL, PostgreSQL, MongoDB and more! Anyone can use it to build charts, dashboards and nightly email reports.
its for making those graphs joe shares in ot channels
@exotic ember for sir-lancebot#772, what are the commands to copy the bahviour? I think I had made a fix for it when i was testing it out for the update emojis PR.
wanted to confirm it
Yeah I did that, but didn't get any error
right, that's my bad. I've updated the reproduction steps to make it clearer
the implementation detail is that the user is placed in the players list before the AI, so the check always short circuits before it reaches the AI in the check if the command is called by the same user
with a different user, it does not short circuit and thus errors out when it reaches the AI
could you join my test server for a minute?
are you running with debug?
that's not the issue, you need to use another user to do the second .ttt
commented the fix, someone can take it up if they want it now
ah
@clever wraith in case you missed out, you have a few comments on sir-lancebot#699
Is it intentional that the purge command doesn't avoid purging pins?
What do you mean
If you delete a pin, it will be gone, right?
Oh, avoid pins
I see
I don't think it is an issue
there you are, was waiting for you to come online @green oriole
perfect
is it possible to take two parameters like 10h pm and 10h?
Like what would the parameter format
take them as a full string (*, schedule: str) and write a regex expression for that?
whoops I had review the wrong pr, that was meant for python-discord/sir-lancebot#760
is there way to remove a review?
Please just stick with the same time parsing everything else in the bot uses
yeah, bot uses datetutil already
Also I’d prefer going for 24H format
yup
yes i followed the contributing guide for the site and the bot . I'll look for the issue
update: i saw that the most recent issue that was most-related to the docs in the bot repo was this . https://github.com/python-discord/bot/issues/496 which opened in oct 2019 and closed feb 2020
edit:
i opened a new issue
https://github.com/python-discord/bot/issues/1631
Not sure if it the right place, but: This page: https://pythondiscord.com/pages/contributing/bot/ could be better (although it is already pretty good) Rename #bot-commandsand #ot-offtopics to bot a...
We need to add a option to make task repetitive on the scheduler so that I can work on the mod pings schedule, it would add a parameter called is_repetitive: bool = False, keyword only parameter interval: int = 0.
While deleting the task, if this is true, then it would re-add the task (or just don't delete the task) after adding interval on the time.
cc @tawdry vapor as you are the codeowner
You can dismiss it I believe
You have to go to the reviews at the bottom above merge, press the three dots and then dismiss
Lemme know if you don't have the perms to do so
I don't think jason can dismiss reviews
you can possibly dismiss your own without extra perms
Yeah, that was my thought, although there are some pretty tight restrictions on who can dismiss even inside an org
Nope
what PR is this?
Why are you sending this issue here? This channel is for python discord project discussions
@noble hull Please read the descriptions of channels before posting. This channel is for Python Discord specific projects.
Oh, it doesn't seem like we can even dismiss because you aren't in the org. That's quite silly
It doesn't make a difference tho because he's not in the org so his review doesn't block it.
Although that could be changed 👀
Yea
I was talking about the fact that he's not in the org could be changed 👁️
lol, Jason would need to be yellow for that
This is from the allowed_strings function, I don't see of I could define those.
state: allowed_strings("on", "off") = None
Ignore the error
But that's with flake
that's flake8 though, not pycharm, isn't it?
Yeah
i think it's because it tries to resolve on and off to defined names because you can do annotations with quotes for e.g. forward refernces (no longer needed in newer pythons)
from other code, looks like noqa: F821 is the way to go
see e.g. bot/exts/moderation/infraction/management.py
I think there's a much simpler solution: make the coroutine responsible for rescheduling itself. That's pretty simple: just add a schedule_at() at the bottom of the coroutine.
Soon this can be changed as discord.py added a typing.Literal converter in version 2.0 once it comes out. So
state: allowed_strings("on", "off") = None
would change to
state: Literal["on", "off"] = None
alright I will do that
This also does lowercase conversion, which a literal wouldn't I don't think
Yeah
oh true
Can we force push it?
You can force push anything on your branch provided it doesn't mess with reviews
Or is that not possible.
If it'll mess with them, then ignore it and rebase once it's approved
doesn't a rebase post-approval make github dismiss the reviews?
alright, so should I just use literal or stick to allowed_strings?
it's a setting which is off by default
ahhh
discord.py 2.0 isn't out yet, i would use allowed_strings and the noqa comment
Alright 👍
ah sorry @twilit juniper I had an old version open while writing up my comments, missed your updates
also, I see now I missed this conversation on the PR
all good lol 👍
It seems my comments are still appropriate though
Yeah
@twilit juniper https://github.com/python-discord/bot/pull/1629#discussion_r647689497 still isn't resolved :P
feel free to ping me if you have questions on my comments
Will do!
Smh
wait how many staff jakes are there
Yeah that was what I was doing initially but then I thought this would be useful for other features too.
I'm sure there are other features that rely on this but from an implementation perspective it's much easier to do it as I described. Trying to make the Scheduler support it just complicates the interfaces and its internals, for little benefit.
Agreed, thanks!
I forgot my mobile at school and now can’t login to GitHub, jake !close isn’t the only way to close the channel.
is there another way?
It has aliases
!help close
!close
Can also use: dormant, solved
*Make the current in-use help channel dormant.
May only be invoked by the channel's claimant or by staff.*
Also, I think there's a way to parse the message into a context and check which command was invoked
More robust way that wont rely on checking strings
yeah this ^
hi guys i was wondering how the python bot has a link connected to the white title when i try to do it i can only get my text to be blue
the thing i marked in yellow is what i mean
Does it have a link?
yes
bot/exts/moderation/infraction/_utils.py line 180
embed.set_author(name=INFRACTION_AUTHOR_NAME, icon_url=icon_url, url=RULES_URL)```
do we want to ping the mods when its time for their duty? i.e. their schedule start time
no, it's fine to just add/remove roles silently
cool 👍
Ok so am adding modpings schedule to modpings.py therefore it will use the same scheduler as modpings on/off. This means that once a person schedules worktime, he cannot use on/off until they remove it. So there are two possible solutions that I can see to this, use a different ID format for scheduling, currently I am using ctx.author.id as modpings on/off. The other solution to this is adding another scheduler to the Cog/Class, which one would be better?
ping me when you answer
Two schedulers sounds like the more logical move
right, I will do that
which pr is that chris"?
something something scheduler
lol
bot#1570
as you can see, I can't remember 4 numbers more than 0.42s
!remind @green oriole 0.41s what was the number?
0.41s is not a valid duration string.

lol
I am not using redis cache for this btw, modpings schedule
How is that so?
nvm , I thought scheduler tasks was persistent, unti l saw zig's PR
Looks like WIP PR icon got updated
What a format
.github/workflows/lint.yaml lines 18 to 19
# Configure pip to cache dependencies and do a user install
PIP_NO_CACHE_DIR: false```
Doesn't PIP_NO_CACHE_DIR=false turn off caching?
hey @green oriole ive started to notice that github turns any transparent sponsor image i upload to non transparent. any idea why?
lemme show you quick
transparent cloudflare
wait what
the devil
why is it only fucked up on the siite
heyy it works
Hahaha
Hey @clever wraith, why not use the old PR?
someone nuked it
You might wanna squash the commits btw
someone closed it sorry
yeah kosa closed it
A'ight
pypa/pip#5735
Yes, we don't want a cache inside the container, since the container itself only ever runs that pip command once, so no need to cache it internally
we do have a build cache, so when the container itself is built, that's partially cached
hey @mellow hare, how are you doing? i have a short question, are you available for reviews?
#dev-contrib message
This is in the lint workflow and the line right above says to use caching.
nothing in particular right now, I'm just looking to refresh the group of active reviewers i had in my head :D
HA, fair enough
Uuh that sounds problematic. Do we really not have any cache in the CI?
I'm going to be slammed for a little while. We're migrating our email system to Outlook 365, so I'm fielding all the trouble that comes with that
Oh no, not a 365 migration
That was my worse 3 weeks at school, because I wasn't at school I was doing migrations for a company
Spent my days in team viewer calls waiting for this stupid installer to do its thing
Well for comparison, here's what we're moving away from. https://www.lan-aces.com/
pypa/pip#5735
jason brought it up above
Oh wow, you didn't even have office?
so this means that its enabled: PIP_NO_CACHE_DIR: false
There's a linked PR that fixes it though
Can we actually test that?
I'm not sure if we even want caches in CI
what a gorgeous website
Welcome to my hell
my god that looks like hell
https://github.com/python-discord/site/pull/508
ready for reivew
2004 wants its UI back
RE sir-lancebot#774, here's the emoji if anyone reviewing wants to confirm the ids





2004 is being generous.
Discord changed the IDs?
I mean
Github changed the UI?
yeah
pr open remains the same?
yep looks like it remains the same
no
slightly different
top is current bot, bottom is current on github itself
umm yeah, they are a bittt different
@exotic ember 
wat
You can comment on commits?
yes
i made a macro to level up on mee6 using python
thats client automation which is against discord's terms of service https://dis.gd/terms, which is also therefor against the rules of this community
but its just a spam bot
its code that lets u spam in server spam channels
also it does not trigger the cool down
it does it slowly
@echo karma This channel is for projects developed for this server such as our bots and our website. Regardless, what you're describing is account automation and can result in your account being shut down.
Ah yea, you are right
Any chance someone can edit this svg https://github.com/primer/octicons/blob/main/icons/git-pull-request-24.svg to rgb(107, 196, 109) and export as a png?
I'll get it added to this PR
Also, this one https://github.com/primer/octicons/blob/main/icons/git-merge-24.svg to rgb(152, 110, 226)
posted in #dev-branding
Is there anyway to test rediscache related code without manually injecting key value pairs during start up?
are you using docker-compose?
If so, you can do docker-compose up bot (or sir-lancebot if it's on there) so that when you ctrl+c out, it leaves the other containers running
Umm, yeah I would need to use docker-compose to test it out, it isn't possible normally (with peotry) right?
not unless you have a seperate Redis instance running
but no, it's not possible using fakeredis
👍 alright thanks
another question:
So I am adding the task again as soon as it gets over, but know the problem is I am adding it inside the function which is being called when it is time to call the task, so basically that means it that the task is still present and I am making another task which is not possible as it shows in the logs. So how should I do that?
They look good, but they are too zoomed in IMO
Cancel the scheduled task first; https://github.com/python-discord/bot/blob/c89e3fd7e10b686acc1ecb1182d78abbafaea1b1/bot/exts/info/doc/_cog.py#L138-L153 does similar rescheduling
Yea, when the emojis are directly above/below another on the same line, they do get very close
They possibly do need a small border around them
I'll take a look tonight
since I've got PNGs now, I can actually work with them myself 😛
#help-lemon setting up linting
i notice when submitting a new issue to https://github.com/python-discord/bot/issues it does not have a template .
when i submitted an issue to lancebot it did have 3 templates .
our bot repository has no templates
are we able to use templates from the other repository? I see it'd have been a better structure for the issue i posted
You are free to use a similar template honestly
We just want to give more freedom to contributors
breaking our tests smh Ak
hah true
Ah thanks!
could i get some review on site#527
bloody hell i still dont have codespaces
The merger can squash it (if that's permitted in settings), idk about the author
Can we get a contrib/staff review on this please?
Testing right now
that was fast
That was very fast
auto-merge was enabled so after i approved it went through quick 
Niiiice, good job!
Interestingly enough commits squashed by github don't get signed
very nice
Oh they do get signed, I guess it is a bug in github's patch generation
they do or don't

I mean, look at the link
The patch is lacking the signature
Which got me confused at first
But in the history they do actually be signed
oh for fucks sakes
😂
Github kept fucking up my logo, making the bloody background black and shit
site#515
site#527
blame Kosa for closing the first one
fwiw you could've opened a new pr with the same branch lol
i used the same branch wdym
o lol
I don't think that's a good idea, ten commits that edits 2 lines
You can squash and force push
yeah i shouldve done that :/
you can squash lol
that is true
which is worse?:
multiple prs for the same thing
squash commits
Thoughts on the new emoji?
They've each got a border now too







They look so nice
lovely
Oh God. Checking the git blame, these have been that way for over 14 months on github. It almost seems not necessary to update the icons.
But they do look nice.... So....
yea, the octicons have been there all this time
But the push to github might not have been that long ago
No, https://github.com/primer/octicons/blob/main/icons/git-pull-request-24.svg == 14 months ago
Just tried to copy bits of your lint and test workflow
It worked just fine until running flake8
I have 120k lines of errors
Looking something like this
So annoying cause flake8 works locally
Just not through the workflow
Please redirect me to a different channel if I should not post this here :/
It seems like you're not installing the dependancies in your workflow
or at least that's what it seems like from that image
I'd suggest opening a help channel though, since it's not related to any PyDis repo.
Maybe ask in #tools-and-devops if you don't have any luck in the help channels
I have posted directly in #tools-and-devops
how do i set level to show trace logs? running from peotry
im not sure
would it be possible include the scheduler name at start of the logs of scheduler?
here, these are two are of two different schedulers, and it is difficult to understand which is of which
maybe we can add <name> | <logs>
nvm am dumb, it is shown there already
Do i write unittests for it?
"ScheduleScheduler" is very odd name
lol yeah, I changed it to be ModPingsSchedule
-self._role_scheduler = Scheduler(self.__class__.__name__)
+self._role_scheduler = Scheduler("ModPingsOnOff")
+self._modpings_scheduler = Scheduler("ModPingsSchedule")
@vocal wolf is it possible to send two embeds in a single message?
nah, that won't look good lol
Never tried.
There weren't any tests written for modpings earlier so do I write them for this feature?
you don't have to
tests for new features aren't required
passing tests for enhancements with previously written tests are
ah, but if someone writes them will they be accepted?
if it's within scope of a PR, yes
so if you wanted to for modpings and the mod schedule thingy, go ahead
just make sure that the content of the PR is edited to tell reviewers what's going on
I will keep it separate from this PR, since I am not really experienced with unittests, and may take time.

Only with webhooks iirc
yep looks like that 
No, but I saw an issue about it somewhere
webhook yes bot no
because discord is very consistent 👍
@gritty wind so now I'm not breaking rule 7, let's continue here
Lol
I can get excited inducting a new sacrificial goat to the academy of pydis contributing
I'm concerned now
Oh no, you'll probably be fine
triage vs triage
Is this a multiple choice question?
500 words minimum
I'm assuming that I don't need to add the black channel to guild.channels
category should be fine
I had a look at the reminders src
and ....
It would require some modification to work with categories too
So it's fine if you add just black for now
ah
what's being worked on?
If you want to have a go at giving it full support, that would be amazing, but not needed for this
Allowing !remind in #black-formatter or OSS in general
I see
ye
bumped up to 3.9(.5) recently which was
given modern python is like 3.9+
so sweet
okay, so does this looks fine (watch this break later):
diff --git a/bot/constants.py b/bot/constants.py
index ab55da48..ca9ec7c5 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -399,6 +399,7 @@ class Categories(metaclass=YAMLGetter):
moderators: int
modmail: int
voice: int
+ open_source_projects: int
class Channels(metaclass=YAMLGetter):
diff --git a/config-default.yml b/config-default.yml
index 55388247..83118d96 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -142,6 +142,7 @@ guild:
moderators: &MODS_CATEGORY 749736277464842262
modmail: &MODMAIL 714494672835444826
voice: 356013253765234688
+ open_source_projects: 846434038251782214
channels:
# Public announcement and news channels
@@ -244,6 +245,7 @@ guild:
reminder_whitelist:
- *BOT_CMD
- *DEV_CONTRIB
+ - *BLACK_FORMATTER
roles:
announcements: 463658397560995840
that was bigger than I had expected
oh wow, you made an actual diff 
Where was BLACK_FORMATTER added
the category looks good though
oh ok, so joe was wrong here /j
lol
I mean, I probably should've caught the fact there was no id declaration for the channel I was adding
I think the process just got muddled up due to channel vs category
wonder if there is a YAML linter that could help with things like that
v2:
diff --git a/bot/constants.py b/bot/constants.py
index ab55da48..ca9ec7c5 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -399,6 +399,7 @@ class Categories(metaclass=YAMLGetter):
moderators: int
modmail: int
voice: int
+ open_source_projects: int
class Channels(metaclass=YAMLGetter):
diff --git a/config-default.yml b/config-default.yml
index 55388247..894b1aff 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -142,6 +142,7 @@ guild:
moderators: &MODS_CATEGORY 749736277464842262
modmail: &MODMAIL 714494672835444826
voice: 356013253765234688
+ open_source_projects: 846434038251782214
channels:
# Public announcement and news channels
@@ -176,6 +177,9 @@ guild:
user_log: 528976905546760203
voice_log: 640292421988646961
+ # Open Source Projects
+ black_formatter: 846434317021741086
+
# Off-topic
off_topic_0: 291284109232308226
off_topic_1: 463035241142026251
@@ -244,6 +248,7 @@ guild:
reminder_whitelist:
- *BOT_CMD
- *DEV_CONTRIB
+ - *BLACK_FORMATTER
roles:
announcements: 463658397560995840
we could probably write one that checks that constants.py and the config file match up
Other than typo fixes, I don't use the online editor
That would also need a reference to actually mention
like the one after modmail
&BLACK_FORMATTER
Haha you can declare yaml variables after the key name:
black_formatter: &VARIABLE_NAME 000000```
I don't actually know if it's case sensitive
Line 157 is an example of this
I'm sad now
You can then reference the variable's value in the YAML using *VARIABLE_NAME
the channel name is so long that it doesn't align with the rest of the ids
Idk if this is standard yml, because if so, it just reinforces my belief yaml is evil
Feel free to realign everything 👀
I just assumed you guys were hacking yaml
We definitely are with the ENV tags at the top lol
black_formatter: &BLACK_FORMATTER 846434317021741086
that lgtm
is it in constants.py?
I feel bad making you do all this work, esp with no testing env
oh fun
lol
❯ git diff bot/constants.py
diff --git a/bot/constants.py b/bot/constants.py
index ab55da48..4cd17425 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -399,6 +399,7 @@ class Categories(metaclass=YAMLGetter):
moderators: int
modmail: int
voice: int
+ open_source_projects: int
class Channels(metaclass=YAMLGetter):
@@ -433,6 +434,8 @@ class Channels(metaclass=YAMLGetter):
off_topic_1: int
off_topic_2: int
+ black_formatter: int
+
bot_commands: int
discord_py: int
esoteric: int
looking good
just... ;
So wait, why are we adding the oss category again?
it may not be necessary at this point
and that's why I'm asking you 😄
lol
❯ git diff
diff --git a/bot/constants.py b/bot/constants.py
index ab55da48..3d960f22 100644
--- a/bot/constants.py
+++ b/bot/constants.py
@@ -433,6 +433,8 @@ class Channels(metaclass=YAMLGetter):
off_topic_1: int
off_topic_2: int
+ black_formatter: int
+
bot_commands: int
discord_py: int
esoteric: int
diff --git a/config-default.yml b/config-default.yml
index 55388247..48fd7c47 100644
--- a/config-default.yml
+++ b/config-default.yml
@@ -176,6 +176,9 @@ guild:
user_log: 528976905546760203
voice_log: 640292421988646961
+ # Open Source Projects
+ black_formatter: &BLACK_FORMATTER 846434317021741086
+
# Off-topic
off_topic_0: 291284109232308226
off_topic_1: 463035241142026251
@@ -244,6 +247,7 @@ guild:
reminder_whitelist:
- *BOT_CMD
- *DEV_CONTRIB
+ - *BLACK_FORMATTER
roles:
announcements: 463658397560995840
or... should I add back the oss category
The category is not necessary anymore
And see kids, asking a question a second time but with slightly different wording is how you get full answers to your questions
You went from this7
To this
words me no good
OK, time for my favourite part of development, writing a good commit msg /hj
I've seen some atrocious stuff. As long as you aren't filling it with gibberish you'll be fiiiine.
Now if your plan was to fill it with gibberish
In all seriousness, this is the longest commit msg I've ever written: https://github.com/psf/black/commit/62bfbd6a63dcac2f6f31eb014f69397c9eb967d2
Did you reorganize the docs into the msg?
holy
yeah I had to write that one in a separate file + copy and paste lol
The root title was ## not # that was causing myst-parser to emit some of 'em warnings
and we enforce warning free documentation builds 😄
I love that we went full circle and started going OT here with #black-formatter stuff
windows tho 😬
I told you I have a problem
we don't talk about that
honestly IDK what to put in this commit msg
Adds the black-formatter channel to the remind
command overrides to allow usage of the command
in the channel.```
Line length is probably off, but that's the best I can do eyeballing
you were pretty off mate
let's pretend I get paid by the line ¯_(ツ)_/¯
I totally didn't just mess up my auth for a git push
anyway, here's the commit https://github.com/ichard26/bot/commit/c26a03a90a7d7d92fc07a1074965371d007428d8
I see you're one of the those vigilant mode users 👀
so you're taking your security advice from and I quote: "Tfw joe isn't the smartest person in the room" /j
he was last week
I see how it is
Unless vigilant mode has a negative effect on brain functionality, I think he should be fine again next week
lmfao
and PR created!
I wonder if I can review it
ah yes, the "workflow awaiting approval"
It may not count cuz co-author
oh lol
You know what I should do
Chris got me
I should go and copy your first time contributor message
I had keys for a long time, just didn't have the vigilant setting enabled
It's a pytest plugin that parallelizes your code. I don't really have anything else to say about that. It worked really well out of the box, and I didn't run into any problems. Here are some numbers:
Us over at psf/black had a lot of issues with pytest-dev/pytest-xdist#620
You too!
Thanks
ayyy it counted
did you end up disabling it all together, or just in CI?
!source remind
Commands for managing your reminders.
just for ci because the bug was too frequent due to how many times we run the test suite
locally we didn't hit much
but yeah, here's a random failure we encountered: https://github.com/psf/black/runs/2730726139?check_suite_focus=true
I wonder if there's a stable parallelization tool then
I haven't looked into it
@full fractal your PR has been merged.
that is a quick turnaround time 👀
All PRs on pydis have the same turnaround period, regardless of length
Money back gaurnteed
Thanks for the review!
👍
You too @gritty wind and also the guidance
*disclaimer: your PR may take longer depending on length, reviewer availability, and the orientation of the sun
and that's what we were waiting for lol
and also which timezone I decide to sleep in
you sleep?
also how much the maintainer is bored that day
correct.
Interesting...
Y'all seem fine with pytest-xdist, I see each CI run only runs the test suite once, not 24 times like us 😛
well, I already created it in #bot-commands but OK
lol
it worked :hooray:
testing in prod 101
They're a fantastic machine
We get a lot of stuff, so it's great not to have to worry about it. It also means more consistent triaging most of the time
dude
they sleep so they aren't a machine
Windows updates
I run linux.
Me too.
linux updates*
well linux doesn't force you to update
I say that and I have Windows dual booted on this machine and I haven't booted it in a long time, can't wait for when I boot it and have to wait out the hours of updates
I put windows on a separate drive so I don't have to worry about it overwriting partitions and breaking my manjaro programming environment by not letting me boot.
My protection method is just not booting Windows, which is shockingly easy to avoid doing
Sadly enough
OK, time for me to go back to my psf/black maintainer duties (i.e. derailing all the channels I'm in). In all seriousness, it was fun to contribute, I'd encourage you to maybe bump the priority of making it easier to set up a dev env but it sounds like lack of time is the main issue (which I can totally relate to)
Improvements are occurring for users setting up dev environments, yes. Thank you for the contribution!
.bm
The triager within me found this issue that should probably be closed: bot#1585
thanks!
The bot needs to be able to look up sklearn docs.
Okay
Are you able to add it?
Not sure what the permissions on the command are
!docadd
!help doc
!docs [symbol_name]
Can also use: d, doc
Look up documentation for Python symbols.
Subcommands:
!docs getdoc [symbol_name]
Return a documentation embed for a given symbol.
Well I guess that means I can't
get the objects.inv link and send it in #community-meta 😛
!docs add
add
Adds the argument to the value.
For example:
{{ value|add:"2" }}
``` If `value` is `4`, then the output will be `6`.
This filter will first try to coerce both values to integers. If this fails, it’ll attempt to add the values together anyway. This will work on some data types (strings, list, etc.) and fail on others. If it fails, the result will be an empty string...
Look up documentation for Python symbols.
Looks like it's here: https://github.com/scikit-image/scikit-image/blob/1f8c74f69e0f9e72c59f180b2fc96d311659c609/doc/source/_intersphinx/sklearn-objects.inv
no actually
You want scikit image rather than scitkit learn?
This is for scikit learn
https://scikit-learn.org/stable/objects.inv
I'm not entirely sure what the base url should be
One of these, probably
https://scikit-learn.org/stable/modules/
https://scikit-learn.org/stable/modules/generated/
I mean, ig that works lol
The objects.inv is normally located on the docs at whatever/objects.inv
Yeah the link that mark sent above
!d sklearn.covariance
The sklearn.covariance module includes methods and algorithms to robustly estimate the covariance of features given a set of points. The precision matrix defined as the inverse of the covariance is also estimated. Covariance estimation is closely related to the theory of Gaussian Graphical Models.
User guide: See the Covariance estimation section for further details.
https://github.com/python-discord/bot/pull/1634/files#diff-d82a54c450ea031f87210217bd9b41f10344938751efefdf015f27d9404a9a06R17 should I make this configurable?
(in config.yml)
also should add a delete sub-command, so that you can delete your modpings schedule?
hey, if anyone wants a non-code PR to review you can look at sir-lancebot#756. it has been waiting for almost 20 days :D
Does anybody know what the python icon next to the commenters username means in the cpython bug tracker? Does that indicate the person is a core developer?
This channel is about python discord projects, but depending on the colour it either means they are a python triager or commiter, you can see it on hover
Was that already a thing or did you add it?
!docs sklearn.cluster.KMeans
class sklearn.cluster.KMeans(n_clusters=8, *, init='k-means++', n_init=10, max_iter=300, tol=0.0001, precompute_distances='deprecated', verbose=0, random_state=None, copy_x=True, ...)```
K-Means clustering.
Read more in the [User Guide](https://scikit-learn.org/stable/modules/clustering.html#k-means).

!otn a k means klustering
:ok_hand: Added k-means-klustering to the names list.
@vale ibex wanna #changelog that?
oui
Just had a thought after merging, would it be useful to push !helpdm invocations to statsd?
could be a cool stat to have
Aren't there stats already for command invocations? Or would it be for the amount of times it sent dms
It keeps track of invocations yea, I should have bene more specific, I was more asking if knowing how many people had turned it on vs off could be good
@vale ibex sir-lancebot#774 merged
:PRMerged: Update Github emoji to new icons



