#dev-contrib
1 messages · Page 178 of 1
this is very weird
glad to hear it, spent the last two days feeling crazy
I've managed to get it to work once
no idea why
steping all the way through it seems fine
you should double check my boilerplate if you haven't, I'm new to redis
that's one more than I got
I ruled out the lock fwiw
took that out sicne it was annoying to step through all the time
getting same issue
was the success after that?
the success seems to be whenever I step into the redis call
sec I'll show
#763406158522220544 if you're free
https://gist.github.com/Rapptz/6706e1c8f23ac27c98cee4dd985c8120#interaction-with-aiohttp Same thing applies. But, yeah. Not funny.
It’s deprecated but still used under the hood for backwards compatibility as I understand
It’s part of why I bumped to 1.0
This is not a Modmail thread.
So at the time of the message I am replying to, I did the git fetch and git pull commands, and it updated my local files.
But now again the main repo was updated and I pressed fetch upstream on github, and then in vscode I did ```
PS C:\Users\tenuk\ModMail-FAQ> git pull origin
Updating 509795c..e439064
Fast-forward
classes/dropdown.py | 18 +++++++++++++-----
classes/topics.py | 50 ++++++++++++++++++++++++++++++++++++++------------
main.py | 47 ++++++++++++++++++++++++++++++++++-------------
3 files changed, 85 insertions(+), 30 deletions(-)
PS C:\Users\tenuk\ModMail-FAQ>
Even though i did this, my local files don't show the updates
Are you on the same branch?
can you remind me how to check that please?
if it's git branch, that shows master
i did git fetch origin and git pull origin . Should i replace origin with master?
Simple Discord.py bot for ModMail support server. Contribute to Diabolical5777/ModMail-FAQ development by creating an account on GitHub.
Does this help?
Stash it before pulling
is that just git stash?
Yeah
it said No local changes to save
Try to do git stash -u
I jsut realized that the original repo author duplicated a file topics.py and moved one of them to the classes folder, leaving one out (at least locally that's what I see)
this isn't a modmail thread
I know that lol, I was just confused why Modmail sent that
I think there are commands specific to ModMail channels and if you use it in another channel it'll send that message
Right so you think someone ran a Modmail command and deleted the command usage?
That would make sense actually
Oh I just realized ? is the bot prefix lmao
Anyways, let's get on topic
are there any blockers to using modals in our bots?
do any of them use slash commands / buttons etc yet though?
modals can only be sent in response to these
also freeform text (both short and long)
edit; only freeform text? or the docs are outdated, idk
https://discord.com/developers/docs/interactions/receiving-and-responding
Support for components in modals is currently limited to type 4 (Text Input).
is that the difference between views and modals?
iirc "views" are a discord.py concept that refers to message components in a normal chat message
"modal" is a term used by discord to refer to actual modal popup windows
Hi. I am a python dev with few months of experience. I am looking to volunteer for startups/ new ideas. Dm me if you are interested working with me.
I am looking to contribute to Snexbox possibly. Is there anything that needs to be done, has been requested, or is being worked on that I could assist with?
Did you take a look at the repo? If there are approved issues you can ask to be assigned to one, and if there are open pull requests you can try reviewing them
the file IO seems like the most interesting to me atm
Fwiw a lot of snekbox will just be trying to figure out what techniques you can use, discussing them, and getting them approved, more than actually writing code. More than any of our other projects
If you’d like to work on it, go through the issue history, and leave a comment with what you’d like to do
@obtuse arrow Hello. What is your status of these PRs? bot#1940, bot#1941
Require CPR lol
i have what i think is a strange question:
yesterday my redis container for sir-robin was named sir-robin_redis_1
today it is named sir-robin-redis-1
....why?
Uuuh did you update anything?
Last time docker updated it was in January, is your install just really out of date :D
Either that or the latest version reintroduced a regression, but it’s not listed yet
docker-compose uses underscores docker compose uses hyphens
(Related to an older discussion: it’s specifically a regression in docker compose vs docker-compose)
Yup
mmm I've been using docker-compose the whole time
might have done docker compose once and then the image names have stuck if you didn't do down
EG you did docker compose the first time creating the container and docker-compose since
it'll retain the hyphens
if you do up --build does it retain the container names?
hmm maybe i used docker compose at some point yesterday, but literally
Set-Alias -Name "dc" -Value "docker-compose"
```is in my profile
Alias docker-compose to the space version and you’ll never have issues again 😋
I refuse to use go software
Lmao
I just learned v1 is written in python while looking this up
yea dude
version number is irrelevant anyways, it's only for backwards compat
it's ignored in latest versions of compose
- Set-Alias -Name "dc" -Value "docker-compose"
+ Set-Alias -Name "dc" -Value "docker compose"
```because dashes are slightly easier to type
lol
👌
Pycharm's docker interpreter support is simultaneously some of the most amazing and janky shit I've ever seen
Making it work is impossible, but when it does work
It's oh so sweet
anything in pycharm related to docker and ssh is like that
I'm using VSC for the sole reason that I can't be assed to make ssh work properly in pycharm
You run the projects on an external server? 😄
how do I rebase one commit at a time? like I have 5 commits I want to rebase, and I want to take one at a time and adjust it to the new base
like cherry-picking?
Do an interactive rebase and set everything to edit
Yeah I think interactive is what I'm looking for
@brazen charm Question for you re:tag group + improvements stuff: Are the supported tag metadata found anywhere else besides the __init__ in the Tag class in tags.py?
From the PR I see you implemented embed and restricted, but I'm not sure if I'm missing any others.
I don't believe any others are used. It should all be in the class for the tag so if it's not there, it's unused
Can the docs command support the fishhook library?
i don't think there's a documentation website for it
apart from the readme
which makes sense because there's like 2 public functions
Hmm
Could the two examples in the README fit in a tag?
Can I get some feedback on sir-lancebot#1070 ?
I literally just stole the implementation from !remind
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
raise commands.UserInputError("Your message must have content or you must reply to a message.")
``` would this work instead?
I came across that logic when i was refactoring the bookmark cog myself
sir-lancebot#1049
speaking of, @timid sentinel I have only now seen your suggestion. should I commit this to that branch or were you planning to pr that yourself?
Absolutely no idea
I've never used dpy before
I can give it a shot
ctx.message.refernce is always present, just sometimes None
getattr(None, "foo", False) would return False
so getattr(ctx.message.reference, "resolved", None) either returns ctx.message.reference.resolved if present, or None
I see
Can you give me a quick summary of Scale's comment on the issue?
I get the idea but I don't know how to actually call clean_content on a str
Oh hi Scale
The general way converters work in d.py
They are classes
So you just call await clean_content(settings).convert(ctx, str)
But it will raise exceptions
I think you can safely let them propagate though
Would ```
t.Optional[clean_content(fix_channel_mentions=True)] = None
I've never tried it 😅
Possibly, but it won't fix the reply content
ah yea true
you'd do that after this
Ideally you stick it under this lol
Jinx
@thorny obsidian would have words though
I may not be an admin anymore but my wrath has not waned
So... text stayst.Optional[str], and then call clean_content this?
yea
👍
raise commands.UserInputError("...") works because we have a global error handler that deals with this error and handles it nicely
Hmmm
sir-lancebot | 2022-07-09 15:04:03 | bot.exts.core.error_handler | ERROR | Unhandled command error: expected string or bytes-like object
sir-lancebot | Traceback (most recent call last):
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/core.py", line 167, in wrapped
sir-lancebot | ret = await coro(*args, **kwargs)
sir-lancebot | File "/bot/bot/exts/fun/uwu.py", line 123, in uwu_command
sir-lancebot | await clean_content(fix_channel_mentions=True).convert(ctx, text)
sir-lancebot | File "/usr/local/lib/python3.9/site-packages/discord/ext/commands/converter.py", line 945, in convert
sir-lancebot | result = re.sub(r'<(@[!&]?|#)([0-9]{15,20})>', repl, argument)
sir-lancebot | File "/usr/local/lib/python3.9/re.py", line 210, in sub
sir-lancebot | return _compile(pattern, flags).sub(repl, string, count)
sir-lancebot | TypeError: expected string or bytes-like object
I ducked up the clean_content
Where did you put it?
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
# If we weren't able to get the content of a replied message
raise commands.UserInputError("Your message must have content or you must reply to a message.")
await clean_content(fix_channel_mentions=True).convert(ctx, text)
Ah, yea getattr(ctx.message.reference, "resolved", None) will return the message, not the message content
For a second I though I’d have to admit I have no idea what I’m doing
But Chris with the save
getattr(ctx.message.reference, "resolved.content", None) might work
no idea if getattr can do a second level like that
I'm guessing not
guess not
not it's not seeing it
getattr(getattr(ctx.message.reference, "resolved", None), "content", None)
```?
Seems to work
yea, just a little complicated for one line lol
Yeah
Back to the original and just leave it there then?
text = text or getattr(ctx.message.reference, "resolved", None)
if text is None:
# If we weren't able to get the content of a replied message
raise commands.UserInputError("Your message must have content or you must reply to a message.")
elif isinstance(text, discord.Message):
text = text.content
await clean_content(fix_channel_mentions=True).convert(ctx, text)
maybe the other way around ```py
text = text or getattr(ctx.message.reference, "resolved", None)
if isinstance(text, discord.Message):
text = text.content
if text is None:
If we weren't able to get the content of a replied message
raise commands.UserInputError("Your message must have content or you must reply to a message.")
await clean_content(fix_channel_mentions=True).convert(ctx, text)
I'm okay with this, it's pretty clean
How does it look now?
looks good
👍
Then unless there's anything else I need to do, I declare my services fulfilled
hah thanks, I'll give it a test once i've sorted metricity
Does the converter cause issues when it raises exceptions?
If not, I think we should be good 👍
No idea
It's my first day
Lmfao
But after using Chris' snippet, I get pretty errors
@everyone uwu
Hahaha that's perfect
lol nice
I wonder what happens if I reply to an image
it should error
it's why I swapped these around lol
Should hit the "no text provided" UserInputError?
ye
why are we not uwuifying images???
.uwu
it's w-why i swapped these a-awound wow
Be the change
@thorny obsidian it is done
lmfao just put an uwu over it
Also - Just to confirm, there's no issues with me creating branches directly on the repo, [as opposed to forking] right?
Yeah
Uhh
Where would one put a new route in the site api
These all seem to be views
Oh I think I figured it out
LMFAO this is amazing, thank you shenanigans
I'm going to write a changelog for this and no one can stop me
One of the perks of being staff~
Can I make an HTTP request within an api view method in DRF? It's really hard to look up info because of the name conflict...
I did find one SO post which just said use requests (the library), does that cause issues
Yea, otherwise it'll block the worker
I feel like the solution here is to not use requests
I've seen that DRF supports async views, and I had already upgraded to httpx for other reasons 👀
bot-core#98 tiny bug fix
tyty
@fallen patrol Hello. sir-lancebot#982 sir-lancebot#981 questionmark?
the second one was just supposed to be a retrofit, i didn't want to modify much of the original author's code
updated the first one
Mark you're good to merge snekbox#147
Thanks for accommodating my messed up needs lol
ty for reviewing
😎
Still waiting for poetry to fix an ancient bug to add support for poetry versions 😔
sad
metricity#18 includes quite a large refactor, I've added (what I think to be) some useful instructions for people who get some time to test it out :)
Lmfao
lol I was getting worried why it was taking so long
time to add .cache to the ignore
casual 170k line flake8 output
Normal friday
It is Saturday
Do we not need the flake8 annotations action anymore?
shouldn't do, since it's a dev dep
not entirely sure what it was doing fwiw
it isn't in any of our other linting flows
and i didn't add annotations as a dev dep in this pr
and i didn't add annotations
?
guess imma add em
I was referring to flake8-annotations, please read the context.
They are already there :D
nice
What are we talking about
Lol dw it's the dpy update bug
Could we get dotenv
no
just came to ask a question, could i clone the repos for my own bot?
Thanks
all our bots are MIT licensed
great
Lmao
Pycharm used to have a really nice plugin to auto-load them
But it stopped getting updatees 😔
Wait I know what my next project is 🌝
wait, it's already here
yea, it's a prod dep lol
I wonder what's up with my thing
you're safe this time
Thank
Oh I refreshed my token because of discord's stupid token thing
Lmao big brain
lol

before vs after. Is this code optimization?
i fixed
Oh cool we're doing voice channels now?
yeyeyey
the main reason I did metricity now
@viscid badge doesn't like text-in-voice right now
metricity/exts/event_listeners/_utils.py line 39
if not await models.Thread.get(str(thread.id)):```
iirc this was a fix in case the message event was handled before the thread create event
there's not that much
it's all from bot.py
just moved to Cogs
Yeah my review strategy is copy the old content in and see the diff 🤡
metricity/exts/event_listeners/message_listeners.py line 30
if message.type in (discord.MessageType.thread_created, discord.MessageType.auto_moderation_action):```
the first part of this should deal with that actually
it's easy to test too
just remove this and make a new thread
Alright, I think that's everything
Yea, I was right, it's not needed, since I also guarded against that in the on_message listener
Sick
can also remove ```py
if from_thread and not message.channel.parent:
# This is a forum channel, not currently supported by Discord.py. Ignore it.
return
Doesn't it make more sense to do the opposite to avoid forcing a blocking sync
As in, don't handle thread creation in on_channel_update, and instead handle it in on_message
thread creation has it's own event
Oh
it's just that it also sends a message event
No I mean the event generates a full sync
since the thread opener is also the first message in the thread
As opposed to the message which just syncs the thread
Ultimately it's fine, I don't think the sync is that long
yea, the standard seemed to be sync everything when a new channel is created
so I did the same for threads
Alright, that's fine
pushed a commit to remove those two guards
How on earth did my suggestion auto resolve itself haha
Noice, that looks good
Dude the linting is lighting quick
yea it's nice
PR cache 💪
I'm approving, if you're happy with it, you're welcome to merge
guess we'll find out
Lol
We never merge bad code to metricity
@viscid badge status
Give it a minute
ye
@viscid badge status
Hello, I'm Dave. I insert all your data into a GDPR-compliant database.
31156.927 ms
<t:1657406233>
9355.926 ms
Hello, I'm Dave. I insert all your data into a GDPR-compliant database.
3808.356 ms
<t:1657406233>
9355.926 ms
nice
got that dialup
Hey 👋 , if anyone is interested sir-robin#49 is waiting for reviews. It's not that big, most of the things were ported over from bot, and were tested previously.
will take a look tomorrow
The site test suite took ~4 minutes to run
Then pycharm reported it as 8s
Thanks pycharm
Hey funny devops men
Where is graphite data being pushed to?
Is it all stored by graphite?
I see it has a PVC
Yea, graphite stores it
Hm, well I've spent some time getting pytest working
Well, it does, but it still takes 1:14 minutes
Even with no migrations
To be fair, it's creating 8 databases lol
I've gotta go to bed here, but in the mean time I'll drop my latest issue here. I've more or less setup pytest on site, but I'm having issues with the migrations.
If I completely disable them, the tests which test the migrations fail. If I enable them, they seem to run twice. I'm not sure how it's managing to bypass django's safety checks. I know for sure it's definitely migrated after the first time. I can open the database, and browse it. The migrations table is set correctly, and it's all there.
Running the migrations twice however is problematic, since the migrations make normally safe assumptions that we can't guarantee anymore
If it means anything, it fails on/after migration 47, and complains that:
sql = 'SELECT DISTINCT "api_user"."id", "api_user"."name", "api_user"."discriminator", "api_user"."avatar_hash", "api_user"....raction"."active" AND "api_infraction"."type" = %s) GROUP BY "api_user"."id" HAVING COUNT("api_infraction"."id") >= %s'
params = ('ban', 2), ignored_wrapper_args = (False, {'connection': <django.db.backends.postgresql.base.DatabaseWrapper object at 0x0000018EE7EB4430>, 'cursor': <django.db.backends.utils.CursorWrapper object at 0x0000018EE92727F0>})
def _execute(self, sql, params, *ignored_wrapper_args):
self.db.validate_no_broken_transaction()
with self.db.wrap_database_errors:
if params is None:
# params default might be backend specific.
return self.cursor.execute(sql)
else:
> return self.cursor.execute(sql, params)
E django.db.utils.ProgrammingError: column api_user.avatar_hash does not exist
E LINE 1: ...", "api_user"."name", "api_user"."discriminator", "api_user"...
E ^
Would it be possible the manage.py and the tests each run them?
The manage would've just been calling the django runner anyway, but the pytest integration bypasses the manage anyway
@brisk brook would you have an update on site#702?
site#702 *
The extension does allow you to add a custom runner which does go through the manage, but that has the same problem
I don't have more comments no. Please address the comments I have made though. Can you go through all the currently unresolved ones and either leave a response or mark them resolved? Assuming you do not want to apply the feedback they include
metricity#20 fairly small pr
I just noticed - Why doesn't @viscid badge have a review policy?
guess it was just never added
Our smaller projects don't use them
it does require 1 member to approve before merging
Because the builtin tools work better
So uhhhh who understands how the site's migration tests work 👀
Some of these use the current model, and a historical model at the same time, which creates conflicts when any fields are added or removed
Yet it works somehow
But bumping django from 3.1 to 3.2 breaks it
For reference, this stuff has not been touched since 2019 lol
I found the PR that introduced this: site#278
Since a migration is really snapshot in time of the migration history, this also allows us to work with the database models as they were at those two time points in the migration history (directly before and directly after applying this migration), since otherwise these tests will fail in the future if we decide to change the models.
This must be no longer true
migration tests?
We have some tests that ensure that a migration worked as expected
Which is... kind of strange considering migrations are historical and unchanging
To test the effect of the migration file, I've created a subclass of django.test.TestCase, MigrationsTestCase, that reverts the test database to the migration just prior to the one of interest. We can then inject test data, apply the migration, and test if the migration had the desired effect.
And this test breaks when bumping to 3.2? What's the error?
The latest (current) model introduces a field, which did not exist at the time of this migration. In theory according to the comment above, this shouldn't matter because we are only using the model at the provided migration. This was true on django 3.1. For whatever reason though, bumping to 3.2 has made it so that when the test itself runs, it is using the latest model.
The weirdest part though
The creation of the object itself is done before the test starts, and that's created correctly. But for some reason between the setup function and the test itself, it has updated the model, and somehow updated the old objects
The exception itself isn't super useful here, as it show's what's wrong, not the root cause, but here it is:
Failure
Traceback (most recent call last):
File "C:\Users\hassa\AppData\Local\pypoetry\Cache\virtualenvs\site-xCgAncD9-py3.9\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedColumn: column api_infraction.dm_sent does not exist
LINE 1: SELECT "api_infraction"."id", "api_infraction"."dm_sent" FRO...
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Github\PyDis\site\pydis_site\apps\api\tests\migrations\test_active_infraction_migration.py", line 451, in test_migration_leaves_user_with_one_active_ban_untouched
x = model_to_dict(infraction)
...
File "C:\Users\hassa\AppData\Local\pypoetry\Cache\virtualenvs\site-xCgAncD9-py3.9\lib\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column api_infraction.dm_sent does not exist
LINE 1: SELECT "api_infraction"."id", "api_infraction"."dm_sent" FRO...
I've omitted a bit of the traceback (the portion which goes into django internals), but the rest of the cropping (FRO...) is what the traceback actually looks like
It also has tests for the tests
It's tests all the way down baby
We never added anything beyond the tests for that specific migration
I'm contemplating just... removing them
These are the same tests which seem to be breaking my pytest work too
We can ask for Sebastiaan's opinion tomorrow, but yeah I am too
I'm currently checking out the release note for 3.2, to see if I can find something
Are we switching to pytest? 🤔
Initially I jumped to the last 3.2, because django's versioning guarantees it doesn't change on minor versions
But I've tested with 3.2.0 to make sure
And it has the same problem
Well, I haven't discussed it, I was just doing a cost assessment first. It's not a full-fledged pytest migration either, it's just switching to use the pytest runner with our unittest tests
We usually see a nice performance boost by switching to pytest (and changing nothing else), and then we get access to plugins like xdist which give an even larger boost
ok
Migrations don't modify the model. They only affect the database schema. Pretty sure that has always been the case with Django
You are technically correct
Yet it's still being modified
And not just the model, but instances of it too, which were created before the migration
I've gone ahead and printed the concrete_fields of the instance that is causing the issues:
# 3.1
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>) # Setup
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>) # Test
# 3.2
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.related.ForeignKey: user>) # Setup
(<django.db.models.fields.AutoField: id>, <django.db.models.fields.DateTimeField: inserted_at>, <django.db.models.fields.DateTimeField: expires_at>, <django.db.models.fields.BooleanField: active>, <django.db.models.fields.related.ForeignKey: user>, <django.db.models.fields.related.ForeignKey: actor>, <django.db.models.fields.CharField: type>, <django.db.models.fields.TextField: reason>, <django.db.models.fields.BooleanField: hidden>, <django.db.models.fields.BooleanField: dm_sent>) # Test
What you're looking for here is the model change in 3.2-test
For the sake of curosity, I also printed it after the migration, but before the setup function ended
It's the same as the setup on both versions
This supports this theory
This is what I found on the subject https://docs.djangoproject.com/en/4.0/topics/migrations/#historical-models
It's unclear how to use the historical versions
Lol I remember looking into that when Chris was removing a field needed in a migration
I came to the same conclusion
But I think this is unrelated to what our issue is
I think because it's unclear what that even is
Maybe using get_model instead of importing?
We are using get_model
In the tests?
Yeah
Hmm, I've checked the instances, not the model themselves. Not sure if those have changed too
There is something here:
Assigning objects which don’t support creating deep copies with copy.deepcopy() to class attributes in TestCase.setUpTestData() is deprecated.
https://github.com/python-discord/site/blob/48617b0425bb6b4c7f253f9b44363432658c2f1c/pydis_site/apps/api/tests/migrations/base.py#L36
Maybe, make it setupClassData?
pydis_site/apps/api/tests/migrations/base.py line 36
def setUpTestData(cls):```
Just a suggestion though.
I've done that now:
Setup ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base pre-migration ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base post-migration old ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Base post-migration new ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Test original ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
Test new ['id', 'inserted_at', 'expires_at', 'active', 'type', 'reason', 'hidden', 'actor', 'user']
It does not change at any point, just the instances do
I don't believe this is our case, but I'll try it anyway
Sorry, setUpClass
That's the only thing that could possibly go wrong, according to the release note.
So what am I changing
Well, that's done it for some reason
For some of the tests, some still fail
These are all due to the test_base tests though, which need to be rewritten, so I'll figure that out
The question now is whether we take the win and forget about this, or continue thinking about removing them
Looks like we won't get to make that decision, since setupClass terminates our database connection once it's done, which then fails everything else
@tawdry vapor @trim cradle is something supposed to be added to the yaml resource file or is everything supposed to "just work"
this is how it looks, no padlock icon or anything
Not sure why. Maybe use setUp by itself? It runs before each test, same thing as setUpTestData btw.
i'm guessing it should be fa-lock-alt or something. will test
That would run migrations on every test, which is... slow to say the least
yeah probably. css class must just be wrong
it was a paid icon so fa-lock-alt doesn't render either. i went with fa-solid fa-lock
can i learn how to rebase this branch?
Sorry, that was bigger than intended
git checkout pr-branch && git fetch origin && git merge origin/main
You've committed directly to his branch
What do you need to rebase?
If you want a rebase then change git merge to git rebase
I guess just to update with commits from main?
PR was just saying it was out of date, but looks like stel took care of it
Yeah, sure. I thought setUpTestData runs before each test, since the tests don't use TransactionTestCase, might be wrong though
Ah
There's an "update branch" button at the bottom of the PR page
Creates a commit like Merge branch 'main' into swfarnsworth/resources that brings all new commits from the base branch into your PR
I think it does actually use rebase, but all you have to do is push the button
oh
I'm wrong again
i just heard the update w/ rebase button for sure has surprising effects, i think
okie, i don't know how to get this OK to merge now though
is it the netlify stuff?
Rebase tends to cause problems because it's not very friendly
In the words of our esteemed Mr.@warm vigil, #voice-chat-text-0 message
no it behaves distinctly differently in the github ui, last i saw..
Oh this is the public dev channel
Sorry for the ping sir
I apologized!
You do what you want on your repo. I'm not a fan of rebasing esp on repo with a ton of other people working on it. It's a history rewrite and that may drive others insane.
We tend to allow rebases before and after reviews
During reviews it can be annoying as you've said
thanks Mark! i guess my review didn't count
I do not believe the netlify checks are required. Only the review requirement check is
The netlify stuff is broken at the moment in any case
Yes, because you committed to the branch.
The class-level atomic block described above allows the creation of initial data at the class level, once for the whole TestCase. This technique allows for faster tests as compared to using setUp().
https://docs.djangoproject.com/en/4.0/topics/testing/tools/#django.test.TestCase.setUpTestData
No, only the ones labeled requiredare actually required
In this case you can see that it's the review check that's still pending
If you click on "details", you can see the review requirements, and their current statuses
Normally Mina would be right, but right now due to the issues, the netlify check is allowed to fail
Under normal circumstances, we usually require all checks to pass
hm, this PR does not fall under content change rules?
For example now that Mark and I have left approvals, we've satisfied the requirements
here's a 🍪
And the check is now green
Am I allowed to post these images in public?
Yes anyone could go on GH and view it
It's already public is what I am trying to say
Right right, I think you have to be a member of the org to actually see the page itself
But the same information is already available in the review-policy.yml anyways
No because a new icon was added. Though maybe we should add that file to the list of exceptions.
hm i suppose it's fine, it's a python file and has some code in it
so say hypothetically i start a branch/PR that gets a bit old, or take over a stale PR whose branch is out of date. can't i do something to make that branch be "caught up" to the commits from main?
i thought that's what rebasing was (mostly) for
"Update branch"
Kind of
Merging and rebasing are two different ways of doing the same thing, combing commits from two different branches. (vastly simplified explanation)
You can use either way to update your branch with the new commits
why not just git rebase main ?
Rebasing is primarily useful for cleaning up your history. You could also use it instead of a merge, but it's not the only use case.
If you try git rebase -i <commit-sha> you will see there are lots of things you can do
Because that rewrites history
Merging creates a new commit(s) that add on the new changes, while rebasing actually changes which commit your branch started from to pretend it actually started somewhere else
Lots and lots of git people are purists and absolutely hate changing things
But it's with reason
When you pull someone else's changes and all of a sudden git says it can't process something because your commits don't exist anymore, it can cause issues
i kind of like this though. i guess i'm not a git purist
In the context of a PR it can cause GitHub to hide old reviews, or at least that used to be the case
It just makes it confusing for a reviewer
i see
I don't really care so much because the ship sailed long ago of keeping the history perfectly clean
So merge commits don't bother me
Also if you rebase and you're not the author of the commits, it will add you as a co-author (at least through GH; if you use commands and you really want to you can avoid that)
yeah that's what i was going to attempt
one more question, i edited the PR's original message to link meta#185 and meta#180 but github only linked to 185. is there a way to link #180 after the fact?
In the side bar of the issue, you can link the PR, then close it
Specifically under Development
dunno how to do that cross-repo
In that case, just link it in a comment and close
oh just separate lines?
AFAIK they can be on the same line
But you can't do closes #156 #157
It has to be closes #156 closes #157
yea
Anyone have thoughts on testing abstract models?
Instantiating them is undefined behavior in django, and it's explicitly disallowed in 3.2
From what I'm reading, you wouldn't test it in isolation anyway because you'll be testing it's inheritors
(The model is Message, and the only place it seems to be used is DeletedMessage)
I've pushed something for now to make sure nothing has broken yet, but I still need to keep bumping the django version a bit longer
@hardy gorge I've left a short write-up on site#740 about the migration tests. I would appreciate your input on it. I'm thinking of removing them
https://github.com/python-discord/site/pull/740#issuecomment-1179868636
I've replied
I've been looking for an easy issue to implement so that I get back into contributing to bot, and stumbled across bot#2168.
I see someone else was already assigned (donmonc) but it's been 2 months since then with seemingly no activity on the matter, so may I take over?
Thanks, you are amazing
what do you guys do to read a env yaml file?
env yaml file?
This seems like it's conflating two things. I think our only project which uses yaml configs is bot, and in that we load a dotenv file into the environment using python_dotenv. We have a YAML constructor which pulls keys from the environment
All together, it looks like this:
https://github.com/python-discord/bot/blob/main/bot/constants.py#L20-L58
Because the first version was released in mid-2021, while the constructor has existed for 4 years
Regardless, I'm not in favor of adding dependencies without good reason. It's another thing that makes maintenance harder, compared to 30 lines of code that haven't changed in 4 years
that's a staff member, let me follow up with him first
it was gonna be his first foray into our projects so just wanna check with him
How do we feel about moving all the d.py related tags under the discord tag namespace?
What about a discord_bots namespace?
It would look like this:
Okay, "DiscordBots", so the spacing doesn't duck it up like people do with polls
not that I can see, it's based off the folder name the tags are stored in
I'd still prefer discord for brevity
I would put things directly related to Discord's UX in there
But I don't think we actually have anything for that
are they all about dpy, or discord api in general?
Looking through those related tags they're all d.py related, none are about the discord api itself
"dpy"? It's even briefer
the group is still fuzzy matched so a longer name shouldn't be a big problem
yeah, with the discord_bots namespace, discord as a group name works fine for pulling it up
sounds good then
If it'll fuzzy match, we could use Discord Bots as a more astec - astehc - asctech?
aesthetically, thank you Google
huh i was gonna guess asstech
not sure how spaces would work
That parts a given
that would involve putting a space in the folder name and as someone who frequently uses windows I avoid that shit like the plague
Oh - You're parsing folder names - I forgot that part
Yeah, no, fuck that
DiscordBots it is
I need to con an admin-core dev into reviewing site#740
@vale ibex is my go to
It's a pretty small PR, most of the diff is deleting files :D
I'll take a look
if you can look at metricity#19 and metricity#20
both much smaller
Linting passes? Merge ✅
lol
Thanks
what's with this diff?
The message model is an abstract model, so instantiating it is undefined behavior
ahh cool
In django 3.2 it's illegal
you're illegal
Thanks 🤩
that was a pretty easy one to review lmfao
there was like 10 lines of actual things to look at
Alright, I think I figured out alt-names for our tag system

I know I didn't make an issue or get it approved........ but I'm gonna open a PR anyway
I wonder how a symlink would work
I just added this as a metadata feature you can add to specify alt names and then add the alt names as part of the tag dict to search
runing on windows host would likely complain
So update on the static previews thing
I've written most of it as a github app that's managed by django
But now the part I didn't anticipate is that there is a portion of the process where we just sit around and wait
Original plan was to do this async, since I added httpx, and django 4 has support for async views
But not DRF apparently
Any thoughts?
I could do CF workers, but I'm keeping that as a last resort because it's much nicer on site
Waiting for... a technical dependency or a bureaucratic dependency ?
If the process happens too fast, we can't optimize it in the future
Lol it waits for the github build to finish
What's wrong with CF Workers?
Nothing, it's just that we have way fewer JS devs than python devs
Oh right
CF doesn't support Python
Why did I write pycharm
This is why you don't multitask kids
Well, what if I don't make this a DRF view, but just a regular view 🤔
It's not using the ORM, or any of the other DRF features
Maaaaybe I can get it to work with django's async_to_sync and DRF
Damn - I'm going to have to learn Djagno
Why would this be better?
I'd like to learn, but I don't want to make you to type out the whole thing, so feel free to tell me to RTFM
Oh I don't mind explaining, but I'm not too familiar either
DRF doesn't support async views though
It's a rather new feature in django
There's a discussion on the DRF repo, but it's still all tentative
@vocal wolf with the review of bot#2213 we will be one step closer of allowing you to invoke the new !dashmpip tag with !minusmpip =P
lol
Did you not lint before you pushed??? To the shadow realm you go.
I did! The precommit hook didn't catch it or didn't function correctly D:
are you sure pre-commit is installed? That's what usually gets me
Yeah, it's been installed since forever and I got pissy at it like 2 days ago
hmmmmmmmmm
my precommit on sir robin was borked somehow and I had to re-poetry install the other day
thread pool?
I think that's more or less what the async_to_sync util does
It says it runs in a "sub-thread"
yea, sounds about right
Code looks functionally fine, and linting mostly passes, now waiting on the whitespace one lol
@vale ibex So you're like the local king of interactive rebases. I can do that and rewrite the SHA of commits on a feature branch and it should be fine as long as it hasn't been reviewed or checkout by anyone else, right?
Yea, rewriting history like that is fine so long as other people don't have it checked out
I do it quite a lot 😅
and yea as you said it can mess with github reviews sometimes, so usually best not to do it if there are active comments
Yeah that's fine, just lmk
okay now we're good!
oh COME on you didnt seriously add minus m pip lmaooo
:3c you can blame @dim pelican for that suggestion
so when you do a rebase locally, you need to git push --force
otherwise it will just do a merge commit in gh :D
yeah I'm a moron :D I realized after
if you wanted to fix, you could do git rebase -i HEAD~7 and drop the 4 commits you don't want
I'm always a bit terrified everytime I have to use HEAD because I've never not fucked it up. So I just called it a day and let it be
fair enough
also, with the fstring aliases, does the fuzzy matching not give us that for free?
» sql-fstring
» f-strings
Ahh
What if we made this a dropdown that invokes the command. No idea how smart this is
if only you could spawn ephemeral messages from message commands
would be even cleaner
but that does sound good
New tags
• !dashmpip tag showing how to install things via pip without relying on pip being on PATH.
• !regex tag for explaining what regex is and providing some of our favorite resources for testing regex.
Check out all of these tags in #bot-commands ✨
Updates & new features
•.uwu got a major facelift
The new uwu-levels are off the charts. Thanks to LP and Shenanigans for the update and Bluenix, lemon, Senjan, and ToxicKidz for the review.
•.uwu will also work if you reply to a message! Thanks to Shenanigans for the change and Chrisjl and Scaleios for the review.
• .latex is now allowed in the data science and AI channel and it has amsmath support. Thanks to Chrisjl and Verboof for the changes, and wookie, fix error, and hsp for the reviews.
• !charinfo is now allowed in all channels (except for python-general). Thanks Chrisjl for the change and MrHemlock and Mark for the review.
• typing-extensions is now part of snekbox! Feel free to type-hint away~
You can check out what the above commands do in #sir-lancebot-playground as well.
I wanted to changelog .uwu, figure I should changelog everything else that we've done for a bit as well. How does it look? Will replace names with actual pings
looks good to me
there's a bunch of other things been merged since the last changelog, we should try to catchup
dependabot does flood this a little
So I was planning on not changelogging anything from Sir Robin or Forms or bot-core, just because it's not really ultra user facing like Python or Sir Lance are
Thank you for the changelog entry
I feel important now
i too feel important now
isnt regex old?
we are very behind on the changelogs
last changelog was timeit command
lol
wait, did we ever changelog the uwu-fication update itself?
lmfao, okay will update my text
too late, already gone through all 19 pages of the other thing 
ah lol
I think I captured everything though at least public user facing
a lot of the bot changes are mod speciifc
I do think we need a mod-specific changelog though
we post relevant stuff in mod announcements
Cause there are a fuckton of improvements and I think some went unnoticed
wot if we automated generating prompts for us to changelog things
how would you parse the changelog-able from the not?
label on pr 
we could just generate a list of merged PRs and toss out the ones we dont want
What part of everything gets a changelog entry do you not understand?
It's like 90% stuff we don't want
I do like the label idea
Multiple 10k powered-by-nitro messages of changelogging Scale's dependabot rebase
Have an action that runs on merge that sends an even if the merged PR has a label?
The other hard part is the connection between github username and discord username for non-staff, if we wanted to 100% automate it
okee, gonna post this shortly, any last comments?
@vocal wolf triage lead, thoughts on adding a label on PRs we'd like to changelog so that way it's easier to find what we're interested in?
'tis a momentous decision
y'all pls.... I was so close to pressing enter on the changelog. Now I have to changelog the tag aliases too ;-;
.uwu
i'm wondewing nyani cowow it shouwd b-be
Can I get an admin or mod to pull all tag usage from grafana or whatever stats service has that available from the past 6 months?
You should be able to see that page for the next hour
@sharp charm#6000 I'm working on a resource on site which should redirect to a download URL on github after some processing. Which status code should I use, and would it affect our SEO (I can do it in another way if that's the case)
Thanks discord
wrong joe
Yeah I figured
@patent pivot
Thanks
I literally couldn't bring this discord to find him
Went looking for his ID lol
ye lol
303 looks promising
That count doesn't look correct, param_arg at 4k? kindling only at 114?
what's it going to be accessible at? pythondiscord.com/... or are we subdomaining?
no we are not subdomaining because we removed that
pydis.com/api/....
uhhhh
It's looking like DRF won't even accept that, so I might just return the URL in the body, and handle it in the receiver end
pick whatever you feel is most appropriate, we should get a working robots.txt for pythondiscord.com
hmmm maybe, given a redirect probably isn't with REST principles
Btw ^
hmmmm
I think the table might just be wrong,
whhmmm
yeah
why is graphite spitting out 500s like the US spitting out those golden stimmy checks
Timeouts maybe lol
Is this now or in general
Because I'm going crazy on the query console
It's volccy's fault for not stopping me
time to fix this live
real life fixing this right now real
oh
11/07/2022 19:13:20 :: [console] Error creating stats_counts.bot.pep_fetches.375: [Errno 28] No space left on device
11/07/2022 19:13:21 :: [console] Unhandled Error
Traceback (most recent call last):
File "/opt/graphite/lib/python3.9/site-packages/twisted/python/threadpool.py", line 260, in <lambda>
inContext.theWork = lambda: context.call( # type: ignore[attr-defined]
File "/opt/graphite/lib/python3.9/site-packages/twisted/python/context.py", line 117, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File "/opt/graphite/lib/python3.9/site-packages/twisted/python/context.py", line 82, in callWithContext
return func(*args, **kw)
File "/opt/graphite/lib/carbon/writer.py", line 191, in writeForever
writeCachedDataPoints()
--- <exception caught here> ---
File "/opt/graphite/lib/carbon/writer.py", line 142, in writeCachedDataPoints
state.database.create(metric, archiveConfig, xFilesFactor, aggregationMethod)
File "/opt/graphite/lib/carbon/database.py", line 144, in create
whisper.create(path, retentions, xfilesfactor, aggregation_method,
File "/opt/graphite/lib/python3.9/site-packages/whisper.py", line 537, in create
fh.write(zeroes)
builtins.OSError: [Errno 28] No space left on device
11/07/2022 19:13:21 :: [console] Error creating stats_counts.bot.channels.pythonlogoonrslashplace: [Errno 28] No space left on device
lol
@gritty wind
let me give this guy a little extra wiggle room
Joe I expect every data store to have 8TB dedicated storage
Preferably m.2 ssds in raid0
Thanks
oh
huh
the vol is 30GB in Linode console, but not in Kubernetes API
what's the actual pod saying hmm
I can see the preview of the stream, but not the stream itself
20GB on system
Amazing
so just not resized
Change the PV :O
Lol Yea this is postgres volume all over again
shutting down graphite
Yeah good riddance, it was bloatware
We had to resize the volume manually in the node and then restart the node
I love how Joe is basically screensharing to himself in #dev-voice lmao
alright should be fixed
no restarts needed because i am sysadmin pro
they should give me a medal
okay it should be fine now -- but those stats still seem skewwhiff, now that might be because of the storage being fucked but there might be another root cause, so it's something to keep an eye on
and we need to go cry to Linode that they really need to expose volume use stats
Fwiw I remember tag usage statistics being off months ago back when I was a mod
So if the storage was only now then there's some other issue I think
hmmmm
It's not a storage issue, it's a query issue
When I pulled it up as a graph, it matched my discord search
My lack of understanding of graphite, and my unwillingness to learn it means I can't debug it :D
We should get the autospec helper from bot added to botcore
Would love to have it on site
Oh, would we consider having botcore on site, for the non-bot related utilities
Petition: rename bot-core to pydis-core, and use it on site :D
I would appreciate feedback on the approaches outlined here, or suggestions for alternatives https://github.com/python-discord/snekbox/issues/148
If there were more things that need to be shared with the site, then we could consider it. But for just one file I don't think it's worthwhile.
Hey, that rhymed.
Can I get an issue approval on sir-lancebot#1072 ?
Only the @coredevs are supposed/allowed to add the "approved" label, right?
Apparently yes. That's what its description states. But I'm not sure if that necessarily needs to be the case.
I guess it depends on the scope of the issue so it's easier to just put a blanket requirement of core dev approval.
Yeah basically
From the internal core-dev policy:
The decision to approve an issue always falls down to a core developer decision. That is, it’s your responsibility to approve, block, or discuss issues from any technical aspect.
If the decision on approving an issue or not falls down to a policy matter (e.g: should we allow ...), then it will most likely be an organizational decision. That might mean requiring admin approval, discussion on the org-repo, or a staff meeting.
Which is more words to say what Mark has said. If an issue is created which is related to an event, it's probably fine for Kat to approve it. But there are a lot of nuances and pitfalls here, so it's easier to say ask the core dev.
Feedback for future change logs: listing the relevant contributors makes the changes noisy/difficult to read. I think it would be better to create a separate section at the end that thanks all contributors, without attributing a specific change to each one.
every damn time I always click "assign myself" on an issue
It's not just you don't worry
@fossil veldt, sir-lancebot#1072 has been approved
Thank you for your service, both to us here in this guild, and to the advancements of uwuification algorithms as a whole

I remember looking into using phonemes instead of graphemes but it turned out that there wasn't anything that can precisely map the latter to the former. If I recall correctly things like digraphs wouldn't properly be mapped, so it was difficult to generate a word that preserved the original spelling when needed.
oo I was working on that
is this for English?
Yes
I'm not sure if I shared the failures of my research here or if it just stayed in my head. Don't remember the exact details at this point.
English is essentially the most difficult language to do this in, (even more than French, which is the 2nd worse)
I've made an attempt at https://github.com/ionite34/Aquila-Resolve
All I can find is https://github.com/python-discord/sir-lancebot/pull/260#issuecomment-523621967 which is my start
It is the first deep learning Grapheme-to-phoneme model to preserve input part of speech tokens during training
and as such can resolve sentences like: (disambiguating 'read' and 'read' correctly)
g2p.convert('I read the book, did you read it?')
>> '{AY1} {R EH1 D} {DH AH0} {B UH1 K}, {D IH1 D} {Y UW1} {R IY1 D} {IH1 T}?'
Sounds very cool and also very over my head 😄
it also can resolve the phonemes for new graphemes / made-up words
such as
c1_reg is my model, on top are Google's espeak and Deep Phonemizer
those mappings are from https://en.wikipedia.org/wiki/ARPABET
So how can you get the map of graphemes to phonemes cause it's unclear from the example you showed
essentially each phoneme definitively map to an English pronunciation, unlike graphemes
it was a seq2seq model
otherwise there are dictionaries that transform well-known words
there are no real rules as English pronunciation is very arbitrary
so just using that dictionary, you could get
cmudict['abalos'] -> AA0 B AA1 L OW0 Z
Let's say there was a word like aballos, so there is a digraph ll but the phoneme is still just L. You'd need to know that L covers ll.
That's the problem I was facing
omg "what" translates to nyani
ok carry on
well it's not really meant to go back the other way around
some words have different spellings but are pronounced the same
having the same phonemes means the word is pronounced the same, it doesn't retain the spelling information
I recon LP is behind that
That was the problem. If I want to uwu-ify a word, it'd be weird if the spelling change for the letters that aren't meant to be uwu-ified. It could make the word too unrecognisable.
Like I see "B" phoenem and say "okay this one I just want to leave as it is", but I don't know which characters that maps to in the original word. So I could just assume it maps to "b" but that may not necessarily be true since spelling rules aren't consistent.
I think another approach may be POS-parsing
or interpreting whether each word is a verb / noun / tense, etc.
if something is a verb, you could replace it with a uwu-fied verb
it's obviously lossy in terms of information, but the sentence would still be valid grammatically
So, the meaning of the sentence could change, but grammatically it's still valid, and the replaced word would still sound similar to the original?
I suppose.. yeah
but that'd have problems of its own, again the loss of information is pretty high there
I have half a mind to just fine tune a GPT-2 model to uwu-fy text and see what happens 👀
Because like, uwu-fication is not just about 1:1 word transforms fundamentally right? Sometimes you need to add whole sentence parts, or express meanings in different ways.
I'm not sure. I haven't analysed uwu-fication forms carefully.
I thought 1:1 would be a decent result anyway
GPT-J 
Woah policy bot got a serious UI update
It now actually explains stuff
Genuinely mind-blowing
@tawdry vapor have you tried running the PR locally? When I merged the normal postgres with test-postgres, the tests became slow again
I checked that all the settings were applied in psql, so I can't quite figure out why that would be
The only thing that should be different is the actual prod data, but I'm not sure how that would affect it
No I have not tried it yet
I can in a moment
You want me to test it as it is now, before your merging of the services?
Yeah give it a go, though I suspect that you might not notice an improvement either way. The benefits might only be a windows thing, since CI is already 20 seconds
I think I'll drop my database and try again
This is a little funny. I dropped my main DB, recreated it from scratch with the same arguments as the test db, on the same port as the test db, but still it managed to be slower
I wonder...
Hahahahaha no way
The speed loss wasn't actually from the database, but the networking adaptor
The speed gain was because the test DB didn't define the host
That would also explain why the CI was so quick
Sorry I am just getting around to this
Do you still want me to test?
And what do you mean by not defning a host?
Well, I'd be curious to see if you can replicate the same thing I have, but you don't have to
We went from 127.0.0.1:port:port to port:port
That seems to have been the only thing that made a difference
🤔 that saves almost 5 minutes?
I honestly have no idea what's up with it lol
Okay let me try
It's entirely possible I have something borked with my networking, but I can reproducibly slow it down by adding the host back in
On your branch the result was 28 seconds for tests
On main, for some reason poetry run task test is getting hung up on something and I'm not seeing any output
Oh wait I forgot to restart the db
Make sure to compose stop and start to apply the changes
Yeah I pruned in between
Perfecto
It ran 96 (out of almost 300) in 49 seconds and then failed
django.db.utils.ProgrammingError: relation "auth_user" does not exist
LINE 1: ...user"."is_active", "auth_user"."date_joined" FROM "auth_user...
I kept getting that error when migrations werent done
I don't think it applied migrations before the test
Ye ye
It's not done yet but it's clearly taking a lot longer on main
Feel free to call it, I think this is enough proof
Just finished: 162 seconds
Almost 6x slower
I guess docker must be doing something smarter with the networking when we don't set the IP
I tested on main with the modified pg command only, and it saved a negligible 1.5 seconds
Not enough to even rule it out of general variance for runtimes
first time docker and smart have been put together
phone guinness
Nah I've been running docker on my smart watch for ages
Joe you understand this stuff, explain pls
Alright I've pushed the changes and overwrote the old ones
I resubmit for your consideration
I couldn't find anyone citing similar performance issues except this https://github.com/docker/for-linux/issues/169
I don't think it's quite the same situation though
I found some DNS stuff, but it seems unrelated too
Regular expressions
Regular expressions (regex) are a tool for finding patterns in strings. The standard library's re module defines functions for using regex patterns.
Example
We can use regex to pull out all the numbers in a sentence:
>>> import re
>>> x = "On Oct 18 1963 a cat was launched aboard rocket #47"
>>> regex_pattern = r"[0-9]{1,3}" # Matches 1-3 digits
>>> re.findall(regex_pattern, foo)
['18', '196', '3', '47'] # Notice the year is cut off
See Also
• The re docs - for functions that use regex
• regex101.com - an interactive site for testing your regular expression
The foo in the findall method should be x, or the x variable should be foo
Yes, I think you're right
foo is for foonctions
text would be better
Probably yeah
i think scoff might have changed things around to appease my character per line limitation on macOS so that each line of code doesn't wrap
idk if something's changed but it currently doesn't fit on one line anyway now lol
nevermind the line he was trying to make fit was a different line. ^ @wild prism wanna fix?
Can I get a review on sir-lancebot#1073
It was mentioned in #python-discussion here: #python-discussion message
It all LGTM, but I'm not too familiar with it yet
Hey, I tried running docker-compose up for the pixels repository, but for some reason it hangs on installing poetry dependencies. Specifically, the moment it reaches sniffio dependency, it just doesn't seem to be doing anything, I tried waiting it out, but that didn't help. When installing locally poetry install is finished in just a few seconds
Any ideas what's going on here?
hmmm, I'm not sure, I just tried to build the docker image and it worked fine for me
what version of docker & docker-compose do you have installed?
it should be up to date, it's managed by my system's package manager
oops, forgot sudo with the second command
yea, those are the same versions as me, so I really don't know
I'm using the experimental build engine though
yeah me neither, it's such a weird issue
I know that just running postgre and redis works fine
so it shouldn't be a docker issue
well, sometimes there is some other package that's printed last, but it always stops somewhere around sniffio
I think that's just because of some concurrency in poetry or something
like here it stopped at typing extensions
(I've even tried bumping down sniffio to 1.0.0 which is why the version here isn't 1.2, but that didn't help)
yae I just cleared my docker system cache and did a docker build, and it worked fine
so it shouldn't be anything to do with the versions etc
that's so weird then
I don't have any local changes, this is the exact version that's on github
hm, building it on my ubuntu based server also works without issues, so it must be some problem with my installation, but I just can't figure out what it could be
you could try enabling experimental builds for now
