#dev-contrib

1 messages · Page 21 of 1

rapid igloo
#

haha, that could work for colors in bulma settings

#

now coming to think of it, there might've been a few places where I had to manually adjust some color variables to be dimmer/brighter, then set in the css (due to limitations of css as compared to scss), though I tried to keep that a minimum.
I could go and look through them when I get the time, but I'm not sure if it'll be too helpful to note these down, because if someone is working on that area specifically they will see it in the css file (where I have added comments)

crude gyro
#

I just figure, if they're changing stuff inside that dictionary, they might think the change will affect everything on the site, and it won't. But the tip you gave about search and replacing the hex is pretty good, I think.

#

just having that bit of information in a nearby docstring may save some frustration for someone in the future

#

I wouldn't start listing every single place you needed to make changes

#

just more of a general heads up

rapid igloo
rapid igloo
crude gyro
#

mm, alright, fair

rapid igloo
#

I could PR something like this soon 👍

vale ibex
#

sir-robin#112 wil make it easier to stop issueing the completionist role this year, and future years, ratehr than having to comment out the line each time

dusky shoreBOT
vale ibex
#

There's also a bunch of general improvements in the PR that I did while writing & testing this feature

vale ibex
#

Nice, ty

vale ibex
#

@crude gyro where are youlooking for the test output in CI?

#

I don't think we output a list of tests that ran in the CI anywhere

crude gyro
#

the coverage report shows the files that were run

#

the file wasn't in that list

vale ibex
#

we have test coverage on the tests 💪

crude gyro
#

testing the tests

#

next level

timid sentinel
#

Did you try to find it by ctrl f before by any chance?

crude gyro
#

I did that first, but that didn't work, so I skimmed the list and I probably just missed it

#

I'm very old, you see

timid sentinel
#

because that's something I hate about github. It lazily loads stuff so you can't just ctrl-f

#

stupid

crude gyro
#

mfw looking for a test

vale ibex
#

Ah yes

crude gyro
#

hahaha

timid sentinel
crude gyro
#

oh thanks

#

no wonder I couldn't find it they all look the same!

vale ibex
#

pytest should encode the test number in the rgb values of the dot

crude gyro
#

to make a beautiful rainbow

vale ibex
#

Yup, and since we use pytest-xdist for multiprocessing, they'll all be in a random order too

royal prawn
royal prawn
#

aren't the monitors that can even display 10-bit colors high-end now?

#

oh, that's 10 bits per channel, 16 is 5+5+6. nevermind

vale ibex
#

yea, and greenshould get the extra bit, for obvious reasons

crude gyro
#

just use ROYGBIV and then rotate back to R

#

raaainbooow

#

can we please make the tests a little gayer

#

I vote we run the whole output through lolcat

royal prawn
#

it might be neat, and possibly convincable, to get different test functions/classes/files/etc as different colors

vocal wolf
#

bot#2580 is in need of reviews. be there or be less there.

vocal wolf
#

@timid sentinel henlo give review thanks

royal prawn
#

i take that discord.py doesn't have a feature to detect that in advance?

vocal wolf
#

if it does exist, I haven't found it

wind ruin
dim pelican
vocal wolf
#

@outer oasis Fix. thanks. sir-lancebot#1404

vocal wolf
#

@tame pebble Yo what's good gamer, can I get uhhhhhhhhhhh sir-lancebot#1197

dusky shoreBOT
covert fog
#

oh

#

there were but in my testing

waxen jasper
#

hey, i want to contribute, how does the process go?

rapid igloo
# waxen jasper hey, i want to contribute, how does the process go?

!contribute

We have a bunch of open source projects mostly written in python. There are detailed guides on how to set up the development environment on our website linked below.
Sir-lancebot is a good place to start, it's a discord.py project with fun commands and events/info related commands.

Contributions happen through opening issues and PRs on the GitHub repos. Feel free to discuss in this channel too.

stable mountainBOT
#
Contribute to Python Discord's open source projects

Looking to contribute to Open Source Projects for the first time? Want to add a feature or fix a bug on the bots on this server? We have on-going projects that people can contribute to, even if you've never contributed to open source before!

Projects to Contribute to

  • Sir Lancebot - our fun, beginner-friendly bot
  • Python - our utility & moderation bot
  • Site - resources, guides, and more

Where to start

  1. Read our contribution guide
  2. Chat with us in #dev-contrib if you're ready to jump in or have any questions
  3. Open an issue or ask to be assigned to an issue to work on
outer oasis
#

I uh...

#

I actually need help with regex

#

I'll go poke pygen in a minute

waxen jasper
#

im tryna figure out gitpod but its really confusing, it says i need to have cloned the repo but then gitpod opens a ssh connection

#

i dont want to use ssh and instead want to do it locally

#

do i have to use gitpod then?

dim pelican
#

No, you can use Docker instead

outer oasis
waxen jasper
outer oasis
#

Yeah, with Docker for any supporting services

timid sentinel
#

For lancebot you don't even really need docker.

waxen jasper
timid sentinel
#

You just need to remember add REDIS_USE_FAKEREDIS=true to your .env for it to work

tame pebble
dusky shoreBOT
waxen jasper
#

why am i getting this?

#
Installing the current project: sir-lancebot (0.1.0)
The current project could not be installed: No file/folder found for package sir-lancebot
If you do not want to install the current project use --no-root```
#

poetry install this is the command btw

vale ibex
#

that's fine to ignore

waxen jasper
#

aight!

vale ibex
#

FWIW it's a fairly new thing in poetry, geared towards library maintainers

vocal wolf
#

I have pinged the almighty chris in the issue, as well

tame pebble
timid sentinel
#

but locally they aren't

#

I'm pretty sure I'm running on main locally

#

it seems that the css from bulma.css is being applied in a different order in prod, is cloudflare messing up the css when minifying it??

vale ibex
#

and it still seems bold

jovial barn
#

so Chris.

#

are you software developer?

vale ibex
#

ah, I've also just disabled CSS minification

#

which is separate from the cache

timid sentinel
# vale ibex ah, I've also just disabled CSS minification

The HTML element controlling the text has the card-header-title and subtitle classes, both of which are defined in bulma.css. I tried prettifying the minified version from prod and comparing it to the version served when I run locally, and it seems the relevant definitions affecting the font weight are in a different order on each:

prod:
line 4822: .subtitle font-weight: 400 
line 10492 .card-header-title font-weight: 700

dev:
line 675 .card-header-title font-weight: 700
line 6218 .subtitle font-weight: 400

suggesting it could be the minification, but that seems like such an obviously breaking transformation...

vale ibex
#

how weird

#

ntos ure where it's getting minfied either

#

I've disabled everything in cf

#

do we have something in site itself that's minifying statically served files?

timid sentinel
#

headers suggest it's still being cached+minified for me

vale ibex
#

I turned it back on

#

one sec

#

try now

timid sentinel
#

ok now it's not minified, but it's still different, so it seems the css is different before minification/cloudflare

vale ibex
#

its bold for me lcoall;y too

#

have you rebuilt your docker image recently?

timid sentinel
#

I'm not using docker, i'll try just remaking my env

vale ibex
#

have you ran collectstatic?

#

lines 25-34 in the dockerfile

timid sentinel
#

aaaaaah

#

got it

#

lol

#

that was painful

stable mountainBOT
#

django_simple_bulma/finders.py line 116

for dirname in self.bulma_submodule_path.iterdir():```
timid sentinel
#

And iterdir returns the contents of a directory in an arbitrary order

vale ibex
#

ah lol

outer oasis
timid sentinel
#

I don't think so, you can sort the result fairly easily though

#

what i'm not sure about is if there's a "correct" order

#

other than just being consistent with e.g. alphabetical order

pseudo gorge
#

Can anyone tell me what I'm doing wrong? I'm trying to install a simple program with pthon

pseudo gorge
#

yea..

thorny obsidian
#

@vale ibex how did you test the scheduler changes for AoC?

rapid igloo
#

I've only observed this to happen on mobile, chrome-based browsers

#

it may, or may not, have been introduced after dark mode, but I've double-checked that the commit which may affect this does the image styling correctly

vale ibex
vale ibex
#

