#dev-contrib
1 messages Β· Page 116 of 1
To filter out permanent I need to do expires_at__isnull=False
Sounds about right
So, what I have now is those new filters
and I'm using them in reschedule_infractions, and then if I get infractions back:
- I schedule them if they aren't already scheduled
- I schedule another reschedule_infractions when the longest one would expire
if I don't, it ends there
filters active: True, permanent: False, and matching types
I'll commit to a branch in the fork as soon as I figure out how to get tests written for this
You can work on the upstream
It's completely possible to time-limit it too but that felt like a lot
Tests successful on site
Time to open a PR
and learn where I screwed up :P
Relative discussion: #dev-contrib message
for https://quackstack.pythondiscord.com/details/{type}, you give an invalid type, shouldn't it give a 400 response code instead of a 200? Also, should /details be a valid endpoint as well?
Yeah that can be done β , I can try to do tomorrow in 12h
@mellow hare re: bot#1605 you can right click a user and select the Move To button, then you dont have to drag and scroll
yeah, that works on desktop and mobile
I think I'll give it a go
haha, nice
why does @stable mountain and @dusky shore not use relative imports for everything?
specifically from bot.x.y import z where it could be from .x.y import z
That is used in some places
I think that from ...x.y import z looks worse than from bot.x.y import z
!zen 1
Explicit is better than implicit.
having the extra context that's it's from bot is worth the extra 3 chars
@sleek steppe im already working on the details ep
oh 
there's more than just a missing 400 too lol
I prefer absolute imports as opposed to relative
we don't have a complex packaging layout, and so I think it makes sense to follow flake8 here and use absolute imports
@fervent sage we're in 3.9 now use list instead of List 
π€
> poetry run task start-dev
ERROR: [WinError 10013] An attempt was made to access a socket in a way forbidden by its access permissions
lol you have 3.11 but not 3.9?
maybe it's vscode being vscode
shit i didnt pull before committing now my git stuff is gonna look horrid again 
oh well
Such a thing doesn't even exist, does it?
I had to click the refresh icon in vscode
it's probably vcos fork
Right but wouldn't the name be 3.11.0-alpha or smth
it's cyeethon yeah
ah yes cyeethon
no, when it's installed it'll just take the pythonX.XX path
when you boot up it'll give alpha/beta/stable
how do i resolve this issue when running Lancelot?
looks like you havent pulled the latest updates
oh, i just cloned it
i assume you cloned your fork of the bot, if so go to its github page and click the fetch upstream button
Looks like 3.7 might be getting another update
π
oh i cloned the wrong Bot lol...
my bad
@sleek steppe which project lead are you know?
.gh repo python-discord/code-jam-management
Management microservice for Python Discord Code Jams
Ooo nice
In just one month toxic has become from nitro booster to project lead.
lol
correlation is not causation
vco
but it's not got a defined project lead role since it's not core infra
same as like
olli
Ah
What is olli anyhow?
And stelere?
I read the source but forgot
Loki logs to discord iirc
what's loki
Oh yeah that sounds right
Olli uses a pydantic and toml configuration system which is why I was looking at it
reworking https://pydis.com/resources
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Since I'm writing a modmail bot
Oh nice π
What happened to the media category?
And Chrisβs secret project?
it still exists
Made private
still secret
But y private

because it didn't have much going on at the moment
Alright itβs 1am cya!
the majority of posts were off topic, people posting youtube videos and so on
@short snow Chris's project is almost certainly media related
Yeah to joe
lol