I tested the other scheduler stuff by changing the arrow.now(EST) call at the start of the while loop within the tasks to different times last year

vale ibex
#

Also, I lied in github, for some reason sir-robin doesn't hook up to sentry

#

I'll fix that later

waxen jasper
#

hi @timid sentinel, i noticed u added this comment, i didnt quite understand what u meant by it

waxen jasper
#

sir lance bot

vale ibex
#

Ah yea I see what wookie means

#

these changes

waxen jasper
vale ibex
#

yea, we don't use that on our repo

#

we use ruff

waxen jasper
#

sorry about that!

#

i run ruff at the end tho

vale ibex
#

since we use ruff, we have ruff line length configured, but not black

waxen jasper
#

alright, ill change that

#

also another question

vale ibex
#

sure

waxen jasper
#

so for the same command

#

there are a few class variables

#

but they are all used in one and only one command

#

should i convert them to normal variables?

vale ibex
#

do they need to persist across command invocations?

waxen jasper
#

i think the current channel needs to

#

since it redirects u to the channel

#

but i dont think self.correct needs to stay

vale ibex
#

alright, if it doesn't need to persist accross different inocations, then yea we can make them normal variables

waxen jasper
#

aight!

thorny obsidian
outer oasis
# vale ibex Also, I lied in github, for some reason sir-robin doesn't hook up to sentry

Speaking of, @vale ibex I've been meaning to talk to you about Sentry
It marks my commits as being included in several releases, even though we release on every merge
It always says "20 commits [in this release]" -- is it always just taking the last 20 commits?

I don't really know where to start looking with this one
But I did notice that we use a custom action: https://github.com/python-discord/sir-lancebot/blob/main/.github/workflows/sentry_release.yaml#L13
Is there a reason for that?
I've only ever used their offical action, and it's always been fine for me: https://github.com/letsbuilda/anubis/blob/main/.github/workflows/sentry-release.yaml#L15-L22

stable mountainBOT
#

.github/workflows/sentry_release.yaml line 13

uses: tclindner/sentry-releases-action@v1.2.0```
`.github/workflows/sentry-release.yaml` lines 15 to 22
```yaml
- name: Create Sentry release
  uses: getsentry/action-release@4744f6a65149f441c5f396d5b0877307c0db52c7 # v1.4.1
  env:
    SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
    SENTRY_ORG: ${{ vars.SENTRY_ORG }}
    SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
  with:
    version_prefix: "${{ vars.SENTRY_PROJECT }}@"```
outer oasis
vale ibex
#

sir-robin#114 for sentry integration

dusky shoreBOT
timid sentinel
#

IIRC the official one is not really maintained

outer oasis
# dusky shore

I keep forgetting how much lockfile changes inflate diffs

timid sentinel
#

oh actually it might be good now

outer oasis
#

Would you accept a PR on Lance trying out switching to it?

vale ibex
#

Sure

outer oasis
#

Cool
I'll poke at that later today

timid sentinel
thorny obsidian
#

@vale ibex is the profiles_sample_rate no longer an experiment?

vale ibex
#

but they made it backwards compat, so setting it in experiments still works

waxen jasper
#

first PR :D

outer oasis
#

Poor @humble leaf

#

Being made an example of

timid sentinel
vale ibex
timid sentinel
vale ibex
timid sentinel
#

My guess at what is happening is that there's a bug in cloudflare mirage's lazy loading. The way it's meant to work is that if it detects you're on a mobile or slow device, then it transforms images in the HTML

<img class="dark-image" src="/static/images/resources_dark/sentdex.png" alt style="height: 50px; ">

to something like this:

<img class="dark-image" data-cfsrc="/static/images/resources_dark/sentdex.png" alt data-cfstyle="height: 50px; " style="display:none;visibility:hidden;"><noscript><img class="dark-image" src="/static/images/resources_dark/sentdex.png" alt style="height: 50px; "></noscript>

And injects some JS that detects when the user has scrolled to the image and sets src and style to the values in data-cfsrc and data-cfstyle, deleting the style that made it hidden (thereby lazy loading it and saving bandwidth).

However, I think that the backend HTML transformation doesn't happen for SVG images, but the style attribute is still removed by the JS when the image is viewed, so the height styling is removed.

vale ibex
#

to cloudflare's credit, it is still marked as a beta optimisation, so something like this isn't un heard of

#

Any chance of a second review on sir-robin#112

dusky shoreBOT
tame pebble
last patio
timid sentinel
rapid igloo
rapid igloo
#

and also @timid sentinel, regarding the font awesome thread was just wondering, what specifically do you mean that django fa plugin can help with it?
AIUI lemon suggests we stop using it entirely and host the icons ourselves (imo because we don't want icons to be served only "sometimes" due to the 10k limit).
doing so would:

  • drop the js/css/fonts baggage of resources
  • prevent inclusion of icons we don't need
    although using that plugin can let us include only css/js files that is needed on the page, it's still under the usage limit right?
#

btw I'd also include that switching to host our own icons also has these disadvantages

  • might need to write some css for fine-tuning the icon styling
  • less easy to try-out multiple icons before deciding the one to use during development
timid sentinel
# rapid igloo and also <@493839819168808962>, regarding [the font awesome thread](https://gith...

I meant https://fontawesome.com/docs/web/use-with/python-django, which which would be a drop in replacement. It just bundles all the js/css/fonts into Django's static files so all that stuff would be served by us and we don't need to worry about kits/tokens/their cdn limits etc. (though the django plugin isn't really necessary for that, it could be better to just copy the files we need into the repo ourself)

Trying to manage each icon we want individually sounds like a bit more of a pain, the current way the icons are packaged using css and fonts is quite convenient, so I'm not sure if it would be worth adding complication just for a bit of a performance increase. I don't know exactly how that would work though so I can't really tell.

rapid igloo
#

ahh I see, my bad 👍

crude gyro
#

doubt it'll take much of a performance hit.

waxen jasper
#

what would be a good way to figure out where the head of an avatar img is? i can use cv2 but then the cascades will be a problem since it wont work for everything

vale ibex
#

Sounds like a non-trivial problem. Most facial recognition models are built to detect human faces, but I'm going to hazard a guess that they'll be a small minority of profile images

waxen jasper
vale ibex
#

Yea, that's my point, you'd need to find a model that's works for those

#

But most are trained on human faces

waxen jasper
waxen jasper
#

but dont really have the processing power

#

any other ideas?

rapid igloo
vale ibex
waxen jasper
vale ibex
#

and what is that command going to do?

waxen jasper
#

its like the easterify and spookify commands, so i thought maybe we add ice/snow and then a santa hat

vale ibex
#

Ahh right

#

Maybe a wreath around the edge, rather than a santa hat then?

#

similar effect, with way less complexity

vale ibex
#

Cool, sir-robin redis data migration was a success

#

Also updated the global namespace to be sir-robin instead of bot to make it easier to see what is what

#

&aoc toggle

humble leafBOT
#

:+1: Completionist role issuing is now on.

vale ibex
#

fyi @thorny obsidian

tame pebble
#

This has a one character change
bot-core#203

dusky shoreBOT
tame pebble
#

The version's stuck in the past

vale ibex
#

ah that's annoyiong that I missed that

#

the tagged version will have 10.6.0 now too

#

Ah well, this fixes the site at least

tame pebble
vale ibex
#

will wait for CI to finish and merge

tame pebble
vale ibex
#

@thorny obsidian I also just noticed sir-robin#75 do we still want to increase the time of the loop?

vale ibex
#

fwiw the loop uses the leaderboard cache, so it's not a huge amount of requests actually making it to aoc

thorny obsidian
#

I think it's fine

vale ibex
#

👍 Closed the issue

atomic ivy
#

Do we have a command to convert Discord timestamp format or a "human readable datetime" to a duration understood by !remind or other such commands?

tame pebble
#

Yeah we do

#

!source remind

stable mountainBOT
#
Command: remind

Commands for managing your reminders.

Source Code
tame pebble
#

It's in bot.converters

#

let me double check

#

!remind "in 2 hours" to go to sleep

stable mountainBOT
#
Bad argument

in 2 hours is not a valid duration string.

#
Command Help

!remind [mentions]... <expiration> [content]
Can also use: reminder, reminders, remindme

Commands for managing your reminders.

The expiration duration of !remind new supports the following symbols for each unit of time: - years: Y, y, year, years - months: m, month, months - weeks: w, W, week, weeks - days: d, D, day, days - hours: H, h, hour, hours - minutes: M, minute, minutes - seconds: S, s, second, seconds

For example, to set a reminder that expires in 3 days and 1 minute, you can do !remind new 3d1M Do something.

Subcommands:

!remind delete [ids]...
Delete up to (and including) 5 of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> [content]
Set yourself a simple reminder.

tame pebble
#

Well

#

I'm the one who needs to go sleep xD

#

As I apparently am mistaken

#

Anyway, I could've sworn I've seen it in action before

thorny obsidian
atomic ivy
#

It'd be nice to have a converter command for this like .epoch

#

Because there are times when you need it for something other than !remind

#

Such as… ModMail

rapid igloo
#

hello, any ideas why the netlify preview workflow failed for my latest commits in site#1210?

8:21:34 PM: Fetching download URL from https://pythondiscord.com/api/github/artifact/python-discord/site/608cd9580be66df87b63edb051d625917177e165/CI/static-build
8:21:34 PM: {"error_type": "NotFoundError", "error": "Could not find a run matching the provided settings in the previous hundred runs.", "requested_resource": "python-discord/site/608cd9580be66df87b63edb051d625917177e165/CI/static-build"}

https://app.netlify.com/sites/pydis-static/deploys/65bcde2f388d7e00088eae56
The error doesn't seem to suggest it was caused by something from my commit changes

dusky shoreBOT
rapid igloo
#

it looks like publish-static-preview somehow did not complete before netlify starts attempting to fetch the artifact it was supposed to publish...

vale ibex
#

and it's our CI that builds the static site that netlify uses

#

if you rebase onto main, resolve conflicts, and force push, it should just work

outer oasis
vale ibex
#

reasons that I can't remember

#

you can probably find the PR from scaleios that added the static generation to see why

vale ibex
#

well, and 2.7

outer oasis
#

🥴

rapid igloo
#

ahh I see

#

thanks!

rapid igloo
karmic silo
#

can sir lancebot react with something everytime “python” and “slow” are in the same message

waxen jasper
karmic silo
#

that works

chrome lake
#

guys

#

can someone help me

#

build

#

soft aim

rapid igloo
#

re: #advent-of-code message

would it be useful if /aoc join could still let people join the leaderboard for the previous year, when the next event has not started?
I guess the lb is most useful for competing in time to solve, but the number of stars also gives a placing in private leaderboards.

outer oasis
rapid igloo
#

yknow, in case they want to catch with 2023 puzzles

outer oasis
#

I would add a footnote that says "this event is not currently running; it happens in December"

It wouldn't break anything to let people join
But these people are confused and think that the event is currently ongoing, and letting them join a leaderboard would only add to that confusion

rapid igloo
#

ah that's a good point

vale ibex
#

the aoc join command requires up to date leaderboard cookies, which expire after ~1 month

#

so we usually only keep on top of those during the event

outer oasis
vale ibex
#

it's to make sure we're not giving out join codes to full leaderboards

rapid igloo
#

so I've been looking at this:
https://github.com/python-discord/sir-robin/blob/5d26dcebd1d964c594dae66ed71bd31573c7e2d3/bot/exts/advent_of_code/_cog.py#L212-L215

and in constants for AocConfig.year we have this:
https://github.com/python-discord/sir-robin/blob/5d26dcebd1d964c594dae66ed71bd31573c7e2d3/bot/constants.py#L78

it looks as though we are comparing datetime.now().year == datetime.now().year+1 which should never be true.

is this something unintentional that happens to work, so we'll say "leaderboard for this year not yet available" for any month other than Nov and Dec?

stable mountainBOT
#

bot/exts/advent_of_code/_cog.py lines 212 to 215

if not (
    current_date.month in allowed_months and current_date.year == AocConfig.year
    or current_date.month == Month.JANUARY.value and current_date.year == AocConfig.year + 1
):```
`bot/constants.py` line 78
```py
year: int = datetime.now(tz=UTC).year```
vale ibex
#