that's vesters project
chris' project is not a media project
media? π€
Lol, too many projects
Ooh what's ur project
lol
Chris when are u planning to break it out
π
π€«
Soon β’οΈ
gotta become staff to find out what it is
Last time I asked, it was soon, better reply pls
will never find out what it is
could i get a staff review on quackstack#51 please :P
soon is relative, it could be a year away and still soon, compared to other things
lol
Works fine but my review wonβt count π
done
valve tiime
tiime
you need to say the i twice to take your tiime
lmfao
lol
you ediited it and left the typo
dude, it's a typo lol
i dont actually edit out my typos that often
because too commonly i rush and introduce another one
Oh yeah I was going to say shouldn't it be poetry run uvicorn main:app --reload
and then someone screenshots my 5th typo in and immortalises it
no cause it's a taskipy task
ah right
Wait
Do u need to run taskipy with poetry run?
I've noticed my enviroment is loaded automatically since I put poetry on my path
Just being in the directory sets python to my env
not necessarily
maintenance starting in ~1hr
db maintenance
bot will remain up, site functionality of bot will be down
So infractions and stuff?
What maintenance is occuring?
Also there's a manual infraction mode?
postgres version upgrade + other performance tweaks
we have preparations in place to continue moderation through dowtime
but yeah, 21:00-23:00 UTC is the window, I don't think it'll take the whole time
Can't the tox.inis go in pyproject.toml π€
do we have to create an issue and get it approved before creating a pull request?
its not like ive already done the code
Guidelines to adhere to when contributing to our projects.
No. Flake8 doesn't support pyproject.toml
Last I checked, anyways.
However....
!pypi flake9
^fork of Flake8 which supports pyproject.toml
Which downloads Flake8 anyhow
So it still relies on flake8
I see
@zenith pecan was bot#1600 discussed at some point in this channel?
If not, please review our contributing guidelines: https://pythondiscord.com/pages/guides/pydis-guides/contributing/contributing-guidelines/
!modmail
Contacting the moderation team via ModMail
@slow bone is a bot that will relay your messages to our moderation team, so that you can start a conversation with the moderation team. Your messages will be relayed to the entire moderator team, who will be able to respond to you via the bot.
It supports attachments, codeblocks, and reactions. As communication happens over direct messages, the conversation will stay between you and the mod team.
To use it, simply send a direct message to the bot.
Should there be an urgent and immediate need for a moderator or admin to look at a channel, feel free to ping the <@&267629731250176001> or <@&267628507062992896> role instead.
i can do if you want
π
done, bot#1607
sick
le speed
Are there any plans to do a larger overhaul to use 3.9 features like the typehints or asyncio.to_thread, or will that just be done around other changes at a smaller scale
after spring cleanup i believe the consensus was that we would change those little things in and around things that were being changed for whatever reason, rather than knocking them all out, as that would create another monster pr which is hellish to review
(bot) steele@steele-mint:~/projects/pydis/bot$ poetry run task test
FileNotFoundError
[Errno 2] No such file or directory: b'/snap/bin/task'
at /usr/lib/python3.8/os.py:601 in _execvpe
597β path_list = map(fsencode, path_list)
598β for dir in path_list:
599β fullname = path.join(dir, file)
600β try:
β 601β exec_func(fullname, *argrest)
602β except (FileNotFoundError, NotADirectoryError) as e:
603β last_exc = e
604β except OSError as e:
605β last_exc = e
help
hmm, is taskipy installed?
let's seee
did you poetry install?
no, though to my credit, that is not in the updated contribution guide
well, this is where I'm looking: https://pythondiscord.com/pages/guides/pydis-guides/contributing/bot/
A guide to setting up and configuring Bot.
Yeah there's a link that leads to that here https://pythondiscord.com/pages/guides/pydis-guides/contributing/bot/#development-environment
A guide to setting up and configuring Bot.
why would a fundamental instruction be on a different page?
I don't like how the command line is below PyCharm on various articles like that one. The command line instructions should be right at the top, since that's what a lot of people use.
I should open an issue about that
Does anyone know a good way to show and hide text based on if a button is clicked in html/css?
and u can do the cli to install even with pycharm
which would do as much as pycharm does but faster
To expand on what Alec said, if something would actually be beneficial, we could consider it
When we said no to the large overhaul that was specifically about typehints
The benefit of changing those didnβt even come close to the cost
It probably wouldβve involved a large contributing freeze, updating existing PRs, and generally a lot of painful grunt work for something not worth very much
@fervent sage bot#1594 needs updating
i need to move it to site apparently but idk where lol
oh
Can sir-lancebot#683 get closed? Even if we did need a PR to bump dependencies, it would be faster to make a new PR than to resolve those conflicts
I've never seen so many conflicts that github has to truncate the listing
haha, that's what happens when there are two huge PRs open at the same time and one gets merged
cc @patent pivot what do i do and where do i do lol
uhhhh
Isn't there another large PR that we need to close because of that other large PR?
have sleep
I think you're talking about the same PR?
I don't know
oh nevermind I guess there wasn't another large PR besides that one that's currently up
but this one yeaaaahh we should prob close
For sanity reasons
we should really restructure this bot
can we uh rename the evergreen folder for the sake of people actually knowing where to look for stuff, especially since its no longer seasonalbot
restructuring wouldn't have seasons anymore
Lancebot rewrite whenβ’οΈ
restructuring would mean a total freeze on everything right?
probably
bump
error_handler should go in ext/utils/
we should just rewrite the whole bot i volunteer as tribute
Wouldn't it partially since it does have a few seasons anyhow?
I think it should keep some stuff like the christmas folder, but as opposed to that being because it's a season it's more because it's a category of cogs
Like April fools and pride and those
so while some stuff like that makes sense to stay how it is, the reason isnt because it's a season per se
How do I get a user's associated email on github?
There isn't an in-built way
tools like https://github.com/paulirish/github-email attempt to based off activity
Hmm.. the github UI fetches it when you specify someone as a co-author, but there doesn't seem to be a way to do so from the command line
I think the github app does it based from username
but I'm not aware of a way to do it via the git cli
maybe the gh cli has a way, but I don't use it
just doing <username>@users.noreply.github.com might work
I just get it on github UI and copy it down on the commit
How do you get it on the github UI?
You can look at one of the user's commits and copy it from there, for example https://github.com/python-discord/bot/commit/9098d4cd539095644f5bdcdb52294e2942bb9b03.patch
Nope.
They use aliasing for the emails.
So every user account has an ID
So if you change your username you still actually get the emails :smort:
yeah like numerlor said
Ok, found the email. That was surprisingly convoluted, surprised github doesn't have a more streamlined way to do this.
Oh wait bast did this for the entirety of the bot repo
?
Hey, I found a couple places in the site contributing guide where they mention using pipenv instead of poetry, can I make a PR to site to change them to poetry?
can anyone explain to me why metaclasses are used for the config of the bot instead of normal inheritance?
is there any reason behind it or is it just "because we can"
constants.py uses classes, so in order to have the custom implementation of __getattr__ for the class itself, a metaclass would need to be used
It also implements __iter__ and __getitem__
Making emails easy to fetch probably would just lead to more scraping
Kinda like that it's a bit difficult
Any particular reason you need them?
Can you link them?
Actually just go ahead and make that PR
I could link them but I'm on mobile right now
An example is https://pythondiscord.com/pages/guides/pydis-guides/contributing/site/ the requirements say python 3.8 and pipenv instesd of 3.9 and poetry
Actually was python updated in site? It was
A little while ago I made an "evolution" video of the bot repo with a script to grab avatars for all the committers in a repo. It hits the GH api a bit, it is really convoluted because they don't reveal the actual email-owner relationship outside of hitting the commit api.
But to answer this specific question, you can get it from the commit api, which will give you the user details/co author details directly for a given commit on a given repo
yeah i was confused first time too lol
Since the three main projects are all using poetry now, should something like this part https://pythondiscord.com/pages/guides/pydis-guides/contributing/contributing-guidelines/supplemental-information/#linting-and-pre-commit only show how to install using poetry?
I'll just add that to my pr
No, because snekbox and other projects still use pipenv.
We don't have contributing guides on the site for snekbox
and?
The README explains how to run snekbox, not the site
To credit a co-author
!server
Created: 4 years, 4 months and 14 days ago
Voice region: europe
Features: PREVIEW_ENABLED, MEMBER_VERIFICATION_GATE_ENABLED, COMMUNITY, WELCOME_SCREEN_ENABLED, INVITE_SPLASH, VIP_REGIONS, ANIMATED_ICON, VANITY_URL, RELAY_ENABLED, NEWS, PARTNERED, BANNER, DISCOVERABLE
Roles: 80
Member status:
35770
167413
Helpers: 114
Moderators: 28
Admins: 15
Owners: 3
Contributors: 39
Category: 26
News: 11
Staff: 62
Text: 108
Voice: 8
Sorry, no other channel that I can access (that I know of) where I can view the guild features
Guess I could make an issue to add an optional argument
Not unlike raw
@fervent sage do thing pls. https://github.com/python-discord/bot/pull/1594
can i have multiple command proposals at same time π€
yeah π
okk

!source server
Returns an embed full of server information.
Ok, seems reasonable the way it is
!float
Floating Point Arithmetic
You may have noticed that when doing arithmetic with floats in Python you sometimes get strange results, like this:
>>> 0.1 + 0.2
0.30000000000000004
Why this happens
Internally your computer stores floats as as binary fractions. Many decimal values cannot be stored as exact binary fractions, which means an approximation has to be used.
How you can avoid this
You can use math.isclose to check if two floats are close, or to get an exact decimal representation, you can use the decimal or fractions module. Here are some examples:
>>> math.isclose(0.1 + 0.2, 0.3)
True
>>> decimal.Decimal('0.1') + decimal.Decimal('0.2')
Decimal('0.3')
Note that with decimal.Decimal we enter the number we want as a string so we don't pass on the imprecision from the float.
For more details on why this happens check out this page in the python docs or this Computerphile video.
yes
@sleek steppe while you're at it, add ?t=0 to that YouTube link
Nice tag speedrun
Ah, missed this. What does adding this give us?
Doesn't the link without that tag just pickup where you left off?
if you want a more python specific video https://www.youtube.com/watch?v=Js99ciGwho0
https://anvil.works/mcoding
Support mCoding by visiting this video's sponsor using the link above.
Most programming languages use a shared standard (IEEE 754 floating point numbers) for how to represent floating point numbers like 0.1. In this video, we see how these floats are represented and how this can cause unexpected results like 0.1 + 0....
Is there any reason why we use os.eviron.get instead of os.getenv?
os.getenv is basically a shortcut to os.envron.get
so there's no reason to use one over the other
any thoughts on #755? 
On which repository?
lancebot
how do the bots here automatically deploy?
They have a GitHub action that deploys them to the Kubernetes cluster iirc
Well yes
But how do you deploy to the cluster or stuff
Do you need some sort of public webhook or something to do so?
https://github.com/marketplace/actions/deploy-to-kubernetes-cluster seems an option. I don't know exactly what we do but good enough start
π€
So it seems like it requires a public ip or something
Well, yes, for the action to hit. A webhook would as well
Ah
you can look at the workflow https://github.com/python-discord/bot/blob/main/.github/workflows/deploy.yml
once the image is in GHCR the deploy workflow checks out the repo with manifests and re-applies the app deployment while injecting the new image tag
to authenticate the cluster's kubeconfig is available in the repo's secrets
It's the public IP of the Kubernetes api server
so not the nodes
which for us looks like https://<random uuid>.eu-central-2.linodelke.net/
so the thing you post to deploy is the left box, the master or more commonly api server
π€
is the uuid random or is it known and doesn't change?
!source Antispam
Unable to convert 'Antispam' to valid command, tag, or Cog.
!source [source_item]
Can also use: src
Display information and a GitHub link to the source code of a command, tag, or cog.
also missed the 17th
I'll pull some logs
I see errors on the 21st
but nothing since
when did we last restart lancebot
.uptime
I started up 4 days ago.
okay yeah
so it's just that the loop got crashed out of on the 21st and it doesn't reschedule if it fails once
perms error afaics
kubectl rollout restart deploy sir-lancebot
wait
not a terminal
alright, it should post tonight
lmfao
what even is this command lmao
it's as it is written
restart the rollout of the sir lancebot deploy
restart lancebot, effectively
ah
kubernetes doesn't have the concept of restarting, so you restart the deployment
okay
Idk if this is the place but i requiere help with a project. I need to gather a big image data set of pokemons to make a cnn classifier. If any of u wanna help me, pls check google image search python api, and follow the steps. Ping me too to share a script
Uhhh, why only one help channel per user?
There's no real reason a user should have more than one help channel open at a time. We've only seen it cause issues recently. It's outlined in the issue attached to the PR.
There was a good reason for it previously
Two unrelated things a user wants help with
It's very infrequently used for that, so a simplification of complexity is a good idea (we do get questions along the lines of "why can't I open a new channel")
Also, a user should not be juggling two help channels about two issues. It's a bad experience for both them and the people trying to help.
anyone wanna add cloudflare to our site sponsors list? if not I can take it shortly, but it's a nice first PR if anyone is up for it π
Wut cloudflare started sponsoring now too?
Or were they a sponsor for a while?
cloudflare has for a while
OK cool
but they sponsored some more today and it reminded me
workers
also proxying for non standard ports, prioritised traffic, much better analytics, etc. tho idk what pydis gets
yeah
we get spectrum yeah
so we can proxy SSH and uhhh
minecraft
hahahaha
and yeah, we get some private PoPs, if you are in the UK I know we serve from the MAN (Manchester) PoP
and yeah, more analytics info π
stay tuned
h
hmmm