the value in bot.constants is the default

#

we overwrite it using an env var though

stable mountainBOT
#

kubernetes/namespaces/default/sir-robin/configmap.yaml line 6

AOC_YEAR: '2023'```
vale ibex
#

The idea being that it will work Nov, Dec & Jan

rapid igloo
#

hmmm

#

ohhhh we're in February!

#

sorry about that

#

thanks!

subtle kraken
#

Henlo @tame pebble are you able to finish bot#2839 ? Should I label is as up for grabs and look for someone else to finish it?

dusky shoreBOT
subtle kraken
#

Thanks.

tame pebble
#

Sure!

subtle kraken
#

I'll be cheering

vale ibex
#

Also @lyric temple thank you for the beautifully written issue

lyric temple
outer oasis
#

@lyric temple
"\u2764\ufe0f"
"\u2665\ufe0f"
"\U0001f49c"
"\U0001f49f"
Why do only the first two have 2 \u(s)?

lyric temple
lyric temple
outer oasis
tawdry vapor
# outer oasis <@123151368885239809> `"\u2764\ufe0f"` `"\u2665\ufe0f"` `"\U0001f49c"` `"\U0001...

The first two are defined as a pair of an existing character and a combining character called a "variation selector".

The latter two are characters outside the original 16-bit code point range (BMP). These characters are defined as surrogate pairs (which use a reserved section of the BMP) and you'd think they could be represented as \uD83D\uDC9C in Python, but Python does not support encoding surrogate pairs for reasons I don't know. So instead we have to represent the character as a single code point.

rapid igloo
#

hey @thorny obsidian, would you mind taking a look at the "annual" and "other" events list to check whether the order and list of events is correct? just want to make sure the high level structure is there in terms of the names of the events to include, before marking PR as ready for review

https://deploy-preview-1210--pydis-static.netlify.app/events/

(note that only light mode is fully readable for now)

subtle kraken
#

Is our site supposed to advertise last years codejam? pithink

rapid igloo
rapid igloo
subtle kraken
#

It looks really weird to advertise event that has already occured

#

I presume it'd be better to either more explicitly indicate that its over and its a previous event (I myself assumed it meant 2024 and it was merely a typo)
Or to start advertising the 2024 one tbh

thorny obsidian
rapid igloo
#

Alright, we'll have only two out of three items in the second row for annual events then. Will update accordingly, thanks!

atomic ivy
#

Bug report: @stable mountain suggests the code block language incorrectly, when the original code block language is specified as Python (with P capitalized).
#python-discussion message

#

Looks like they deleted the message.

#

    def fn():
        print("hello, world!")```
#

This doesn't trigger for me, but should for any non-staff, I think

tawdry vapor
#

I suppose Discord made it more lenient now.

hoary haven
tawdry vapor
#

looks like someone really liked that

hoary haven
#

!reminder edit duration 6557 8d12h5M

stable mountainBOT
#
Okay.

That reminder has been edited successfully! It will arrive on <t:1708305299:F>.

hoary haven
#

woohoo woohoo 🎉

#

thanks mark!

tawdry vapor
#

Np

eternal owl
#

hey, anyone with M series mac had issues setting up site repo with docker ?

atomic ivy
#

Oh wait, snekbox doesn't get used by site, does it?

eternal owl
#

@atomic ivy

atomic ivy
#

Seems like you're missing gcc

#

You can install it with brew

tame pebble
#

It's saying that the command failed because there's a missing file/dir required for the installation, but i'm not sure why

drowsy ravine
rapid igloo
#

we have plenty on sir-lancebot, a few on site too! :)

drowsy ravine
#

Oh good one. I actually havent looked at lancebot. Will have a look when at work!

atomic ivy
rapid igloo
# drowsy ravine Mina, Do you know of any other beginner friendly contribs? Im trying to get more...

on site:

there are also a few issues on sir-robin that looks pretty beginner-friendly, not sure if they're high on priority though but probably nice-to-have:

atomic ivy
#

Wall

#

Oh, the docker build also fails for me.

atomic ivy
#
   web:
+    platform: linux/amd64
     build:
tame pebble
#

try DOCKER_DEFAULT_PLATFORM=linux/amd64 docker compose up --build

#

I just remembered

#

Tizzy had a similar issue before

tame pebble
atomic ivy
#

That also works, yeah

eternal owl
#

cool, lemme try that

#

works 👍

tame pebble
#

Nice

rapid igloo
#

hey @drowsy ravine by the way you didn't join the org on github?

drowsy ravine
#

Eeuehm, did I not? 😛

#

How can I ?

rapid igloo
#

hmm it looks like you didn't.
but either way, once you do you can just create branches off the main repo, rather than maintaining your own forks :)

hoary haven
drowsy ravine
#

JelmerKorten

hoary haven
drowsy ravine
hoary haven
#

belated but better late than never :D

waxen eagle
#

Hello. everyone.

#

I am looking some one who can support me.

#

Plz reply to me if you mind .

vale ibex
#

What do you need support with?

waxen eagle
#

Hi. Chris.
Thank you for my reply.
where are you from?

#

I am Umar Chandra from Japan.

#

I'd like to discuss something with you.

opal kite
#

do you have some problems in python ?

waxen eagle
#

No..

opal kite
#

what's the problem ?

waxen eagle
#

I am a developer who have rich experience in backend.
I worked at a Corvee company for 3 years, but the company was broken.
And I fired, so I'm finding some work or jobs.

#

Can you help me?

vale ibex
#

You're better off asking in #career-advice or in one of the off topic channels

#

This channel is for discussing Python Discord projects

waxen eagle
#

Oh.. I see, sorry for interrupting to your.

vocal wolf
#

@sharp crag thing

bot#2614

dusky shoreBOT
drowsy ravine
#

Afternoon all!
Can anyone talk me through, or link me to a document, on the steps to follow on merging the stuff I worked on? (I think the term is "pull request"?)
(contributing noob here)

rapid igloo
drowsy ravine
#

Yessss 👍

rapid igloo
#

have you pushed to the remote branch?

drowsy ravine
#

Also yes

rapid igloo
#

alright now can you navigate to the repo on github? if you've pushed to a feature branch from the python-discord repo, open the /pulls page on github

#

it should show you a button to open a pull request

drowsy ravine
#

I pushed to the fork of the repo in my own github, right?

rapid igloo
#

that's fine as well, can you open the github repo for your fork then?

#

do you see something like a yellow box that prompts you to open a PR?

drowsy ravine
#

I've got a contribute button, it's just grey / github coloured.
If I click the little arrow it says

This branch is 2 commits ahead of python-discord/sir-lancebot:main. Open a pull request to contribute your changes upstream.

rapid igloo
#

yeppers that works too

#

now you can click on it and it should show you a preview of your changes

drowsy ravine
#

Able to merge. These branches can be automatically merged.

Create pull request?

rapid igloo
#

yep!

drowsy ravine
#

Im scared! 😛
Feel free to refuse if you dont want it hey

rapid igloo
#

put in some descriptive text on your PR and it shall be left to reviewers on what becomes of it :)

#

and you can always push new commits to the PR, by simply pushing to that same branch on your fork afterwards

drowsy ravine
#

Copied.
But don't I need to get like a branch or something? (or is that just for bigger new features?)

rapid igloo
#

it's not really necessary if you work on your fork, and only work on one PR at a time

#

by the way: in the future, you can just use a branch from the python-discord repo, since you're in the org

#

for this PR, since you've already made your commits from your fork, it's fine :)

drowsy ravine
rapid igloo
drowsy ravine
#

Thanks, i've saved that!

drowsy ravine
#

Where can I get the poetry files needed to get precommit?

tame pebble
drowsy ravine
#

I guess yes.

#

pre-commit 3.6.0 A framework for managing and maintaining multi-language pre-commit hooks.

tame pebble
#

yes, that's the package, that uses yaml to define the things to run in the hook

#

Then you need to "install" these rules

#

which puts them in the precommit hook

#

To do that, you need to run poetry run task precommit

#

That'll take care of installing the hook

#

which will then allow it to run before each commit

drowsy ravine
#

so I did that, and it cant find task

pCommand not found: task
korty.codes@kortys-macbook sir-lancebot % poetry run task lint
Command not found: task```
#

(nvm the p in front of the Command, I was too fast typing)

tame pebble
#

can you run poetry show taskipy ?

#

& tell me what it says

drowsy ravine
#
 name         : taskipy                          
 version      : 1.12.2                           
 description  : tasks runner for python projects 

dependencies
 - colorama >=0.4.4,<0.5.0
 - mslex >=1.1.0,<2.0.0
 - psutil >=5.7.2,<6.0.0
 - tomli >=2.0.1,<3.0.0```
#

I think I fixed all the issues ruff now gave me, but I rather want to do fix myself before it fails again.

tame pebble
#

Strange

#

What about poetry env list?

#

I mean, we can try to run the command directly: pre-commit install

#

But i'm not sure to why poetry isn't recognizing the command if it's installed

drowsy ravine
#

I have now pip install pre-commit
and pre-commit install to install the git command

#

korty.codes@kortys-macbook sir-lancebot % poetry env list sir-lancebot-k6fhlbY6-py3.11 (Activated)

tame pebble
#

pip install pre-commit
The installation is handled by poetry

#

which poetry version do you have ?

drowsy ravine
#

poetry --version
>>> Poetry (version 1.7.1)

tame pebble
#

Strange, I can't reproduce it

#

I've updated to the same version & made a new env

#

I'm not sure to what this could be related

#

Can you try making a new environment ?

drowsy ravine
#

If that's via poetry I have no clue how to.

tame pebble
#

poetry env list

#

copy the name of the one that has "activated" next to it

#

sir-lancebot-k6fhlbY6-py3.11 in your case

#

poetry env remove sir-lancebot-k6fhlbY6-py3.11

#

then poetry shell

#

& finally poetry install --no-root

drowsy ravine
#

Ok I see how that works.

#

Thanks for that run through.
Im not sure how it wasnt installed, but in any case I now know how to fix it ❤️

tame pebble
#

Did that fix it ?

drowsy ravine
#

It did! 🙂 Thanks

tame pebble
#

Ha, nice!

#

You're welcome

drowsy ravine
#

I was just saying I dont know why/how it wasn't installed in the first place

#

I'm also new to poetry so just a simple "contribute" turned into learning about bots, poetry, setting up the project etc etc

#

Feels like the classic high school problem:

In class:
John has five oranges, each orange cost 60 cents.
How much is the total costs of the oranges?

In test:
John has 3 apples and a pear.
Calculate the mass of the sun.

drowsy ravine
#

And this poetry install --no-root installs from poetry.lock?
Can I see that the same as requirements.txt?

tame pebble
#

Not entirely, requirements.txt doesn't pin transitive dependencies

drowsy ravine
#

Okay I see.
So poetry will lock these dependency versions that those and only those get loaded (if still available of course)
Whereas requirements.txt will download the dependencies but the latest version?

tame pebble
#

The equivalent would be to do pip freeze > requirements.txt

#

But not all people do that

drowsy ravine
#

Oh, how else are you making requirements.txt? people typing manually?

#

Now that we're talking about the pip freeze as well.
If I were to free up disk storage on my computer, and have a few venvs that I don't actively use.
would pip freeze be a good idea, then delete the venv?
If I want to come back to the project I can just create new venv and install the requirements again?

tame pebble
# drowsy ravine Okay I see. So poetry will lock these dependency versions that those and only th...

Not entirely.

  • With the .lock version, poetry will install exactly all the pinned dependencies, and the transitive ones as well.
  • requirements.txt can have a listing of the main dependencies, and let pip resolve all the tranitive ones.

Example
package1 dependens on transitivePackage > v1.6
package2 dependens on transitivePackage > v1.2
HEre, pip will resolve into installing a version of transitivePackage that's striclty greater than 1.6.
It won't be always the latest as it depends on the python intepreter's version as well

#

However, with poetry, we also lock transitivePackage, so it'll only install that one

drowsy ravine
#

Gotcha. Thanks for explaining that.

tame pebble
vale ibex
#

pip freeze also locks transitive deps

#

jsut not with hashes

tame pebble
#

What i'm saying is not all poeple use pip freeze

#

but with poetry, it locks them for you automatically

vale ibex
#

true

outer oasis
vale ibex
#

I thought they were pointing people to pip tools or pipenv for that

outer oasis
tame pebble
#

Not the freezing cmd

vale ibex
#

you can generate requirements.txt diles with hashes though

#

poetry export by default includes hashes

outer oasis
vale ibex
#

Yea

outer oasis
#

I know I did.... I know I tried it once
Because it failed
But I... Oh.

tame pebble
#

you can instruct the format

vale ibex
#

yea pipenv and pip-tools can too

tame pebble
#

I never used those

#

But good to know

outer oasis
#

pip-compile --generate-hashes
Nevermind I'm dumb firHide

vale ibex
#

this is why I love make files

#

lance does too

drowsy ravine
#

How do we type hint that something has to be a function ?

vale ibex
drowsy ravine
#

Callable[[str], str]
a function that takes in a string and returns a string?
Is that correct?

vale ibex
#

yup

#

Just keep in mind it's slightly different for async functions

drowsy ravine
#

the function thats type hinted is not async, but the function it’s going into is. Does it then need to be changed?

async def func(fn: Callable):
vale ibex
#

Nah

drowsy ravine
#

Great!
Is there a reload cog command?

vale ibex
#

.help cog

dusky shoreBOT
#
Query "cog" not found.

Did you mean:
c
cogs
colour

vale ibex
#

.help ext

dusky shoreBOT
#
Command Help

**```
.extensions