What's that?
h
lol
i created an api token just before the announcement
Hi guys. I am working on a image dataset of 50+ images per pokemon (898 pokemons) find the google api i am using limits the amount of requests per user per day. If any of u wanna help me grabbing images of some pokemons to group them all together i will appreciate, since time will decrease. DM me if u want.
BTW, i am using https://github.com/arrrlo/Google-Images-Search and there are a few steps u have to do before using it
I don't think this is the right channel for that, this channel is for discussing about python discord projects found on https://git.pydis.com
aha so that day when i spotted iceman's status of pixels, he was working on #828316147657080835
El Espiar Jason
yeah we've been working on pixels for a few monthss now
Since start of March iirc
Quick Q on the workflows for our repositories, I just noticed that everything gets installed into a common directory:
${{ github.workspace }}/.cache/py-user-base
Wouldn't that hurt in case dependencies fail to satisfy constraints?
I see how its beneficial in terms of being the "singular source of truth" for caching, but I'm not exactly sure how
works
for some reason, if you add a extension to the unloaded cache and it doesn't get loaded.
Then when you do !c load <ext> it raises that the extension is already loaded
basically:
this is regarding sir-lancebot#745
if its not taken, sure
Not taken π
I cannot find the issue anywhere on the site repo
there isn't one yeah
you can open without an issue, I'll approve
i opened an issue, site#514
Alright @patent pivot , site#515
That cache is invalidated when pyproject.toml or poetry.lock change. If there's a cache hit, then it won't even install any dependencies.
With that in mind, I have no idea why someone decided to add the poetry cache in there.
It's useless since cache hits mean poetry never installs anything
Heyo, can I get a staff/contrib review on site#515 please? 
indeed
Thank you sir
lmfao
does cloudflare have a different image i could use?
or a way to make it transparent?
hmmm
There's this transparent one
aight
Bump, also when I do .catify, as it is not loaded it doesnβt work, so yeah the cog isnβt loaded
It's most likely because you're overriding bot.add_cog. extensions are not cogs.
Not sure if I understand how it gets affected by the changes I did to add cog, I will look into it and get back!
When I changed it to load_extension the extension gets unloaded Β―\_(γ)_/Β―
it always used bot.load_extension 
I'm talking about how you overrid bot.add_cog
Not the extension load/unload command
hmm, that's weird then
Yeah, it loads the extension but doesn't add the cog, because it found the extension in the cache
has the git hook died
I think there wasn't any activity on github for a couple hours lol
ah yeah
Could you stop spamming that in all channels please π
was worried since I rolled out a patch for #black-formatter and wasn't sure if it broke
oh lol
ok yeah, just tested it, would load extension be able to handle this better? I will get it a try
yeah I think so
also @short snow the other thing I was talking about is that let's say I unloaded bot.exts.evergreen.snakes, and it goes in the unload cache, and I reload the bot. In add_cog, it's checking if inspect.get_module(cog).__name__ is in the unloads cache, and inspect.get_module(cog).__name__ for the snake cog is bot.exts.evergreen.snakes._cog, so it doesn't match and the cog gets loaded.
alright will look into it
@sleek steppe Alright overwriting load extension works π
Haha, it isn't needed anyways now π since wea re overwriting load_extension which takes str the cog name i.e. bot.exts.evergreen.snakes
oh god, branch got fast forwarded π
sounds like cherry picking is the only solution
but for that i would need to open a new PR
oh shit
ok pr should be ready for review now
had to make the changes again, messed up with git haha
Why did you make bot.load_extension async but it doesn't awat anything?
hmm, i think there was some error if i kept it sync, I will have a look again when i get back. Or probably i removed some async code and forgot to change it back
Ok I'll review when that gets changed
It's one of our filters, located at https://github.com/python-discord/bot/blob/main/bot/exts/filters/antispam.py
threads
π
would be cool to migrate help channels to threads ngl
when its out, i mean
we'll look at it when it comes out, there are several disadvantages that a threads based approach brings
inherently less visible than a list of channels, harder to figure out what is active and what is not, just overall it harms discoverability compared to the current system
members must join threads as opposed to here where the channels are just there
Hmmm
How do you get to see them anyhow?
they are enabled on some servers already
done
bot#1297 needs review. Quite a large PR, take as much time as you need.
Now we need a PR title hall of fame.
@gritty wind what did I do again >.<
I see all 
uhhh
we'll see, it's currently webhooked to an internal channel, will look at it later today
There's actually already one of these in pins :p https://discord.new/zmHtscpYN9E3
You mean the eval command?
Can the bot access and modify the file system?
Yes. But not the eval command, if that's what you mean.
Got it, thanks
However, everything runs in Docker containers. If you wanted to persist some changes you'd have to define a new volume, or save it to an existing volume, if any.
Of course, if you commit the file to git then it's fine if you're going to access it as read-only.
I wanted to store some info to a JSON file.
So that won't work
How does the bot normally persist data @tawdry vapor?
through the attached Postgres database or Redis instance
*although postgres is accessed via the site api
So can I just import redis and use that?
hang on which bot are we talking about, bot or sir-lancebot?
they use slightly different things
ok you can access redis via the bot's redis_session attribute https://github.com/python-discord/sir-lancebot/blob/main/bot/bot.py#L36
bot/bot.py line 36
self.redis_session = redis_session```
Thanks a lot!
https://pypi.org/project/async-rediscache/ this is the library we use
p much just a status
Yeah, but it's not horrible
this seems to have 0 relation to this channel?
Moderation. This server has nickname checking (coded bot feature of @stable mountain) and now there's about user statuses (which users can set, just like nicknames) so it's mentioned here because implementing it into @stable mountain might be a possibility?
Statuses ainβt server specific, so we canβt really moderate it I suppose
We do moderate some things that are not server specific in very limited cases
Like all new features, weβll discuss the best way to handle it
Personally I donβt think it requires much effort
Personal status arenβt moderated completely and those are arguably more visible
@crude gyro here I am π
yo. what's up
sorry I'm a bit lost in this huuuge discord server
first of all thank you for django-simple-bulma, it seems it will make my life easier in a project i'm working on
but I'm encountering an issue about static files, and even with your informative paragraph I don't quite understand how to solve it
yeah, the community can be a bit overwhelming at first
(so many channels and chats!!)
you get used to it. and then you mute and hide half the channels and you're good.
anyway
well, when I say static files it's about custom scss
aha, I see.
I can't make it work.
I have a project called RtpProject, then an app RtpApp
in RtpApp directory I have a 'static' directory (RtpApp/static/rtpApp/css/main.scss for instance)
and in bulma settings I've set ```
"custom_scss": [
"rtpApp/css/main.scss"
],
okay. that might not be a full enough path
ok. What shall I do? I'm sorry if there's an obvious answer to this question
the full path from the root project folder is usually the right way
ok. My static root is called static
just STATIC_ROOT
do you get an exception?
I got this exception :
ValueError: We couldn't figure out where the static directory for the given SCSS path is: "rtpWebsite/css/main.scss". If the given path does
n't contain "static/", then you may need to add it to your STATICFILES_DIRS setting.
with ```
"custom_scss": [
"rtpApp/css/main.scss"
],
yeah. so the way I think this works (I'm not 100% sure because I think maybe @velvet ether wrote it) is that we either expect your path to contain static/, e.g. RtpApp/static/rtpApp/css/main.scss, or we expect you to add the folder to STATICFILES_DIR.
the first of those two would be easiest to test
ok
I've also tried
"custom_scss": [
"rtpApp/static/rtpApp/css/main.scss"
],
but that raised another exception
isn't that first r supposed to be capital? I don't know your file structure but you've used a capital R previously
FileNotFoundError: [WinError 3] Le chemin dβaccΓ¨s spΓ©cifiΓ© est introuvable: 'C:\\Users\\thiba\\PycharmProjects\\rtpProject\\venv\\Lib\\site-p
ackages\\django_simple_bulma\\rtpApp\\css'
my mistake. It's not a capital
so not about capital π¦
what are you doing when this exception is raised?
python manage.py collectstatic
in both cases these exceptions happen when I do this command
okay, that's what you should be doing so that part is good.
moment, let me take a look at the code for this
ok thx
can you try making a STATICFILES_DIRS meanwhile? docs are here: https://docs.djangoproject.com/en/3.2/ref/settings/#staticfiles-dirs
yup π
then try with a path relative to the dir you put in here
oh actually it looks like gdude wrote this part, not Jonas. My bad.
same exception π¦
I share what I did :
STATICFILES_DIRS = [
'rtpWebsite/static'
]
BULMA_SETTINGS = {
"extensions": [
"bulma-collapsible",
],
"output_style": "compressed",
"custom_scss": [
"rtpWebsite/css/main.scss"
],
}
rtpWebsite is the actual name of my app
I still got the exception "Value error. We couldn't figure out..."
include the staticfiles dir in the custom_scss path
oh ok
looks like our finder expects that
I have never really used this function myself and it was a pull request from someone quite a long time ago, sorry that I'm a bit unfamiliar with it
FileNotFoundError: [WinError 3] Le chemin dβaccΓ¨s spΓ©cifiΓ© est introuvable: 'C:\\Users\\thiba\\PycharmProjects\\rtpProject\\venv\\Lib\\site-p
ackages\\django_simple_bulma\\rtpWebsite\\css'
haha no problem. You are trying to help me, that's already a lot
okay, so here it's clearly looking in the wrong place, which may be a bug in our code
oh. Well x)
but I think the fact that you're getting a FileNotFoundError rather than one of our errors indicates that you've input the path correctly
is your project on github or something?
It's weird indeed
hum no. Only a local git repo but I can share it with you after upload if you want
good habit to start putting your personal projects on github
do you have dependency management?
like.. pipenv or poetry or a requirements file?
I usually do pip freeze > requirements.txtbut that's all
I think you've found a real bug and I appreciate you bringing it to me, so I think I'll just fix the bug for you, but it'd be useful to have something to test with.
I might rewrite that function to support STATIC_ROOT too
if it isn't sensitive, that'd be useful.
Can I make it private and share only with you, it's a project I'm working on for a small business (not anything sensitive though)
thanks π
I'll take a few minutes to pull it.
Oh and please don't look at the code too much, it's garbage since I'm doing 10 things at the same time x) And I'm a newbie
Hey @cerulean axle!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
I've invited you as a collaborator on my Github repo π
yep, already cloned. having a look now if I can reproduce the bug
did you have a requirements file?
oh crap. I'm uploading it now
I highly recommend starting to use something like pipenv or poetry in the future, it makes collaborating super easy.
by running pipenv install in a project with a Pipfile, it will
- Set up a virtual environment with the right python version
- Install all the dependencies with the right versions
- Make it easy to run commands inside the virtual environment, or to open a shell there
I already use virtualenv. Is it different ?
and if you don't have the right Python version, it will even install it automatically as long as you have pyenv
well, it's good that you use virtualenv, and these tools also typically use virtualenv internally
So, using virtualenv with a requirements.txt file is not enough ?
it's certainly better than nothing
Haha. I'll look into pipenv or poetry π
but a dependency manager does more than that. It also tracks all your dependencies, and resolves a "dependency map" to ensure there aren't any deeper subdependency conflicts. Once that dependency map is resolved, it's saved as a lockfile. This lockfile can then be committed to your repo, and when someone installs it, it will use that lockfile to ensure that they get exactly the same dependency map as you
this might not matter for a smaller personal project, but it's hugely important for larger projects
it means that every environment will always run exactly the same versions of everything
and that means you don't get surprising runtime errors
thanks. I guess I'll have to follow the good practices then
also, the user experience for poetry and pipenv is really good
once you try it, you won't wanna go back
they feel great
ok thank you ! π
no problem. I happened to have an available hour anyway
I can't believe it was so fast to contact you xD
yesterday I was a bit depressed after trying many solutions to this problem and reading the README.MD file ten times. Now I'm super glad.
hmm, right, what python version are you using?
Python 3.8.10 (venv environment)
@midnight nimbus I think you forgot to commit your static files to the repo
ouch
I'm gonna check it
I don't understand why static files are not committed
I didn't exclude them
yeah I git added them
git status tells me that directory staticis not committed, but that's my static root
ok it's done. My bad π©
okay, I've reproduced the bug and am making the custom scss file discovery a bit smarter
it'll just use the other standard finders to locate the file instead of trying to locate it manually
this should be more platform agnostic - I think the problem you're seeing is a bit windowsy.
you won't need to define STATICFILES_DIRS either then
nice ! So I don't have to change anything in settings except omitting staticfiles_dirs ?
I'll get back to you on that, might need to make relative paths to the files.
ok! π
@crude gyro I see you've updated the project π
@midnight nimbus The problem you were experiencing should be solved in https://pypi.org/project/django-simple-bulma/2.3.0/
can you try upgrading and testing the new version for me?
yes I'm gonna try right now!
and with this change, don't worry about STATICFILES_DIRS, and just define the file with a relative path
e.g. "rtpWebsite/css/main.scss"
relative to whatever static folder it is in
should work out of the box like that, for any static folder that Django will reasonably interact with
the actual root problem was that your custom SCSS was deeply nested, and we didn't support this - I guess we only ever tested it with a single subfolder inside static - but now we support any nested depth.
very nice! no more exception
so the file compiled as expected?
I'm verifying it though
(if you're using pycharm, the compiled css file might be nested under the scss file)
yes it's compiled π
excellent!
nested indeed
sounds like you're good, then
thanks for the bug report 
let me know if you run into anything else
thank you for the new version and work involved!
happy to help. stick around, this community is full of helpful people.
one more question: shouldn't I see main.css appear in source code of a page now?
yes I'm learning Python so I think I'll come again here!
well, now it's up to your django app to serve that file.
ah so it compresses the file but I have to serve it manually? It's not done automatically?
you've got your STATIC_ROOT set up to point at the right folder, so you should be able to use the {% static %} templatetag to fetch the css file into your templates
(I think it's even better so I can take a modular approach)
I see you have this in your index.html
<link rel="stylesheet" href="{% static 'rtpWebsite/../../static/rtpWebsite/css/index.min.css' %}">
that's a strange path. You should just need to do something like this:
<link rel="stylesheet" href="{% static 'rtpWebsite/css/index.min.css' %}">
ok thanks! I thought the scss files included in bulma_settings where automatically served, but I was wrong. It's even better this way, I only load what I need
yes this was a weird refactor from PyCharm
ah, that makes sense, yes :D
right, so just use that same technique to serve the compiled css and you should be good
well
Thank you a lot
we didn't wanna inject stuff into the templates because you might not want it in every template
yes indeed. Thank you a lot for all your help and time spent on fixing this issue!
no problem at all.
ahem
I think I got another issue π©
"custom_scss": [
"rtpWebsite/css/main.scss",
"rtpWebsite/css/index.scss",
"rtpWebsite/css/marque_list.scss"
],
makes this exception:
ValueError: list.remove(x): x not in list
if I only put one of these scss files, individually, in the list, it's ok though. But all 3 makes exception happen. Am I doing something wrong?
ah x)
hehe
I'll patch that out right now.
thanks! I'm glad I can find bugs 
by the way, why do you have the bulma folder inside your static folder
from a previous attempt at getting bulma working?
it was from before using your project
I used bulma as downloaded css files
If that's your question
I just deleted it
I'm sorry, the project was a mess when I pushed it on GitHub
I tried many things yesterday and pushed all that in a rush for you ^^
no problem
@midnight nimbus fixed in https://pypi.org/project/django-simple-bulma/2.3.1/
thanks!
hopefully I didn't create some other bug with this release too 
collectstatic now works without exception when more than 1 scss file is given π
<@&409416496733880320> I am just curious when you were setting up the kupernites cluster for all you applications such as bots,websites,etc did you have to start setting up the docker container or did you have to start with a linux server
We use a managed Kubernetes Cluster on the Linode Kubernetes Engine, so all of the actual server management is handled by them
so they set up the docker container and the linux server
Not sure what you mean by Docker container in this context, but the nodes provided by Linode come with the necessary Kubernetes components installed + a working Docker runtime
https://www.docker.com/resources/what-container this is what I mean by a docker container
Yeah, I know what a Docker container is, but Kubernetes does not run inside a single Docker container
It's a set of host applications as well as containerised applications, as well as components not on our infrastructure at all
ok
Linode power the control plane, the provider API and bootstrap all the nodes with kubelet, as well as setting up the Docker runtime and containerised components like the DNS servers
what would I need to set up first
I'd recommend starting with a managed cluster from Linode/Scaleway/etc, they are dead cheap. After that you can look at kubeadm which bootstraps nodes manually
what I just need to run one application rather than multiple applications.should I still use a cluster for one application
No, I'd get a single VPS and use docker or systemd for that
a working Docker runtime
i thought k8s stopped doing docker runtimes? using stuff like just containerd on its own
right now Linode provisions with Docker, Dockershim is deprecated but not removed
ahh
It will be removed later this year, at which point an upgrade by Linode will switch to containerd or CRI-O or something
@crude gyro is it possible that the Bulma css file provided in django-simple-bulma is not as complete as the bulma.css I can download from official site? I can't find classes like is-flex-direction-column in the new bulma.css π€
seems unlikely, we're just submoduling Bulma.
so every time I do a release, it grabs the latest version of Bulma straight from their repo
and, well, I did two releases today
so it should be pretty updated.
ok. It's weird because I can't find these classes, that worked well yesterday
interesting.
all those classes and more are lost π€
.is-flex-direction-row {
flex-direction: row !important;
}
.is-flex-direction-row-reverse {
flex-direction: row-reverse !important;
}
.is-flex-direction-column {
flex-direction: column !important;
}
.is-flex-direction-column-reverse {
flex-direction: column-reverse !important;
}
.is-flex-wrap-nowrap {
flex-wrap: nowrap !important;
}
.is-flex-wrap-wrap {
flex-wrap: wrap !important;
}
.is-flex-wrap-wrap-reverse {
flex-wrap: wrap-reverse !important;
}
.is-justify-content-flex-start {
justify-content: flex-start !important;
}
.is-justify-content-flex-end {
justify-content: flex-end !important;
}
.is-justify-content-center {
justify-content: center !important;
}
.is-justify-content-space-between {
justify-content: space-between !important;
}
.is-justify-content-space-around {
justify-content: space-around !important;
}
.is-justify-content-space-evenly {
justify-content: space-evenly !important;
}
.is-justify-content-start {
justify-content: start !important;
}
.is-justify-content-end {
justify-content: end !important;
}
.is-justify-content-left {
justify-content: left !important;
}
.is-justify-content-right {
justify-content: right !important;
}
when were these added to Bulma? check the blame.
it might be that we're using an older version of Bulma than I'm assuming we are.
by some mistake
hm. I'll have to investigate when I'm back at a computer
.
oooo new shiny ping, why would we ping this?
also ToxicKidz would you mind re-reviewing? it has been 2 days since i made the change you requested :D
temporary for pixels
Ah nice
@patent pivot any updates on https://github.com/python-discord/sir-lancebot/pull/683#issuecomment-850764982 ?
I understand a lot of work was put in
But we discussed this
The version bumps besides 3.9 are a bit meaningless, and 3.9 has already been done
We also discussed changing the typing annotations
After the spring cleaning PR, that was a hard no
Iβm sorry, but Iβm not sure this PR is worth pursuing anymore
Upgrading the annotations as needed seems like a more reasonable option
No problem π, agreed
@sleek steppe I need your re-review on sir-lancebot#756
I can probably leave a review tomorrow
thank
@short snow do you want to do this? https://github.com/python-discord/sir-lancebot/issues/627
Would probably be better if someone else can take it, got units in June
@exotic ember this the reason i did that, i was storign the message id earlier
regarding: #dev-log message
I can think of two different solutions to the current one
One possibility would be storing all the cogs in redis, with a bool value to indicate them being on/off, and just query each cog
Another option would be to store the unloaded cog names as keys, and not worry too much about the value (just set it to something random like 0), then get the items from the namespace
Both solutions have their upsides
What i did initially was something like kosa said, it was
{"cog": "message ID"}
Which i still find as the best solution, I could change the message ID to message link so one deosn't need to find their way to the message ID
I donβt particularly think storing the message ID will help in anything, but I donβt have a strong opinion on the matter
is there a use for storing all the cogs? I prefer reducing complexity wherever possible but I do see the appeal of "categorizing" everything
i mean its better than storing all the cogs/or random thing
the message link can help pointing out the reason why the cog was unloaded at the first place
Not particularly, it just seemed the most intuitive at first
(Replying to kosa)
As long as the system works, I donβt mind any of the suggested solutions tbh
Would be nice to have that feature
The cleanliness is a bonus
umm, so what should I go ahead and do?If i was given the opinion I would choose storing them with msg links
I'd go with just storing unloaded cogs
yeah but what should the value contain?
Any deterministic string for each cog really
The class name would probably work just fine
@midnight nimbus yep, turns out I was wrong about how submodules behaved and it's running a 10 month old Bulma. I'll update to the latest version now.
Ok! Very cool, thanks
hello, i have a question, i want to contribute to sir-lancebot so i was trying to go over some issues, I wanted start from very easy task so I found that someone wished to make rock paper scissors in sir lancebot however the OP has probably changed mind or something as issue is from March, may i do it?
I have set up lancebot in one of my servers and its working. so im done with basic running bot section.
You can comment on the issue and get yourself assigned if that's the case
Alright thanks. Also if i may ask, what will be a good file to follow the code style in rps? I'm currently following connect4 however it is a bit complex compared to rps.
Hmm, yeah connect4 is a bit complex, well for RPS, by could quality do you mean like pep8 and stuff or how the code should be made, the implementation part
the pep part, logic itself is not a big deal, but I want to make sure I follow standards correctly.
We follow pep8 and you can find a detailed description here: https://pythondiscord.com/pages/guides/pydis-guides/contributing/style-guide/
Coding conventions for our Open Source projects.
alright I'll check it out. thanks a lot for your help.
Also i recommend to checkout the contributing guidelines for sir-lancebot before you start contributing to it 
great I'll check them out too!
umm, reason for the class name?
It should be unique and deterministic π€·ββοΈ
umm, you can figure that out my the cog itself tho.
I could put that but I don't see how its useful π€·
I don't really understand the issue though
https://github.com/python-discord/sir-lancebot/pull/745#pullrequestreview-671712977 its regarding this. I think the comment explains it, if not let me know, i will give a shot
Hmm I see
#dev-contrib message discussion here onwards -
You could have a RedisCache["cog name", "jump link"] as described in the issue, no?
yeah, that's what i agreed upon with kosa
For the value you can either use a jump link as kosa said or even put a dummy value
i would say jump link, since it is more useful than a dummy value, alright i will do that then
Sounds good
how to kinda reload the command thing?(i made some changes but they do not reflect unless i restart lancebot)
extensions reload <cog_name>
perfect will do that then
try:
await coro_func(role)
except discord.NotFound:
log.debug(f"Failed to change role for {member} ({member.id}): member not found")
except discord.Forbidden:
log.debug(
f"Forbidden to change role for {member} ({member.id}); "
f"possibly due to role hierarchy"
)
except discord.HTTPException as e:
log.error(f"Failed to change role for {member} ({member.id}): {e.status} {e.code}")
I can see how discord.NotFound could get raised. Would discord.Forbidden be raised if a helper+ opened a help channel? And then the last one is a catch-all?
Why?
What roles is it changing?
And fwiw i know that at minimum @stable mountain can edit all roles that a helper can have. Not sure about moderation team and up, tho.
As the log message says, you'll get forbidden if you try to apply a role that is equal or higher than you in the hierarchy. So for example, I can't give someone the admins or owners role.
You can apply roles to someone higher than you in the hierarchy, just not roles that are higher than you
https://github.com/python-discord/sir-lancebot/issues/613
so regarding in this, I made this one on my fork, may I give a merge request?
Hey @clever wraith, it seems like someone else is assigned to that issue
yeah, but it seems like no activity is shown since march that's why i asked here first.
We can ask the other person if they made any progress, but you still have to be assigned first
I'll have to go AFK, I'll let any other core dev take care of it :)
Here are a list of issues which are open for contributors, https://github.com/python-discord/sir-lancebot/issues?q=is%3Aopen+is%3Aissue+no%3Aassignee+label%3A"status%3A+approved" in case you want them
alright makes sense.
I'll just ask the respective dev for it first
thanks i'll look into them
is there a method to delete a item for redis-cache?
@exotic ember should i include the message link in the message sent to dev alerts? re sir-lancebot#745
sir-lancebot#745 this oen
this is how it currently looks
sure
alright
looks good?
Yes
Pretty sure you can use del on a key since it implement the dict abc
alright, i just used await redis_cache.delete("key")
oops my role spelling lol
Cool stuff
No they will be actual message links, this is just for testing
It seems like the wrong moderator role (the one that I donβt have currently) is used inside Sir Lance to toggle command correction, can someone look into what is happening please?
Toggle command correction?
ah
Yeah that isn't in sir-lancebot at all
like bot has these lines https://github.com/python-discord/bot/blob/main/bot/exts/backend/error_handler.py#L167-L168 but sir-lancebot does not
bot/exts/backend/error_handler.py lines 167 to 168
if not any(role.id in MODERATION_ROLES for role in ctx.author.roles):
await self.send_command_suggestion(ctx, ctx.invoked_with)```
And why shouldn't mods get suggestions on @dusky shore ?
!embed Ternary if-else
If you've ever written this:
if num_snakes > 1:
word = 'snakes'
else:
word = 'snake'
You could instead write:
value = 'snakes' if num_snakes > 1 else 'snake'
This is simply a shorter way of doing if-else logic, though it's only available when the value-if-true, value-if-false, and condition are each one expression.
Ternary if-else
If you've ever written this:
if num_snakes > 1:
word = 'snakes'
else:
word = 'snake'
You could instead write:
value = 'snakes' if num_snakes > 1 else 'snake'
This is simply a shorter way of doing if-else logic, though it's only available when the value-if-true, value-if-false, and condition are each one expression.
How's this for a ternary embed? I'm worried that using "snake" and "snakes" as the two options is too subtle
also it should say "word" in the second code example
what about ```py
if age >= 18:
text = 'You can vote.'
else:
text = 'You can not vote.'
text = 'You can vote.' if age >= 18 else 'You can not vote.'
probably more distinct than snake vs snakes
prolly a boolean value instead of string could look better
@trim cradle very nice work!
like True if some_condition else False?
Because that's an anti-pattern--it's the same as bool(some_condition)
Wow uh
Why does #reddit keep breaking
@patent pivot said it was fixed but /shrug
It's entirely not.
Unrelated #βο½how-to-get-help is out of date
I'll check what it was this time
Due to #changelog
well, it can send messages
Hm, are you sure?
.int e ```py
print(guild.get_channel(458224812528238616).permissions_for(ctx.me).manage_messages)
True
cool
you also got errors for the loop before iirc
no, uh, token invalidation
@short snow I'm writing
flake8 in my terminal in project directory
run poetry run task lint, it would run the linters.
so if i intentionally do something like putting extra line is it is giving me erorr
alright
I'm getting this error while running it
$ poetry run task lint
FileNotFoundError
[Errno 2] No such file or directory: b'/snap/bin/task'
at ~/anaconda3/envs/latest-py/lib/python3.9/os.py:607 in _execvpe
603β path_list = map(fsencode, path_list)
604β for dir in path_list:
605β fullname = path.join(dir, file)
606β try:
β 607β exec_func(fullname, *argrest)
608β except (FileNotFoundError, NotADirectoryError) as e:
609β last_exc = e
610β except OSError as e:
611β last_exc = e
Make sure task is installed first (along with all other dependencies) by running poetry install
oh alright, yeah i think that was the issue! thanks a tons scal!
Which file I should run so that
the sir-lance bot code will start
if you're using docker,
docker-compose up
seems good.
more details are here
https://pythondiscord.com/pages/guides/pydis-guides/contributing/sir-lancebot/
A guide to setting up and configuring Sir Lancebot.
@short snow just noticed that sending links to github which are embedded by the bot bypass all filters
is it tho?
yes
if someone wants to PR it, you can, but no one is going to strategically create github repo markdown files to share invites here
I don't think it's worth wasting resources in considering how few times this feature is used and that in general discord links on github are trustworthy
oh, i was thinking swear stuff and similar
again, it's not going to be that common
people can do that.., we should get a stop that