**Can also use:** `c`, `cogs`, `ext`, `exts`

*Load, unload, reload, and list loaded extensions.*

**Subcommands:**
**`extensions list`**
*Get a list of all extensions, including their loaded status.*
**`extensions load [extensions...]`**
*Load extensions given their fully qualified or unqualified names.*
**`extensions reload [extensions...]`**
*Reload extensions given their fully qualified or unqualified names.*
**`extensions unload [extensions...]`**
*Unload currently loaded extensions given their fully qualified or unqualified names.*
vale ibex
#

.src ext

dusky shoreBOT
#
Command: extensions

Load, unload, reload, and list loaded extensions.

Source Code
vale ibex
#

that one

#

it uses the filename that the cog is located in, unless the name kwarg is overwritten when creating the cog class

drowsy ravine
#

Good stuff! 🙂

vale ibex
#

!rule 9

stable mountainBOT
#

9. Do not offer or ask for paid work of any kind.

jovial barn
#

I am now developing machine learning model from scratch that do interior design automatically.
What kind of models can I use?
How can I make an approach?
I need someone who can collaborate with me.

vale ibex
drowsy ravine
#

@vocal wolf
I had a copy open and decided to just implement the suggestion you made to the pypi package regarding last nights comment. I added "to PyPI" to make it extra clear. Not sure if that's required but yeah.
This what you need?

vocal wolf
#

yuh

drowsy ravine
#

I think we should strip the time information though and just provide the date?

vocal wolf
#

yeah we just need date, don't need that much verboseness

drowsy ravine
#

exactly.
brb

drowsy ravine
#

@vocal wolf I think I've done this: Add more commits by pushing to the pypi-timestamp branch on Robin5605/pydis-bot. as suggested in the issue. (not too sure though)

rapid igloo
#

if you're PR-ing to robin's fork, might wanna PR to their pypi-timestamp branch instead (rather than main)

#

because their original PR uses that branch, so new commits to the branch could then be reflected in robin's PR

drowsy ravine
#

oh but the merge is into :main

#

hmm

rapid igloo
#

you can update the base branch by clicking Edit on the pull request.
although, if you're continuing the work in the original PR, maybe robin can just add you as a collaborator on their fork so you don't have to open the PR there (cc @sharp crag)

drowsy ravine
#

must i git push --set-upstream pypi-timestamp mybranch?

rapid igloo
#

no need to push to a different branch, the issue here is with your PR

rapid igloo
#

okay great!

drowsy ravine
#

Thanks!
once again, sorry for all the questions on git! ❤️

vocal wolf
#

ah sorry for the late reply. glad things worked out! I hope to check on the PR tomorrow

drowsy ravine
#

No worries! Thanks for the patience ❤️

sharp crag
drowsy ravine
#

I like how it looks in any case.
Maybe i'll have a look and see if I can get these different python versions to work.
potentially with an extra command in the !pypi package --versions (or something)
Not that it needs to be implemented, but just to see if I am able to

final geode
#

Discord changed something with nicknames, this may affect .catify and other commands that affect nicknames

Story: someone on another server started complaining about discord changing name length. I'm bored so I started testing and it seems it's only for fancy Unicode stuff, so far I found that 4-byte Unicode takes 2 characters in nicknames now, Cyrillic (2 bytes per character) takes one character in nickname (ie doesn't affect max length).

Testing method : manual.
I padded my nickname on my test server with digits and just started deleting n last characters, pasting test characters, then tried to fill in the padding

E.g. Ascii only/ascii plus Cyrillic is 32 characters in nickname, but "𝔗𝔢𝔰𝔱" in the middle makes it 28.
Edit: 3-byte 'ࠀ' also takes 2 spaces wait, no, it doesn't, it's just rtl and ate a number I gave to it

subtle kraken
#

Why would that affect nickname commands? pithink

final geode
#

.src catify because e.g. catify has a check for 26 characters because it adds 6 characters to the name

dusky shoreBOT
#
Command: catify

Convert the provided text into a cat themed sentence by interspercing cats throughout text.

Source Code
final geode
#

Wait, wtf... Bot changed my name successfully - exactly 32, but if I go to edit it, the cat's head doesn't exist. So the weird name limit change is only for users and bot can still do it the old way? O_o

#

Emoji in my name makes it so that if I changed my name manually, I can only fit 5 ascii characters
But bot can fit 6 characters in there

Also, I was wrong above, 3-byte characters take one space in the name not two (I edited my message above). The script used for the cat itself is therefore safe on its own, it's user's previous name that can be weird

vapid vapor
tame pebble
#

@drowsy ravine 👋
What I've meant to say is, the only change that was supposed to happen is

-def neutralise_string(txt: str) -> str:
+def neutralise_string(txt: str | None) -> str | None:
    """Attempts to neutralise all punctuation and cases and returns a string of lowercase words."""
    # take out punctuation
+   if not txt:
+     return None
    txt = re.sub(r"([^\w\s]|_)", " ", txt)

The clean_text_or_reply already takes care of raising the BadArgument error

drowsy ravine
tame pebble
#

No worries !

drowsy ravine
#

Question about ruff.
`- hook id: ruff

  • exit code: 1
  • files were modified by this hook

Found 1 error (1 fixed, 0 remaining).`
Any way to see what exactly it's done?
(and a way to switch off the auto correct?? I rather manually type it after suggestions so I will actually learn)

vale ibex
#

git diff --staged will do it in the command line, most IDEs have a way to do it too, but I'm only familiar with vscode

drowsy ravine
#

Okay, so I just check the two files and see whats changed. 👍🏻

vale ibex
#

Do you use vscode?

#

vscode shows it like this, where the staged changes are at the top, and then if pre-commit makes a change it appears in the changes section

#

you can click on the file in the changes to see just the diff from your staging area to what precommit did

drowsy ravine
#

Yeah I do. It opens the two files next to each other. Somehow I had struggles to spot the difference between an empty return and a return None 😅😅

vale ibex
#

ahh lol

#

fwiw, you can also run ruff . manually and it outputs the change

#

ruff . --fix is what auto fixes

#

make sure you're inside the poetry shell though

drowsy ravine
#

The type hinting + (i think its) pydantic really makes my code better. Seems a bit much work for quickly testing some things. But its good for me to get used to 🙂

tame pebble
#

@drowsy ravine I just noticed that you're developping straight on main in your fork

#

It's better to create a separate branch for each feature/bug fix

#

Since your main tracks the main branch from the pydis repo, when we merge your pr and then you'll sync, you'll run into issues

tame pebble
drowsy ravine
tame pebble
#

What you'd want to do is

  1. Make a new branch out of your main
  2. Hard Reset your main onto pydis'
  3. Change the Pull request's source branch to the one you created in step 1
drowsy ravine
#

Okay, so with my current code I did git checkout -b fun-cases
now im going to do git push -u origin fun-cases, correct? (this creates the branch on the remote, which should be my forked pydis repo in my account, right?)

tame pebble
#

you can configure get to always push up to the remote branch with the same name as the local one automatically

tame pebble
#

But you need to reset your fork's main as well

#

that would require adding a new remote

drowsy ravine
#

So how do I reset the main?

tame pebble
#

What's the output of git remote -v?

drowsy ravine
#

origin https://github.com/JelmerKorten/sir-lancebot.git (fetch) origin https://github.com/JelmerKorten/sir-lancebot.git (push)

tame pebble
#

you have 2 options, you can either add pydis repo as repo as well, then reset on it
or, you can just locate the last commit hash before you started committing on main, and you git reset --hard {{hash}}

drowsy ravine
#

before you started committing on main
The very first one? L:P

tame pebble
#

the one just before your very first commit

#

so the one before 90625a1d323e052d8509f55fa49958a2b88bbd8e

#

once you do that (while you're still checkout out at main), you need to force push

drowsy ravine
#

I hear what you're saying. But I'm not sure what to do with the information.

I can click the sync fork button on github.com , it says this will discard the 11 commits, but I've made that branch now, fun-cases so those same commits are still there? I'd prefer to do it in CLI just to get more experience with that.

tame pebble
#

do what in cli exactly ?

#

so those same commits are still there?

#

yes

#

You also pushed them, so they'll be in your fork as well

drowsy ravine
tame pebble
drowsy ravine
#

Then how do I change the PR source?

drowsy ravine
#

Okay, I think im synced, took me a bit to figure out. Now sleeps!
nn ❤️

tame pebble
rapid swallow
#

Thanks

#

I'll try to check it out tonight

#

Or tomorrow

tame pebble
tame pebble
#

@vale ibex Re bot-core#48, using a FQN for each type seems to do the job.

dusky shoreBOT
tame pebble
#

However, the deploy preview is off, it still shows 1.7.0, and the new attributes aren't there

#

But the locally built docs are just fine

#

Forgot I didn't link the PR 😅
bot-core#204

dusky shoreBOT
vale ibex
#

Ah nice

#

will give it a look tomorrow

tame pebble
#

Sure !

drowsy ravine
tame pebble
#

You still need other approvals

tame pebble
#

@vale ibex, the new line is too long, do you want me to noqa it or just break it up ?

#

IT's just that I don't like it like this, and I didn't want to break a sentence before it was finished :p

#

I mean, like this

drowsy ravine
#

Do I just create a new PR? (I can't do anything to that current PR right?)

vale ibex
tame pebble
vale ibex
#

Committing to the same branch will update the PR, I'd suggest you make a new branch for each new feature you work on

drowsy ravine
#

I did that! I have a brand spanking new branch after yesterday's finding out 🙂

vale ibex
#

Also, I don't think we need a version bump for this, since it's just docs changes

#

you can leave the line in the changelog, but remove the version specifier

#

it just works

tame pebble
#
+ :support:`204` Document the instance attributes of :obj:`pydis_core.BotBase`.
#

So just like this ?

vale ibex
#

Yea

#

just delete line 7 basically

#

(and update pyproject.toml)

tame pebble
#

Yes yes, that part is done

vale ibex
#

Nice

tame pebble
#

Alright, pushed

vale ibex
#

we're great

tame pebble
#

Oooo

#

Yes we are

#

I didn't know it worked like that

drowsy ravine
#

Hey!
I have question! (Again, lol)
Had some struggles with my own tiny github project. I'm still trying to get used to the whole github process.
So what I (thought I) did was:

  • Create a repo.
  • Add some stuff to it and push to remote, say main.
  • Then I branched off locally git checkout -b newbranch
  • Did some newbranch stuff locally and eventually pushed to remote git push -u origin my-branch-name
  • Decided that it's implemented enough and wanted to merge. This is where my confusion came in.
  • I went to GH and it popped up: newbranch has recent commits Compare
  • Inside the compare screen, it said, there's nothing to compare, these two branches have no commit history in common (or something pretty close along those lines)

What did I do wrong?
And how to prevent it next time?
(I somehow merged it, but surely not the way I was supposed to)

tame pebble
#

Can you reproduce this on a public repo ?

#

Was this repo a new one ?

#

Maybe it's better to discuss this in a help post

drowsy ravine
#

Fair point, I've opened a channel

vale ibex
#

fakeredis usage

drowsy ravine
#

@rapid igloo thanks for your feedback on the repo. I will 100% have a look at it and try to implement. I am however not available until next week unfortunately, working away from base. That okay?

tame pebble
#

So don't worry about it

thorny obsidian
#

@vale ibex how would I go about testing the postgres logic? Can I trust that you tested it and it works? >_>

vale ibex
#

The queries I used are in the pr to show the logic is right

crystal sonnet
#

How can I do this when I click a button because a Select should come up? How does that work? (in py-cord)?

vale ibex
waxen jasper
rapid igloo
#

ideally the PR should only include c4c45a0 and perhaps a merge commit before that to update the branch

#

(and in the future, try using feature branches instead of main so you can work on each of your PRs separately and sync with upstream independently of each other)

tame pebble
waxen jasper
rapid igloo
waxen jasper
#

okay so right now

#

i move the new stuff to a copy of the repo or rather a different folder for now

#

then hard reset right?

tame pebble
#

not really

#

create a new branch from your main

#

it will have the relevant commit

#

recheckout to main

#

sync your fork, then hard reset your main on the remote one

#

checkout to a new feature branch

#

and cherry pick your commit

#

i think you only have one commit

waxen jasper
tame pebble
#

checkout back to main I mean

waxen jasper
#

still confused 😅

#

just go back to the main branch?

tame pebble
#

yeah

#

switching branches is called checking out

waxen jasper
#

oooo good to know

rapid igloo
#

(because you use the git checkout command)

waxen jasper
#

how do i figure out the hash

tame pebble
#

It's the one hedy sent you

#

You can identify the hash based on your commit message

waxen jasper
#

c4c45a0? i thought that was the commit code

tame pebble
#

git log --oneline will list the commits for you

#

There's no such thing as a commit code, at least not to my knowledge

#

It's the hash

#

Just not the entire hash

#

Since usually the first 8 characters are enough

rapid igloo
waxen jasper
#

no wait

#

i think i have to go to a previous commit

#

right?

#

ive contributed before

rapid igloo
#

you can use HEAD^ to refer to the previous commit

waxen jasper
tame pebble
#

What have you done so far ?

waxen jasper
#

first i checked out to a new branch with the old commits

#

checked out back to main

#

hard reset up until c4c45a0 (git reset --hard c4c45a0)

#

and then checked out to a new branch

tame pebble
#

and you should hard reset to main's head

#

git reset --hard origin/main

waxen jasper
tame pebble
#

then, make a new branch from the clean main git checkout -b christmasify-avatar

#

then, cherry pick the relavant commits git cherry-pick hash1 hash2

waxen jasper
#

and my modifications havent been removed

tame pebble
#

ok, can you run git remote -v

waxen jasper
#
origin  https://github.com/SockYeh/sir-lancebot.git (push)```
tame pebble
#

git remote add pydis https://github.com/python-discord/sir-robin.git

#

git reset --hard pydis/main

#

when you're on main

#

git push -f

tame pebble
#

sir-lancebot

#

xD

waxen jasper
#

git remote add pydis https://github.com/python-discord/sir-lancebot.git

#

right?

tame pebble
#

i got lost for a second

#

yes

waxen jasper
#
PS D:\Python\sir-lancebot> git remote add pydis  https://github.com/python-discord/sir-lancebot.git
PS D:\Python\sir-lancebot> git reset --hard pydis/main
fatal: ambiguous argument 'pydis/main': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'```
tame pebble
#

try git reset --hard pydis main

waxen jasper
#
fatal: ambiguous argument 'pydis': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'```
tame pebble
#

what does git remote -v say ?

waxen jasper
#
origin  https://github.com/SockYeh/sir-lancebot.git (push)
pydis   https://github.com/python-discord/sir-lancebot.git (fetch)
pydis   https://github.com/python-discord/sir-lancebot.git (push)```
#

👍(•_•)👍

tame pebble
#

Ah

#

We need to fetch first

#

git fetch pydis

waxen jasper
#

oh

#

i really do need to learn git

tame pebble
#

because there are no refs stored

#

then reset

waxen jasper
#
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'```
#

still the same issue

#

even after fetch

#
PS D:\Python\sir-lancebot> git fetch pydis
remote: Enumerating objects: 192, done.
remote: Counting objects: 100% (179/179), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 192 (delta 135), reused 154 (delta 120), pack-reused 13
Receiving objects: 100% (192/192), 102.71 KiB | 6.04 MiB/s, done.
Resolving deltas: 100% (137/137), completed with 31 local objects.
From https://github.com/python-discord/sir-lancebot
 * [new branch]        dependabot/pip/pre-commit-3.6.2 -> pydis/dependabot/pip/pre-commit-3.6.2
 * [new branch]        dependabot/pip/pydantic-settings-2.2.1 -> pydis/dependabot/pip/pydantic-settings-2.2.1
 * [new branch]        dependabot/pip/ruff-0.2.2 -> pydis/dependabot/pip/ruff-0.2.2
 * [new branch]        dependabot/pip/sentry-sdk-1.40.5 -> pydis/dependabot/pip/sentry-sdk-1.40.5
 * [new branch]        main                  -> pydis/main
 * [new branch]        reorder-hacktoberfest-commands -> pydis/reorder-hacktoberfest-commands
 * [new branch]        revert-1432-dependabot/pip/emoji-2.10.0 -> pydis/revert-1432-dependabot/pip/emoji-2.10.0
 * [new branch]        shenanigansd-patch-1  -> pydis/shenanigansd-patch-1
 * [new branch]        sim_matches           -> pydis/sim_matches
 * [new branch]        use-botcore-command-error-manager -> pydis/use-botcore-command-error-manager
 * [new branch]        use-botcore-paginator -> pydis/use-botcore-paginator```
tame pebble
waxen jasper
#

oh

tame pebble
waxen jasper
#

yup its up to date now

tame pebble
#

now force push

#

git push -f

waxen jasper
#

so now i compare and pull?

tame pebble
#

Indeed

tame pebble
waxen jasper
#

still shows all tho

#

oh wait i didnt cherry pick

tame pebble
#

on the new branch ?

waxen jasper
#

yea forgot to do that lol

#

okay now thats done

#

i push?

#

no wait i merge

#

since different branches

tame pebble
#

Wait

#

You don't want to merge

#

you want a branch, with just one commit

#

which branch are you on ? is it a newly created one ?

#

from the fresh main

waxen jasper
#

yup

tame pebble
#

How come you have all that then ?

waxen jasper
#

i cherry picked the commit too

waxen jasper
#

the new one doesnt even show up

tame pebble
#

did you push it ?

waxen jasper
#

thanks a lot!

tame pebble
#

Sure thing!

waxen jasper
#

okay so now

#

i leave the branches be?

tame pebble
#

which branches?

waxen jasper
#

lets say the current one

#

once its merged

#

do i delete it or nothing like that

tame pebble
#

yeah, it's preferable to delete branches

waxen jasper
#

so everytime i have to add a new feature, i do all this?

tame pebble
#

No

#

you just need to

  1. sync fork
  2. Pull main into your local branch
  3. Make a new feature branch
  4. Develop, commit, then push
#

We did alot of other steps to reset your main

#

as you shouldn't work on it directly

waxen jasper
#

also, any recommendations on youtube videos for learning git

tame pebble
#

Also, atlassian have great tutorials

#

Check them out

#

( I don't like watching videos to learn )

waxen jasper
tame pebble
#

It's quite nice indeed

waxen jasper
#

will go through with it

waxen jasper
#

yea sometimes videos become too much

rapid igloo
# waxen jasper so everytime i have to add a new feature, i do all this?

what happened with your first chrismasify PR was that, because you worked off main for the riddle command, and without syncing to upstream (pydis remote), you started to work on the chrismasify PR by adding new commits afterwards. this makes your main diverge off of the upstream pydis main branch.

so when you open your first PR, github tries to find the commits from your main that are different/newly-updated from pydis, which includes commits from the riddle PR. what we want instead is only to include the chrismasify commit.

how Flying Whale helped you fix this issue was essentially:

  1. save your chrismasify commit elsewhere
  2. reset your main to the last commit that was still in sync with pydis
  3. sync your main with pydis by pulling in new changes from upstream
  4. restore your chrismasify commit

all of this can be avoided if you'd worked on PRs with feature branches, rather than using main, which would skip the steps 1 and 2 from above.

hope this makes sense, if it helps!
(and also correctly me if I'm wrong Bella)

waxen jasper
tame pebble
#

Correct, you should almost never commit to main directly

#

You should always branch out, develop, then merge changes into main

tame pebble
rapid igloo
#

hi @timid sentinel, is there a consensus (perhaps among core devs?) for what we should do for site#1232?

dusky shoreBOT
rapid swallow
#

Hey @quick nymph ! I've removed your post since it is off-topic for this channel.

#

!ot

stable mountainBOT
rapid igloo
#

is it possible to have netlify retry the static preview without pushing another commit?

pr: site#1232
https://app.netlify.com/sites/pydis-static/deploys/65d87c92d20f310008ce0cfd

the gh workflow that runs the build failed at first but worked after I re-ran it.
if anyone with the right perms can trigger such a re-run on netlify's side, (or any other solution) would be appreciated. thanks!

vale ibex
clever wraith
tame pebble
#

@timid sentinel I'll be away for quite some time and have no pc access.

I'll just recreate the PR and abandon the changes for now.

#

To not block the bump

#

But I just thought it made sense to combine both those changes specifically

wise marten
subtle kraken
#

The bot just restarted so presumably briefly there were 2 instances of it running at once

wise marten
#

I C

#

that's probably why I can't delete some other eval output, with interactions failling

subtle kraken
#

Yeah the old bot died so its interaction presumably died with it 😔

tame pebble
tame pebble
#

Oh, i didn't see sen's response. Discord is acting weird lately

subtle kraken
#

Will keep that in mind

tame pebble
drowsy ravine
#

Regarding !pypi:
Referring to pygame, but I think this issue will be there for any package.

TL;DR:
pypi site is adjusted for local timezone settings and the API is just in Zulu/UTC, hence sometimes there will be a day difference when comparing (upcoming) !pypi output to the website. What do you want to do?

2023-09-17T22:27:49
Is listed as the source distribution upload time, but since I'm +4 UTC atm, it brings it to 2am on the next day (18th) on the pypi site.
But the api upload_time.date() will still return the 17th. Then when I go check the site, there will be 1 day difference. Which is confusing and will break my OCD.
the upload_time is in Zulu / UTC time, and pypi site reflects adjusted for your timezone settings.

rapid igloo
#

I wonder if using a discord timestamp would be an overkill? it could then use the user's local timezone

drowsy ravine
#

To be honest, if that's an option I would go for that.
Seeing 2 different dates is even more confusing than not seeing a date at all.

#

The problem still arises:
user's local timezone?
What determines what the local timezone is? Because if you use the command, I also get to see the output? Unless that would somehow be different for everyone seeing it with your suggested method?

rapid igloo
#

yes, discord shows the date depending on the user's timezone

#

you can try it with the .epoch command iirc

#

.epoch in 2 hours

dusky shoreBOT
#

Date and time parsed as: Sun, 25 Feb 2024 14:27:15 +0000

#

<t:1708871235:t>

rapid igloo
#

<t:1708871235:t> (this is an example that shows the time of course)

vale ibex
stable mountainBOT
#

bot/utils/time.py lines 77 to 82

def discord_timestamp(timestamp: Timestamp, format: TimestampFormats = TimestampFormats.DATE_TIME) -> str:
    """
    Format a timestamp as a Discord-flavored Markdown timestamp.

    `​timestamp`​ can be any type supported by the single-arg `​arrow.get()`​, except for a `​tzinfo`​.
    """```
vale ibex
stable mountainBOT
#

bot/utils/time.py lines 41 to 46

class TimestampFormats(Enum):
    """
    Represents the different formats possible for Discord timestamps.

    Examples are given in epoch time.
    """```
drowsy ravine
#

(Im reading up on this! gimmie a second to wrap my head around it)

#

Im getting this now xD

#

Released: <t:1694989669:f>

#

Which works when I take it out of the embed as we just seen.

#

Released: <t:1694989669:f>

vale ibex
#

timestamps don't work in embed footers, you'll need ot add a field

drowsy ravine
#

Rip, back to a field then xD

#

!pypi pygame

stable mountainBOT
drowsy ravine
#

oh, sorry xD

#

What do you think?

rapid igloo
# drowsy ravine What do you think?

how's this instead? it looks similar to what we previously had as a footer except it's a different font size (note that the date format depends on locale)

drowsy ravine
rapid igloo
#

yeah, that's how I did it

#

but I'd also see what others think about it

drowsy ravine
#

Ok, let me push it and await feedback

drowsy ravine
#

I'm trying to understand how the bots deal with doing commands on a replied text. instead of providing the text to the argument.

subtle kraken
stable mountainBOT
#

bot/exts/fun/uwu.py lines 167 to 176

text = text or getattr(ctx.message.reference, "resolved", None)
if isinstance(text, discord.Message):
    embeds = text.embeds
    text = text.content
else:
    embeds = 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.")```
drowsy ravine
#

text = text or getattr(ctx.message.reference, "resolved", None)
does this mean that if text is None the statement right of the or will be evaluated
and we then assign that to text instead? Or still None if no reference was made (im assuming the reference here is the reply..?)

subtle kraken
#

or would assign first "truthy" value or last argument (right side of or iirc)

drowsy ravine
#

Yes. I think that's what I tried to say xD

subtle kraken
#

Anything more that needs explaining?

drowsy ravine
#

No that's all for now, this makes sense 🙂

#

Thank you.

cold island
vale ibex
cold island
#

so basically, rebase bad

vale ibex
#

i was very useful because I wanted to merge 3 PRs at the same time without merge commits :P

cold island
vale ibex
#

maybe

cold island
cold island
#

Wasn't linked?

vale ibex
#

The keyword I as thinking of was resolves, not solves

cold island
#

ah

clever wraith
#

Omg Zig

#

Hello

drowsy ravine
outer oasis
royal prawn
#

maybe korty is a group account🤔. how many are you korty?

rapid igloo
drowsy ravine
drowsy ravine
royal prawn
#

yeah, sure, whatever you say, swarm account

drowsy ravine
# rapid igloo by the way korty, regarding the case commands PR, I noticed you pushed a few com...

Copy! I think it’s done as for now, will request later today.

And regarding pypi:
I did some tests earlier on a few packages and all [-1] dists were the “source” files. Then if I understand correctly sometimes other distrubution wheels are added later or updated (im assuming hot fixes) and this can lead to a later date. The “front page” for each package seems to reflect the source file upload time.

dim pelican
#

Hello, your message has been removed due to violating rule 6

spice blaze
#

oh, sry

tame pebble
# spice blaze oh, sry

Also, comments are for discussing things related with a pull request / issue.

So please refrain from making comments such as 'hi bro' in a pull request

drowsy ravine
brazen wren
#

Also, comments are for discussing things related with a pull request/issue. So please refrain from making comments such as 'hi bro' in a pull request,

Not sure saw it somewhere decided i liked the looks of it and have been doing it since.can stop it if thats preferred?

Does this mean that if text is none the statement right of the or will be evaluated and we then assign that to text evaluated

wise marten
#

!dasm .../!da ... command (dis-assemble) for running !e import dis; dis.dis(...). Feel free to steal the idea.

#

along the same lines as having a timeit command

#

only reason it wouldn't be !dis ... is because !dis is the same as !hosting currently

still comet
#

I'm in favor of using !dis anyway because it isn't clear that it leads to !hosting right now

timid sentinel
#

That idea is covered under this issue:

#

bot#1880

dusky shoreBOT
clever wraith
tame pebble
#

What's not working?

clever wraith
#

ah cause the latest release is almost 1 year old

clever wraith
#

this api route was introduced in supakeen/pinnwand#194

dusky shoreBOT
clever wraith
#

I cant really work on bot#2679 if its not in production yet

dusky shoreBOT
vale ibex
#

Yea that's fine, just need to wait for a release of pinnwand to be made

#

might be worth asking in their freenode irc channel if there's anything else that they're waiting on before making a release

rapid igloo
#

hmm there's no one in #pinnwand on both freenode and libera

tame pebble
#

Ahaha yeah i tried myself

#

The versioning in pinnwand is not consistent

#

I'll open an issue for that

vale ibex
tame pebble
# vale ibex how so?

What i mean is, if you take a look at the docker images, you'll only find latest, and the 1.5 one.

There's no unique tag of a particular release that'll allow you to pinpoint a version.

vale ibex
#

pushing to ghcr was only added in v1.5.0

#

There are github releases for versions before that

tame pebble
#

For example, in our case, we use the sha hash to identify versions

vale ibex
#

do we?

#

I thought I pinned it to 1.5.0

tame pebble
#

I mean, for our packages

tame pebble
#

But pinnwand's ci has triggered a lot of times in the past period, and it's only overwriting 'latest'

vale ibex
#

ah right yea, which is why we use the release instead

tame pebble
#

So if i merge a PR now, the previous version's identifier/tag will disappear

vale ibex
#

this is quite common for apps that use releases, rather than building & pushing on each commit

#

usually it wouldn't be a problem if release frequency was higher

tame pebble
#

But pinnwand does build and push on each commit

vale ibex
#

as in it doesn't tag each commit because you're either on an unstable tag (latest) or a stable tag (release version)

#

I'm talking quite generally here for apps that follow this approach

#

adding a SHA tag would likely be easy to do with CI how it currently is, it has the possibility of burying the version tag though

tame pebble
#

I'll try to see what Simon thinks about it

vale ibex
#

the diff would be adding type=sha to the list of tags here and type=sha,suffix=${{ matrix.container-stage }} here

tame pebble
rough shell
#

Someone want to collaborate with me in a python project? Im making a encrypted password manager.

#

Can I send the link here?

vale ibex
#

Keep in mind our rule about advertising and recruitment though.

rough shell
dim pelican
stable mountainBOT
#

6. Do not post unapproved advertising.

dim pelican
full fractal
#

thoughts on site#1235?

vale ibex
#

removing code (css) is great

#

and reducing the effort to add new items to the timeline is a big plus

full fractal
#

pls approve then :P

#

cc @rapid igloo

vale ibex
#

I have an idea, gimme like 10 mins

#

Is this something you wanted to implement youself hedy?

#

or just something you wanted to raise

rapid igloo
#

if it's approved I'd be interested in having a go at it

#

but I might not have enough time so if I realize that's the case I'll drop a comment there saying so...

#

thanks @full fractal by the way!

rapid igloo
#

hello, I have two fairly trivial PRs here from the site repo which needs one contrib/staff approval

  1. site#1226
  2. site#1231

and also site#1210, though it's not as trivial
reviews would be appreciated!

rapid igloo
#

thank you Chris joe_salute

vale ibex
#

No problem, there's some really nice stuff in that redesign that I'm looking at now

#

what might go a long way is a basic readme in the events directory on how to add a new event

#

which mentions the need to update when the event ends

rapid igloo
vale ibex
#

Ah very nice, good to know

#

I'm sure @thorny obsidian will appreciate being able to tell someone "go read this" and it just works for adding events to site :P

clever wraith
full fractal
solemn vine
#

!source

stable mountainBOT
rapid igloo
#

should bot#1603 be closed since the functionality is now native in discord?

dusky shoreBOT
rapid igloo
#

note, @thorny obsidian mentioned it could be (in a staff channel) but since that was three years ago, I'm bringing it up just in case.

wise marten
outer oasis
#

Interesting
I don’t think I’ve ever seen one without the embed before

vale ibex
#

The bot can normally handle that just fine, there must have been a discord API blip, or the bot was down, when that channel was open so it didn't trigger the bot picking it up as something it needs to schedule for closing

wise marten
#

I c, freak accident