#dev-contrib

1 messages · Page 62 of 1

glass pecan
#

although im not sure that'll necessarily fix it

obsidian patio
#

I tried that as well as 3.8

glass pecan
#

the other is to verify that venv exists in file explorer

#

this also seems to be working fine, but it takes ownership of the venv, as pycharm makes it's own

obsidian patio
#

Hmm, ok. I'm trying to redo the pipenv sync --dev and seeing if that'll fix anything

glass pecan
#

if you do that, first remove the old venv

#

pipenv --rm

obsidian patio
#

Sure

glass pecan
#

also close your editor when you do it

#

so it can rediscover any changes

obsidian patio
#

Okay. I'll try that ut

exotic ember
#

.cc decrypt 23 QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD

glass pecan
#

wrong place?

exotic ember
#

hm

#

maybe

#

yea

glass pecan
#

is this a seasonalbot feature or something

exotic ember
#

I thought I'd be stronk enough but I guess not :(

glass pecan
#

stronk lol

obsidian patio
#

It's indexing now. Looks good so far

glass pecan
#

is this rot13

#

lol

obsidian patio
#

Seems like it's all set up now 😄

glass pecan
#

noice

#

always good to hear

obsidian patio
#

Thanks a lot for the help

exotic ember
#

is this rot13
it's generic, so you specific the shift

glass pecan
#

pycharm just has too many darn ways to do things lol

exotic ember
#

courtesy of @neon garnet

glass pecan
#

so it's 23

#

i see

neon garnet
#

Pog

glass pecan
#

remove the decrypt function and make the kids count

#

lol

#

"time to pull out the pencils boys and girls"

obsidian patio
#

Is there any good way to run the project in PyCharm? I've been using pipenv run start in the terminal so far

glass pecan
#

that's fine to do both in term and pycharm

green oriole
#

You can make that a run script through pycharm too

glass pecan
#

i personally prefer running my dockers though

obsidian patio
#

How do you mean Akarys?

glass pecan
green oriole
#

You see the run/stop at the top right of the- well this, you can make it run the project

obsidian patio
#

Aah, alright

#

I'll look into the Add Configuration...

glass pecan
#

something like this probs

green oriole
#

Basically, you’d select shell command, press create new, and type pipenv run start as the shell command

glass pecan
#

oh right its shell

#

hmm

green oriole
#

You’re on a python config, you need a shell one

obsidian patio
#

Alright

glass pecan
#

bleh i'll stick to compose

brazen charm
#

The start is just an alias so you can use a normal start config for it when the interpreter is set properly for pycharm

glass pecan
#

oh yeah good point

#

that's cleaner to me

green oriole
#

Yeah, but you also have to use an extension to load the dotenv

obsidian patio
#

How do you mean that it would be set up? Can't find much of a good documentation or resources for it

glass pecan
#

Yeah, but you also have to use an extension to load the dotenv
but the dotfile extension is lovely enough one should have it anyway

green oriole
#

There isn’t an actual command line option instead of a shell script?

obsidian patio
#

Otherwise, I could probably just use a bash command there

brazen charm
#

The plugin isn't that huge of a deal imo, and makes the setup easier in general. Just need to run it as the module bot through the option at the top with the pipenv venv selected https://i.imgur.com/qjXyDwb.png

short snow
#

is it your first time?

#

using pycharm

obsidian patio
#

Yeah. Have been using VSC

short snow
#

well than, i say you should look up a video for pycharm, it would be much easier

#

and try to mess around and see every option / button you see

#

i did the samthing

obsidian patio
#

Yeah. Will probably be doing that quite soon

glass pecan
neon garnet
#

@green mesa Does the .wiki command has a way of filtering out potentially R-18 pages?

obsidian patio
#

I'll just use pipenv run start for now

subtle kraken
#

@neon garnet pretty sure that was discussed already and we dropped it

neon garnet
#

Hmm

subtle kraken
#

okay, that's a more valid observation. Still, there's nothing stopping those users from just linking those pages themselves from wiki right now, and we'd be in the exact same situation. In both cases, I'm fairly certain the community would report this to us through modmail or by pinging the mods, and we'd moderate accordingly.

#

From lemon @neon garnet ^

eternal owl
#

@stable mountain and @dusky shore aren't hosted on linode?

glass pecan
#

they are

eternal owl
#

what does azure do here

glass pecan
#

azure is our CI

green oriole
#

Also, Wikipedia doesn't have an actual tag about if the article is +18 or not

eternal owl
#

CI is like github actions/travis?

green oriole
#

Yup

glass pecan
#

yes

sullen phoenix
#

azure devops is quite nice, but i decided to just switch to github actions

glass pecan
#

it waits for updates on our github repo, pulls the PR/master to try running, linting and testing it, and lets us know if it passes or not

eternal owl
#

whats the reason we are using azure istead of github actions

green oriole
#

I'm curious about if we sw- oh well, switch incoming!

glass pecan
#

because gh actions didn't exist when we setup azure

eternal owl
#

oh okay

glass pecan
#

and when we considered adjusting, gh actions was still in beta at the time so wasn't worth it as it wasn't at feature parity

eternal owl
#

oki

glass pecan
#

however, we do have actions used for other repos instead of azure

#

and actions do things on ones we do have azure on

green oriole
#

I actually have a small list of reasons why actions is better than azure

eternal owl
#

can u list the reasons, just curious

green oriole
#
  • CodeQL is actions only
  • Actions isn't limited for open source
  • For forked repos Actions will run on the fork, not on the upstream
  • The webhook links doesn't require to be in the org to view the run
#

I think that's everything

eternal owl
#

what is codeQL

hardy gorge
#

The plan is to switch to GitHub Actions eventually, yes

#

Newer repositories have it, as well as repositories that publish to PyPI

green oriole
#

The github code analytics thing™️

hardy gorge
#

We now have some experience with GH Actions, so that means we can start thinking about migrating everything

glass pecan
#

graphql, yes

green oriole
#

I got the name wrong? Ah yes

glass pecan
#

azure has a rather large amount of features that actions still doesn't, so it's not really something that's clear cut which is better, it's entirely based on one's situation. but yeah i can see us changing eventually

#

we chose to use actions for releases because they're just so much better to trigger from gh release creation event

#

can't do that in azure afaik

eternal owl
#

okay

#

thanks for the info

hardy gorge
#

I think we can currently do everything we want in GitHub Actions, so there's nothing major blocking us at the moment.

green oriole
#

Forgot two things, you don't need to do any admin work to enable the CI using actions, and you don't need to leave github to see the status of the CI using actions

glass pecan
#

yeah i love actions purely for not leaving github mostly

green oriole
#

I'd be interested in participating to the switch, I have a good experience with actions lemon_pika

hardy gorge
#

There are a few things that we're still looking into:

  • What's the exact effect of pull_request_target instead the pull_request event; the former allows GitHub Actions to do things like annotations from forks, but I think the state it will lint is different.
  • The nice Actions that would really help, like annotating files with linting errors, don't do the exact thing we'd like (like also printing those errors to stdout for easy reference)
#

Other than that, linting, testing, building, publishing, it all works nicely on Actions and there are GitHub Actions ready made on the marketplace that have nice features

tawdry vapor
glass pecan
#

reading that, the malicious actor would have to be coming from origin, rather than fork, right?

tawdry vapor
#

No, from the fork. The comment's point is that CI has a checkout step which checks out code from the fork, which is typical

glass pecan
#

oh its running secrets from our repo, not from theirs, if it's in a PR

tawdry vapor
#

So if any secrets are being passed to code that is checked out, there is an opportunity for it to be hijacked

glass pecan
#

i read it as the opposite way

#

right, yeah

tawdry vapor
#

Should be safe to use for like a flake8 workflow though

#

So it can annotate

obsidian patio
#

What docstring format do we use for Seasonalbot?

brazen charm
#

human, just make sure the lint passes

obsidian patio
#

Hahah. So anything?

glass pecan
#

just reference what exists for examples

#

simple docstring style, no arg listing or such

#

we do type annotations already

obsidian patio
#

Why not? They're quite convenient for knowing what the arguments are actually for

tough imp
#
"""
Summary here.

Optionally extra text after an empty line.
"""
brazen charm
#

There's no need for listing everything with typehints and no tools analyzing them

glass pecan
#

it's just redundant, yeah

brazen charm
#

A lot of args should be self explanatory with their names, like any other variable

glass pecan
#

yep

obsidian patio
#

For sure, yeah

#

Thanks @tough imp

glass pecan
#

and yeah kwzrds on point there

#

probably should have directed you to that much earlier

#

the entire contributing guide is considered must-read

obsidian patio
#

Yep. Didn't remember that part from when I was reading through it

green oriole
#

You don't actually need to run pull_request events, you can just run on push targets, and it will make the CI run on the downstream repo instead of the upstream

obsidian patio
#

Oh god. I just deleted the .emojify command, by reverting the commit. I though the files would be left after git reset --soft <commit hash>

green oriole
#

They should still be there

#

Soft and mixed resets aren't destructive

obsidian patio
#

I'll show you what I did

#

Soft and mixed resets aren't destructive
@green oriole this is the only reason that I'm not more terrified than I am right now. Though I'm still really afraid of having lost it

green oriole
#

Well, the files should still be there, but untracked, right?

obsidian patio
#

That's what I was expecting. They aren't, though

green oriole
#

Your IDE should be able to revert that anyway

obsidian patio
#

I have no clue how to do that with PyCharm. It's the first time I'm using it

green oriole
#

Maybe a simple CTRL + Z? I know load from disk is an operation you can reverse, but I'm not sure if isn't only for the opened file

obsidian patio
#

I've tried that as well. Doesn't do anything

stable mountainBOT
#

@sullen phoenix @nocturne hare

It has arrived!

Here's your reminder: do the thing.
[Jump back to when you created the reminder](#dev-contrib message)

nocturne hare
#

i did the thing

sullen phoenix
#

nice

obsidian patio
#

Well, this is disturbing. Wasn't expecting everything to be that gone

#

I really hope the files are still there, somewhere, deep inside git

green mesa
#

@neon garnet nope pure😅

obsidian patio
#

I'm gonna eat dinner now, but if anyone has any idea at all about what happened or how to restore the files, please tell me.

glass pecan
#

lol del, reclone

#

probably /s but who knows

obsidian patio
#

Hahah

#

The issue is with my own files being removed

glass pecan
#

oh

#

del hope, dispair

obsidian patio
#

hahah yeah

glass pecan
#

but if it's just a commit change, it's possible you could go back on HEAD one commit

#

so long as your previous files were actually committed at some point locally

#

i forget the command tbh

#

something like reset HEAD^

obsidian patio
#

They weren't. This was the commit that committed them and I tried to do a soft reset on it

#

I sent my git commands above in the paste, together with a better explanation of what happened

green oriole
#

They are still there as a git glob, so in the worst case they are still recoverable

green mesa
#

I usually make one backup branch after I messed my fork master😅

brazen charm
#

check the local history on the rot dir n pycharm, should be able to restore it with one click there

short snow
#

i did the thing
@nocturne hare what is the thing?

nocturne hare
#

the thing he timed me to do

green oriole
#

the thing

green mesa
#

The thing lol😂

#

I think my command will get 1 more check pass soon floppy requesting for 2 change only 😁

obsidian patio
#

@brazen charm How would that be done?

brazen charm
#

right click on the folder in the proejct view, the history button should be somewhere in the lower half

obsidian patio
#

Aaah; found it

#

@brazen charm is revert what I use to go back to that version?

#

Or create patch?

brazen charm
#

Revert will change your local files directly, you can view the diff beforehand and select what you want to bring over from that revision from the deleted ifles

obsidian patio
#

Aah, alright

eternal owl
obsidian patio
#

@brazen charm You're a life saver (and a literal code saver). Thanks a lot!

obsidian patio
sullen phoenix
#

closing unnecessary issues

subtle kraken
#

Core dev went rogue on unit tests - the log

obsidian patio
#

Alright

subtle kraken
#

We have whole bunch of issues that are
A) irrelevant
B) Not needed anymore
I'm closing what I have previously internally suggested to close

crude gyro
#

very nice work, @subtle kraken

subtle kraken
#

Thanks

#

I will try to PR some of the older issues later this month

#

I might consider PRing unit tests myself once I understand them well enough

green mesa
#

Yeh I am also learning unit test I will also try to make pr for that😁

neon garnet
#

Is there any chance we're gonna add unit tests in the future for @dusky shore ?

green mesa
#

It will be helpful if we add in seasonal bot

#

Too

eternal owl
neon garnet
#

Also @green mesa, I started a review on your PR, feel free to ping me for new changes

green mesa
#

Ty pure 🙂

crude gyro
#

@eternal owl

you can work on it. just make sure we get the site API looked at carefully.

#

I haven't had time yet but we should put in on our list.

eternal owl
#

okay 👍

#

btw, can you assign me to that issue plz

exotic ember
#

assigned

eternal owl
#

thx

cold moon
cold moon
#

Should be guides under static dir?

cold moon
#

Or resources under app?

green oriole
#

In the resources I'd say

green oriole
#

Can we have many RedisCache per cog?

hardy gorge
#

There's no restriction in the number of RedisCache instances per cog, no

#

Each will get a unique base namespace

green oriole
#

That's interesting, so you base yourself on the attribute name to know which cache correspond to what?

hardy gorge
#

Yes, the namespace is a combination of the name of the owner class and the class attribute

#
class SomeCog:
    some_attribute = RedisCache()

This will result in the namespace SomeCog.some_attribute

green oriole
#

That's pretty cool

hardy gorge
#

There's an update coming for the RedisCache soon™️ now that we've turned it into a general purpose package

#

That update also contains a few bugfixes and some more options

#

Basically, the code will be moved out of bot and we'll just start using the package instead

cold moon
#

Does site have any sort of caching? I want to load all guides to cache on startup and then use them in views.

subtle kraken
#

@cold moon hi, I can assign you but you probably will have to comment on the issue as github doesn't list you as a valid member to be assigned

cold moon
#

@subtle kraken I commented to issue

subtle kraken
#

Assigned :+1:

obsidian patio
#

Are # TODO:s and other code tags not allowed for @dusky shore? Seems like they don't pass linting

green oriole
#

What does the linter say?

glass pecan
#

yes, that's correct, we don't allow TODO comments to be committed

hardy gorge
#

Typically, when you PR in a new feature, it's reasonably done and should not have TODO comments in it

glass pecan
#

if additional feature development is needed, github issues are better for that.

#

but it sets an expectation like ves said that the feature should be reasonably complete

hardy gorge
#

I guess that if you're adding entire files during your workflow and it has a # todo comment elsewhere, that could be a problem

#

However, you should be able to add files in chunks or even individual lines to commit just the changes that go with that atomic feature change

obsidian patio
#

Alright

#

This is still just a WIP on my branch, so it's not quite done yet. I'll track the issues on the GH fork, then

tough imp
#

Is precommit preventing you from commiting?

#

I'd consider that pretty annoying, each commit doesn't have to be production ready

glass pecan
#

it's possible to commit without using hooks (git commit -n or just unticking run hooks if using commit gui in pycharm), but ever since we added it we've had a lot less hassles getting consistency in PRs, so it's doing it's job

#

also greatly avoids the whole "fix linting error" commit histories that come about, which is gross

tough imp
#

mmm yea

hardy gorge
#

At the end of the day, WIP commits don't add much to the commit history of the project

#

The commits should document atomic changes you made to the project

obsidian patio
#

Yeah. It would be very nice to be able to quickly point out things should preferably be fixed later on, but aren't that big of a deal. Either way, it's probably better this way

#

@hardy gorge With "atomic", do you mean like individual pieces or something similar, and not just a few changes here and there

hardy gorge
#

The term "atomic" is a bit difficult and there are difficult interpretations of what "atomic" precisely means, but, in general, you group together single "units" of changes that necessarily go together. At the end, you have a commit history where each commit reflects such a coherent single change instead of an assortment of unrelated changes that you're making in the course of the current thing you're implementing. So, a commit might read "Add option to ignore roles in filter" (a single new feature) instead of that it's a mixture of several separate changes.

#

At the end, the commit history you want to merge into a project should not contain WIP commits and/or personal "quick save" points (in gaming terms); it should be a clean history of such atomic commits.

obsidian patio
#

Aah, that makes sense. This is what I'm trying to do nowadays when committing as well. Good to have a term for it. Even though I still think adding TODOs straight into the code isn't totally unreasonable, I can see why why we choose not to

cold moon
#

Is there any way to cache all guides content and metadata on startup with Django?

tough imp
#

@obsidian patio Fwiw, you can bypass pre-commit as Scrags has shown, I wasn't even aware we check for TODOs because I don't have pre-commit enabled (I didn't get it to work)

#

I think that your local workflow is yours and yours only, it's only when you push the commits (and therefore share them with others) is when you should consider things like that

#

the commit history you want to merge into a project should not contain WIP commits and/or personal "quick save" points
I agree but every commit made locally doesn't make it into the remote

glass pecan
#

often it does, it's often the exception that it doesn't

tough imp
#

sure I'm not trying to debate pre-commit

obsidian patio
#

Yeah, I agree, though I'm mostly experimenting with using TODOs right now; they seem useful. However, I'm not comfortable enough with git to remove such things from the history before opening a PR at the moment

tough imp
#

I just think it's fine to not use it if it feels restrictive and you clean up your history before it's published

cold moon
patent pivot
#

timestamp is weird

#

can we humanise it? 3 weeks ago

cold moon
#

Okay

patent pivot
#

hm

#

or maybe just use a date

#

last updated 19th May 2020

cold moon
patent pivot
#

getting there, I wish we didn't wrap that date but I'm not sure how preventable that is.

#

I'm also not sure we settled on the name of guides, so be aware

#

ideally we'd want privacy, FAQ, data reviews and so on under this system I think

glass pecan
#

tbh i'd rather that meta info under the title in small discreet writing, similar to news article meta

patent pivot
#

yeah, I think I agree

obsidian patio
#

I think we could have the info on new lines and the header on the first line

#

Date:
28th August, 2020

Contributors:
Some People, Another Person,
Third One

#

I think this looks way better

cold moon
#

This is my first time working with Bulma. I have used much Bootstrap, but never Bulma before

obsidian patio
#

If it doesn’t have to be on the side, we could even put the meta data at the bottom of the text, since it’s not generally what people are interested in

cold moon
obsidian patio
#

Yeah, that looks quite good

cold moon
#

Now guides listing... and categories...

#

That's pretty annoying to use PyCharm Community when I used PyCharm Professional for a long time...

sharp timber
#

Oh bleh, I blew the tests

glass pecan
#

haha it happens

sharp timber
#

How do I even run them?

glass pecan
#

install dev deps with pipenv, run pipenv test

sharp timber
#

I do, it's failing out because it's not in docker, presumably

glass pecan
#

shouldn't. more likely missing envs

sharp timber
#

Well, at the moment I've got a "unabel to open database file"

#

after the bot log being owned by root, which I assume is a docker thing

glass pecan
#

where? in CI or locally?

sharp timber
#

locally

#

tests failed in CI cause I forgot to run them

glass pecan
#

start the postgres db service in docker in the bg

#

docker-compose up -d postgres i think

#

oh wait

#

that's wrong

#

you're on bot

sharp timber
#

I was just going to start the whole thing up with -d

glass pecan
#

you need to run site

sharp timber
#

then run tests while it was active

#

"No such service: site"

brazen charm
#

The bot tests should run fine on their own

sharp timber
#

oh

#

This is probably another perms issue isn't it.

#

ah, there's the test readme

#

I didnt' change anything, and now it's starting

#

ok..

tough imp
#

should be able to just pipenv run test

#

i get the same result locally as in CI

sharp timber
#

That's working now

#

I think it was just a lingering error from a permissions thing

glass pecan
#

oh well, at least it's working now

sharp timber
#

ugh, this test is not going to fix nicely

#

And that's because some of this code is in a different place

#

Is it acceptable to force push within my PR?

#

Well, where I put the code makes sense, I think

#

but that means this test won't work, so lets seee what I can do

glass pecan
#

if nobody else has worked on it, yep

sharp timber
#

Ok

#

The issue is post-changes there's two different behaviors under take_action

#

I'm not sure if that's the right way to do it but it seems logical

#

but because of that, I'm using the input token more than the test provides

#

I probably just need to read how to use the mock right

glass pecan
#

if you need help with tests, i'd highly recommend asking ves

hardy gorge
#

Depending on the feature, I'd say don't overburden yourself with tests

#

We're scaling down the tests a bit at the moment

#

It's too much of a blocker

#

Helper functions, simple mappings of input and output, are obviously easy to test

sharp timber
#

Yeah

#

Reading the error it seemed something simple.. and I think it is. I've added new tests for the new additions, but need to add two more for the log message, and fix two that no longer fit because the log message is different

#

regardless, I'll be resetting my PR with a force push so that the commits stay clean, because there's two changes there I want to keep separate

hardy gorge
#

That should be fine

sharp timber
#

Well, all done except for one test

#

that I do not understand why it's not mocking

#

Here's the mock:

#

    @autospec("bot.cogs.token_remover", "LOG_MESSAGE", "USER_TOKEN_MESSAGE")
    def test_format_log_message_user_token(self, log_message, user_token_message):
        """Should correctly format the log message with info from the message and token."""
        token = Token("NDY3MjIzMjMwNjUwNzc3NjQx", "XsySD_", "s45jqDV_Iisn-symw0yDRrk_jf4")
        log_message.format.return_value = "Howdy"
        user_token_message.format.return_value = "Partner"
#

usage:

#
        message = LOG_MESSAGE.format(
            author=msg.author,
            author_id=msg.author.id,
            channel=msg.channel.mention,
            user_id=token.user_id,
            timestamp=token.timestamp,
            hmac='x' * len(token.hmac),
        )
        if user_name:
            more = USER_TOKEN_MESSAGE.format(user_id=user_id, user_name=user_name)
        else:
            more = DECODED_LOG_MESSAGE.format(user_id=user_id)
        return message + "\n" + more
#

definition at top:

#
USER_TOKEN_MESSAGE = (
    "The token user_id decodes into {user_id}, "
    "which matches {user_name} and means this is a valid USER token."
)
#

I'm blind

tawdry vapor
#

Does that mean you figured it out?

sharp timber
#

Test's passed!

#

yeah

#

turns out that the actual check at the bottom of that test method was wrong, I had misread the method and thought it was something else

tawdry vapor
#

Why did you remove string.isascii() and string.isdigit()

sharp timber
#

It's still in there

tawdry vapor
#

it's int() now

sharp timber
#

its in extract_user_id

#

right before int()

tawdry vapor
#

I was looking at an outdated version

#

Sorry

sharp timber
#

nw

#

The tests helped me fix things >.>

vocal wolf
short snow
#

.issue 432

dusky shoreBOT
green mesa
#

@vocal wolf yeh sir 😁

#

I am just waiting for my wiki command to get merged

#

Then partnerzodiac and this issue 432 is ready

#

I will push these my making separate branches together

vocal wolf
#

Alright, just making sure.

green mesa
#

👍

green mesa
#

@neon garnet i have made changes according to what u said and pushed the changes, u can check my changes now 😄

neon garnet
#

@green mesa I also have a fairly new comment about replacing the while loop with a for loop instead. Might want to take a look.

green mesa
#

yes just seen 😅

neon garnet
#

I'll be doing future reviews in chunks, make sure to check #dev-log for easier access 😄

green mesa
#

ok 😄

cold moon
green mesa
#

noice

green mesa
#

changes made @neon garnet and pushed to github 😁

green mesa
#

at seasonal bot in uptime.py from bot import start_time is there but when i check bot.py it doesnt have

#

where is start_time actually?

cold moon
#

I'm including 1 guide with guides app PR: How to write a guide.

#

I need file to this dir in order to add this to Git

patent pivot
#

you could copy across the current guides

#

I can get you an export of all the markdown for them to simplify it for you

cold moon
#

No, migrating them is in another issue and there is said that this have to be handled in other PR

#

Does anyone know what classes Bulma use for syntax highlight?

#

Currently just they are plain codeblocks without highlight

obtuse arrow
#

Is there a guide for getting started contributing to PyDis repositories for newbies?

subtle kraken
#

There is guide on how all the setup works

obtuse arrow
#

Cool, thanks.

patent pivot
#

I do wonder how useful this guide system will be for non-guide markdown content

#

we could even host that content on a subdomain like pyweek

green mesa
patent pivot
#

reload

#

it's still there

green mesa
#

ok

#

joe still same

#

i can see everyone pfp but not yours 😅

#

might be something messed up at my client side

patent pivot
#

lol

cold moon
patent pivot
#

fine by me

neon garnet
#

Any thoughts on adding a type checking command for @stable mountain through snekbox and mypy? I might make an issue for both repositories later, just gonna ask for feedback first

green mesa
#

ehhh f discord y

#

y i cant see joe pfp lol

cold moon
green oriole
#

Also, we could use the short description as a description for the link embeds

cold moon
#

How to do this?

subtle kraken
#

html structure would need to be adjusted so discord can scrape short description I assume

green oriole
#

It is a meta tag I think, but I never tried it

cold moon
#

Yes, Open Graph meta properties. Googled it

#

OK, gonna add them now, then I will write unit tests, then push + PR

green oriole
#

Sounds great lemon_pleased

subtle kraken
#

I agree, sounds pretty nice

cold moon
#

Quick question: What logo should I use for this preview card?

#

Or maybe no image?

#

Yes, currently this don't show too image for https://pythondiscord.com

#

Is unit tests really required for site? Because loading different files for testing looks like impossible for Django and I think this is not a good idea to relay on production data.

green oriole
#

I'd say yes, the guides are a pretty fundamental part of the site

#

Maybe you should mock whatever function is used by django to load files, in order to redirect to a sample, and test that the generated html is correct?

cold moon
#

This is all in view, this use os.path.join to get paths

#

I'm making only response code checks

green oriole
#

Well there you go, you can mock the path object to return a buffer

#

Testing that the generated html is correct is still very important IMHO

cold moon
#

I have never done something like this before

green oriole
green mesa
#

i am working on source command can i hardcode thishttps://github.com/python-discord/seasonalbot/tree/master/

cold moon
#

There isn't anything about HTML tests

#

And it's not good idea to do assertEqual for HTML

green oriole
#

There's an assertHtml, or something similar iirc

obsidian patio
#

I suppose that should be fine. You could put it in a separate file as well, like constants.py, to store them

cold moon
#

There is some UI testing frameworks, maybe should we implement this somehow.

green mesa
#

ok

#

i am using inspect module

#

to get location

#

and starting line number of command

cold moon
#

Currently nothing is using HTML tests on site

green oriole
#

@green mesa you have copied the implementation of @stable mountain to @dusky shore, right ?

green mesa
#

little bit

#

i am doing this

import inspect
cmd = bot.get_command("player")
line,source = inspect.getsourcelines(cmd.callback)
location = cmd.module.replace('.','/')
print(f'https://github.com/Anubhav1603/gflbot/blob/master/{location}.py#L{source}-{len(line)+source}')
#

and this is the whole thing lol

#

i am trying with eval

#

with my won bot

green mesa
#

just need to put that code with embed

#

and command is ready

green oriole
#

@green mesa well, it looks like you should be able to just copy paste the code from @stable mountain, why not start by that?

sharp timber
#

I would not hardcode that url, github has changed it in the past

green oriole
#

It looks like you can make it work by changing only a few URLs/attribute names

sharp timber
#

broke a ton of my links at the time

green oriole
#

Did it?

green mesa
#

@green mesa well, it looks like you should be able to just copy paste the code from @stable mountain, why not start by that?
actually python code is very huge 😅 and u can check my code it does the job

#

so i thought i can do

#

as soon as my wiki command get merged

green oriole
#

Well I mean, if the code is that huge, there's a reason for it

green mesa
#

i will write code and try with it

#

yeh make sense might be some reason

#

😅

#

actually i looked at pybot code first

green oriole
#

Like they say, no needs to reinvent the wheel lemon_pleased

green mesa
#

yeh

#

ok then all of my pr is ready as soon as one will get approved 2 will be pushed 😄

green mesa
#

I think we should send issue help command if no argument is passed

#

.issue

dusky shoreBOT
obsidian patio
#

Yeah

green mesa
#

Will I open issue for this?

obsidian patio
#

Sure thing

green mesa
#

Ok I will make an issue for it in 1h

#

And one more thing I like to see in seasonal bot and pybot I wnt to have command which shows last 5 to 10 commits, how many prs are open and which last 3 got closed😁

brazen charm
#

There's already a pr for the help

obsidian patio
#

@green mesa seems like there’s no need to open an issue for it

green mesa
#

Ok

#

@brazen charm but that's for new help command 😅

cold moon
#

I can't find what is wrong

#

These return 404

#

I need help with unit tests. I haven't wrote Django unit tests for such pages, only for REST APIs, and I can't just leave them because site requires 100% coverage.

green mesa
#

What is duckpond?

glass pecan
#

are you aware of starboards?

#

it's that, but using ducks and limited to staff channels

green mesa
#

Ok

#

Y not we have for all member?

glass pecan
#

because that would be a mess

green mesa
#

Yeh I agree

glass pecan
#

we use it because we ran out of pins

green mesa
#

Hmm

obsidian patio
#

Haha you say so many amazing things in the staff channels?

glass pecan
#

i wouldn't go that overboard to say they're amazing. there's just a few funny things or random things we've come across that we want to be able to see again later. pins are just limited to 20 items in the end, and if we had silly things using them up, we can't fit any of our proper pinned messages that are meant for staff reference

sharp timber
#

I do similar things on my server, with an "archived" channel that things you might want to look back on later go

obsidian patio
#

Aah, yeah, that’s reasonable. I quite like the idea of having a ducky pond

queen dawn
#

Can someone help me setup the @stable mountain I need help setting it up and I have somekind of error when running __init__ The error is ImportError: cannot import name 'DEBUG_MODE' from partially initialized module 'bot' (most likely due to a circular import) (C:\Users\amitk\OneDrive\מסמכים\GitHub\bot\bot\bot.py)
More info about my problem #help-avocado

brazen charm
queen dawn
#

Set urls.site:
If running the webserver in Docker, set it to "web:8000".
If the site container is running separately (i.e. started from a clone of the site repository), then COMPOSE_PROJECT_NAME has to be set to use this domain. If you choose not to set it, the domain in the following step can be used instead.
If running the webserver locally and the hosts file has been configured, set it to "pythondiscord.local:8000".
Otherwise, use whatever domain corresponds to the server where the site is being hosted.

#

what does all of this mean?

#

What is a docker and why do I need it

queen dawn
#

How do I check users deafen status using the discord.py?

vocal wolf
queen dawn
#

Oh oops

#

Wrong channel

vocal wolf
#

np

neon garnet
#

Any thoughts on adding a type checking command for @stable mountain through snekbox and mypy? I might make an issue for both repositories later, just gonna ask for feedback first
small bump

tawdry vapor
#

In what context besides personal would this be useful?

#

Is wanting to show the results of mypy to another user during a discussion really a use case?

brazen charm
#

I think the mypy playground covers this better than the bot can

neon garnet
#

In what context besides personal would this be useful?
I guess if we did have a topical channel dedicated for type-related things it might be useful, but then again, mypy playground seems to be able to do just that.

green mesa
#

if anyone give suggestion of code on github and i apply it and it fails the check

#

when i do git fetch --all and then git pull will i get the code

#

which is having issue?

green oriole
#

You don't need to fetch before pulling, pull is equal to a fetch then a merge btw

#

Although, it could simply be because the proposed change isn't properly linted

#

So once you pulled, you should run the linter and correct the errors

green mesa
#

ok

hardy gorge
#

<@&295488872404484098>
As you may have noticed, you have been granted streaming permissions in our general voice channel. The idea behind this is that we want to allow contributors to stream themselves working on community projects. We do want to ask you to keep your streams relevant to the community: Try to keep it limited to things like you working on community projects or at least Python projects in general. This is why we've currently only granted the permission in the General voice channel, as that would be the natural place to stream such things.

This is a bit of an experiment and we want to see how it plays out. We're currently discussing voice channels in general, as we have had some issues with voice trolls, so please do report disruptions and trolls joining the channel while you are streaming.

Anyway, in short, we decided to allow contribs to stream in the general VC, but please do keep it clean and community-related/python-related.

green mesa
#

heheh now wnt to become contributor fast UwU

neon garnet
#

@green mesa You might want to take caution and make sure that your commits pass the pre-commit tests that we have, so far, your recent commits are failing because you've failed to address the unused import for Optional.

green mesa
#

@neon garnet i have addressed that thats y my last to last commit passed but when i commit suggestion

#

it fails

#

with same error

green oriole
#

The precommit hook fails?

#

Well, you gotta add those changes first

neon garnet
#

I assume they're committing changes within GitHub

green mesa
green oriole
#

Oh well, it is pretty easy to see

green mesa
#

when i commit these

#

hook fails

#

commit suggestions

#

with same error

green oriole
#

Right, you applied the suggestion and it made the linting fails

green mesa
#

yeh this is happening

#

dont know y

green oriole
#

Well, now you can pull the code on your computer, fix the linting and push again 🙂

green mesa
#

yeh i do that only

#

i have pulled the code from github

#

now fixing and pushing it again

green oriole
#

Sounds about right

green mesa
#

lol where my changes gone hehehe

#

my optional gone from github

green oriole
#

Wdym?

green mesa
#

i meant i added Optional[List[str]] -> now its back to List[str]

#

this might be causing problem

#

and making liniting fail

green oriole
#

Well, yes, because you’re still importing Optional but not using it

green mesa
#

yeh now i added it again

green oriole
#

Well, since you’re not using it, you need to get rid of the import

green mesa
#

i am using it now

nocturne hare
#

Why are you using it again?

#

Optional is saying it's going to return None or something. Your search will always return a list

green mesa
#

hmmm

#

oops

nocturne hare
#

You also changed this just now

s_desc = "\n".join(self.formatted_wiki_url(index, titles) for index, title in enumerate(titles, start=1))```
#

Why did you change it to titles ?

#

You were using the title variable inside the comprehension before

green mesa
#

ahh let me fix this also

#

fixed

brazen charm
#

Most of the time it's better to apply the suggestion from GitHub manually to make sure everything works

green mesa
#

now u can check the changes @nocturne hare

obsidian patio
#

How does one generally become a core developer? Are there any specific repos to contribute to and/or other specific requirements?

green mesa
#

when u do some core contribute to site or main pydis bot

#

i think if we ping the user also when bot denies to execute code in particular channel

#

then it will be nice

obsidian patio
#

I believe joe removed all of his roles to check if that would work

neon garnet
#

Not really needed to be fair, most users who try it realize sooner or later

green mesa
#

but joe has one role in ss

brazen charm
#

Core devs are staff that regularly contribute to the projects afaik

green mesa
#

so we can become core dev if we contribute to one repo only

obsidian patio
#

So, necessarily staff...? Do you know if it’s project specific?

green mesa
#

i meant only to seasonal bot

brazen charm
#

Probably not, I'm if course not familiar with it but you probably get put in the org and have the same permissions everywhere

green mesa
#

hmm

obsidian patio
#

Yeah, true. If anyone has some more info about it, I’d love to hear

subtle kraken
obsidian patio
#

What’s the reasoning behind restricting it to staff only?

glass pecan
#

if you're at the point where we'd consider you such a critical component of managing our projects, you're likely going to be promoted to staff purely based on those merits regardless

#

It's not a matter of just contributing consistently anymore to be a core dev.

#

It's an actual position of management

obsidian patio
#

Aah, alright. That makes sense

green oriole
#

I’ve reviewed scrag’s PR using the new codespace thingy by github, I have to say, it was pretty awesome

obsidian patio
#

Codespace?

green oriole
#

The only thing is that a bit of manual setup is still required (like installing pipenv), it would be mice if we can include that in our repo

#

Would you be interested in supporting that?

green mesa
#

I like this😁

obsidian patio
#

@green oriole how would we include that like some setup? Do you mean something like a setup file that runs all configuration steps for you...?

green oriole
obsidian patio
#

Aah, alright. Maybe I’ll have to try out the beta. Seems promising

eternal owl
#

is it fine to use emojis in commit messages?

#

like a check mark

#

is it a good thing to use emojis in commit messages?

cold moon
#

Should I write tests for production guides validity?

#

Like checking is all required metadata exists

#

And categories have _info.yml file with required fields?

green oriole
#

That'd be nice, yeah

cold moon
#

I will do this as normal unit tests, just this relay on production data.

neon phoenix
exotic ember
#

fixed

neon phoenix
#

epic response time

green mesa
#

@nocturne hare i have tested the code and its working 🙂

nocturne hare
#

Great, I've approved iirc, so just get the rest who reviewed it to go over it real quick

green mesa
#

ty ty ty

#

i have to wait for pure

#

she is also reviewing my pr

nocturne hare
#

Can you link your pr again, Just wanna go over it with a few concerns i just had

green mesa
#

sure

#

.pr 430

dusky shoreBOT
green mesa
#

y it took so time pithink

nocturne hare
#

¯_(ツ)_/¯

#

Looks good, just wanted to make sure there weren't any exploits in making the bot mention people and etc

green mesa
#

ty for approving 🙂

#

2 approve i got but y my pr didnt got merged

#

automatically?

hardy gorge
#

Someone has to press the magic button

green mesa
#

i wish i could press 🙃

hardy gorge
#

@eternal owl I'm not a fan of emojis in commit messages and especially in the summary line. You need to learn what the icons mean and it can become a visual cacophony.

eternal owl
#

alright then 👍

crude gyro
#

I, on the other hand, think emojis in the summary line of a commit message can be quite nice, as long as they don't have to communicate anything important.

exotic ember
#

Fix 👏 bug 👏 and 👏 rewrite 👏 tests 👏 to 👏 reflect 👏 changes.

crude gyro
#

at work we often do emoji and a prefix instead of just emoji

#

like

#

🔨 Kaizen: Fix an incorrect type hint

green mesa
#

but what if user do two things at once or more

crude gyro
#

don't do that. commits should be atomic

#

one change is one commit. that change can be big or small.

#

but not too big.

green mesa
#

i have to change my habit 😅

obsidian patio
green mesa
#

tnx

crude gyro
#

good definition

obsidian patio
#

Indeed

crude gyro
#

Ves knows what's up.

#

and Ves writes very good commits

thorny obsidian
#

I've found that following that atomic commit structure has helped me better organize and complete projects without it getting haphazard.

green mesa
#

yeh can u pin that lemon

#

😅

green mesa
#

ty

crude gyro
#

happy to.

obsidian patio
#

The time when I have difficulties keeping it atomic is when I have to rewrite something and don’t think leaving non-working versions in the git history

#

Any tips for such cases?

green oriole
#

You sometime will have to have non-working versions

hardy gorge
#

yeah, I just don't see the appeal of having emojis in commit messages

#

That said, it is probably me

obsidian patio
#

It could definitely add a quick look at what it’s for

hardy gorge
#

I wouldn't mind it every now and then, but I get overwhelmed quickly by visual stuff; everything just becomes a blur and I'm just lost

obsidian patio
#

Without having to read "Add support for boolean expression" to know that it’s a feature (or is it a bug fix?)

hardy gorge
#

I know what the commit is supposed to do, if that's what you mean

#

It adds support for boolean expressions

obsidian patio
#

Hahah yeah

#

When I start new projects or rewrite a lot of the code, I often try out a lot of things before committing. It’s hard to keep things atomic when I don’t see the full molecule yet, so to speak. Would the best way still be to commit the distinct changes and get a much longer git history with some non-working versions? What do you think @hardy gorge?

hardy gorge
#

There are a few ways of doing that. The most important point is that as long as your git history is local (i.e., no one else has that history/is working of that same history), you can still modify your history.

#

This means that you can commit a change, and then, later on, when you change something to that "change", you can commit that separately, and then use an interactive rebase to turn it into a single commit by moving that later commit to the first commit and squashing them together.

#

Likewise, you can commit changes later, interactively adding chunks of changes or even individual changes within a file and then committing them

#

You're not limited to staging entire files

obsidian patio
#

That sounds quite nice. I suppose it would be a good idea to get more comfortable with some less basic git commands. Do you usually personally use a combination of these methods when making such rewrites or start a new project?

hardy gorge
#

I use all of them, typically, because I can get a bit carried away while working on something

#

There are some decent GUI tools as well that can help you with using those git tools, although some are limited in some way

#

I kinda like PyCharm, but it's "chunking" when staging changes is a bit rough; it does not allow you to select changes as finely as the command line interface allows you to.

tough imp
#

Sublime Merge is pretty good too, I use it when I don't have Pycharm available

obsidian patio
#

Hmm, alright. Thanks a lot for the help. Time to learn some more git!

tough imp
#

Pycharm needs a little bit of help with chunking sometimes yea

eternal owl
#

Sublime merge is for sublime text ?

obsidian patio
#

Maybe worth checking out Sublime Merge. I'll probably have a look at that as well in the future. Right now, I'll focus on trying to learn PyCharm (and the command line tools)

green mesa
#

i use vsc only 😅

hardy gorge
#

For me there are two import things each commit should have:

  • Commits should contain a single atomic change
  • Commits should have a good commit message, which typically also means a message body
tough imp
#

Merge is standalone and it will bug you to buy a license if you don't have one, just like text does, but it works well

hardy gorge
#

Sublime Merge is a standalone, yeah

#

I have it installed as well

brazen charm
#

Agree on the chunking front for pycharm, but other than that (which can easily be circumvented) the selective committing with the GUI diff is quite easy through it

eternal owl
#

I use the terminal all the time, I recently installed gitkraken so that I can select individual lines of code and commit them (I should still see if it's possible or not )

hardy gorge
#

You can do that with the command line as well, if you want

green mesa
#

i use vsc terminal

hardy gorge
#

But a GUI may help there

#

git add -i, select patch, select the file(s), and have a go

eternal owl
#

Yea I guess I have to use patch mode via terminal, but I think GUI will be clearer

brazen charm
#

I think the only git problem I had with pycharm was that I couldn't resume a merge from it after it failed in pre commit and had to finish manually

green mesa
#

which gui is good for github

#

thinking of installing one

tough imp
#

I always get stuck in some weird state when I attempt interactive rebase from within pycharm

#

but I think it's a me problem as usual

hardy gorge
#

I've never tried it; I always use the terminal for that

thorny obsidian
#

I've been very happy with gitkraken so far

hardy gorge
#

Old habits

tough imp
#

I'm more comfortable rebasing from the terminal, but the GUI is convenient for staging

hardy gorge
#

I do use PyCharm for Pull Requests and reviews now. It's not entirely there yet, but it's easy to check out the PR locally even if it's from a fork

cold moon
#

I can't find why

def get_guides(category: Optional[str] = None) -> Dict[str, Dict]:
    """Get all root guides when category is not specified. Otherwise get all this category guides."""
    if category is None:
        base_dir = os.path.join(settings.BASE_DIR, "pydis_site", "apps", "guides", "resources", "guides")
    else:
        base_dir = os.path.join(settings.BASE_DIR, "pydis_site", "apps", "guides", "resources", "guides", category)

    guides = {}

    for filename in os.listdir(base_dir):
        full_path = os.path.join(base_dir, filename)
        if os.path.isfile(full_path) and filename.endswith(".md"):
            md = Markdown(extensions=['meta'])
            with open(full_path) as f:
                md.convert(f.read())

            guides[os.path.splitext(filename)[0]] = md.Meta

    return guides

is calling join __index__()? I think this is some OS function, but I don't know what I should put for it output to side effect for testing.

green mesa
#

i am also learning django so i can also contribute to site UwU

green oriole
#

I have no idea what I'm doing with the test.
lemon_pleased lemon_thinking

cold moon
#

?

green oriole
#

.issue 1166 bot

dusky shoreBOT
green oriole
#

Last line

obsidian patio
#

In @stable mountain, we have bot.utils.checks for storing with_role_check. Do we have something similar for @dusky shore? I couldn't find with_role_check when searching the repo

green oriole
#

It is called with_role

obsidian patio
#

Ah, thanks!

green oriole
#

Any time lemon_pleased

obsidian patio
#

Hmm, it doesn't seem like they do quite the same thing. with_role_check returns a boolean, while with_role is used as a decorator

#

I believe that's how it is, at least

mellow hare
#

I think the decorator uses the with_role_check

#

I'll look that over again

#

It does explicitly use the with_role_check()

#

Huh, that's strange that it's not the same in seasonal

obsidian patio
#

I think I could copy over the with_role_check() as well

#

Yeah. Seems like they differ more than I expected. I've spent some time changing imports already

#

Seems like the entire checks file is missing

mellow hare
#

Entirely up to you. If you're wanting to take the time to make it consistent across the two, I won't say no

obsidian patio
#

I'll give it a try. If we encounter too many bugs with the checks.py file after moving it to SeasonalBot, I'll drop it for now

green oriole
#

I don't think you'll have too many bugs, just red everywhere

obsidian patio
#

Hahah, yeah. We'll see

#

Alright, I have a beta version up and running 😄

cold moon
#

Time to open guides PR

obsidian patio
#

Aaand we have touchdown. The new extensions command for @dusky shore should be good to go

#

.issue 449

dusky shoreBOT
sullen phoenix
#

thanks, i'll have a look

eternal owl
#

@crude gyro In how much time are you expecting the bulk patch/update to complete in? say for 1000 users in one request

obsidian patio
#

Awesome😄

crude gyro
#

@crude gyro In how much time are you expecting the bulk patch/update to complete in? say for 1000 users in one request
@eternal owl

Postgres can modify 1000 rows in practically no time at all, as long as you do it in a single transaction. I expect it should take less than a second? But I'm not sure.

#

maybe even a lot less than a second

eternal owl
#

okay then i need to refactor my code

mellow hare
#

@eternal owl Is this for the pagination PR?

eternal owl
#

yea that one

#

i went with the method mentioned in the docs, and its no where taking 1s, lol

#

12s for 1000 users

#

with 2001 db queries

#

then i did it a little differently

#

using bulk_update()

#

took like 2 db queires but still similar time

#

but the bulk create is instant

#

took like 1.2s for 8000 new users

patent pivot
#

metricity bulk upserts 2,500 at a time

eternal owl
#

how much time does it take

#

less than a second?

cold moon
#

@tough imp Mod utils tests PR fixed

patent pivot
#

uhhh

#

no

#

a few seconds

#

I don't have an exact time, but it works well enough

eternal owl
#

metricity uses django orm?

tough imp
#

thanks ks, going to look soon

eternal owl
#

21seconds, 2db queries to update 1000 users

#

using bulk_update() method

patent pivot
#

metricity does not use Django ORM, no

tough imp
#

@cold moon Sorry if I gave you too much trouble with that PR. I just wanted to make sure we get it right because the moderation suite depends on that module. It's really well done now

sullen phoenix
#

@obsidian patio did you test out your PR? the list subcommand doesn't seem to work

09/21/20 15:04:48 - root DEBUG: Error Encountered: RuntimeError - Line exceeds maximum page size 698, Command: extensions list, Author: f1re#3996, Channel: python-general
09/21/20 15:04:48 - bot.exts.evergreen.error_handler ERROR: Unhandled command error: Line exceeds maximum page size 698
Traceback (most recent call last):
  File "/home/dpham/.local/share/virtualenvs/seasonalbot-oSM7Qold/lib/python3.8/site-packages/discord/ext/commands/core.py", line 85, in wrapped
    ret = await coro(*args, **kwargs)
  File "/home/dpham/code/pydis/seasonalbot/bot/exts/utils/extensions.py", line 171, in list_command
    await LinePaginator.paginate(lines, ctx, embed, max_size=700, empty=False)
  File "/home/dpham/code/pydis/seasonalbot/bot/utils/pagination.py", line 139, in paginate
    paginator.add_line(line, empty=empty)
  File "/home/dpham/code/pydis/seasonalbot/bot/utils/pagination.py", line 59, in add_line
    raise RuntimeError('Line exceeds maximum page size %s' % (self.max_size - len(self.prefix) - 2))
RuntimeError: Line exceeds maximum page size 698
obsidian patio
#

Hmm.. it worked perfectly in my tests

sullen phoenix
#

interesting

obsidian patio
#

That’s probably because I didn’t have the correct emojis to use. Mine were shorter in length than the ones I didn’t have access to

#

Hmm. I’ll have to use custom emojis (but not the correct ones, obviously) in the future

#

@sullen phoenix unless you could add a quick argument about the length, I’ll fix it tomorrow

sullen phoenix
#

hmm, i'll look into it

obsidian patio
#

Alright, thanks. Just tell me if you change your mind

vocal wolf
#

.issue 697 bot

dusky shoreBOT
vocal wolf
#

@patent pivot Looking at this issue, do you know if the bot and site are hosted on the same machine?

patent pivot
#

they are, yes

vocal wolf
#

ah

patent pivot
#

why?

#

ah wait

#

reading issue

#

lol

vocal wolf
#

When writing the ping command I'm not sure if it would be useful to ping the site if they're on the same machine

#

yeah

patent pivot
#

yeah, hosted on the same machine but the bot does go through cloudflare still

#

so it goes out, then in, then out

#

pinging the site is probably still a good idea, because it will go through CF

vocal wolf
#

I'm new to contributing to @stable mountain. Where would I get started with finding connections to the site?

patent pivot
#

hmmm, well it's just a HTTP API, but the most important metric is the ping between the bot and the cloudflare IP

green oriole
#

I'm new to contributing to @stable mountain. Where would I get started with finding connections to the site?
@vocal wolf If you are using docker, it is http://web:8000

vocal wolf
#

So I could just time the bot's http session doing a get request from that url.

green oriole
#

I think so, yeah

#

Although, the whole URL is configurable

sullen phoenix
vocal wolf
#

sick

eternal owl
#

i get No module named 'git' error when running the website via docker, what am I missing?

#

but when I run the site via pycharm, runserver, it runs fine

brazen charm
#

What os are you on? Also had the problem on win but only used a quick patch for it

eternal owl
#

linux

brazen charm
#

I don't know the cause for it not getting installed, and it didn't work for me because of some git path issue or something like that even when I forced the install, but for a temporary fix you can just patch the GIT_SHA value in constant to some string as it's not that important

eternal owl
#

i commented out all the use cases of GIT_SHA and looks like its working, thanks @brazen charm

sullen phoenix
vocal wolf
#

oh neat

#

ty

eternal owl
#

@crude gyro i fixed the bulk_update() on the site, it takes roughly 1-2 seconds to update 1000 users

#

less than a second after field filtering \o/

obsidian patio
#

The .snake video command doesn't seem to be working

#

This is the error I'm getting. I suppose you have something similar in the logs: ```
09/21/20 23:40:12 - bot.exts.evergreen.snakes._snakes_cog ERROR: Unhandled tag command error: Command raised an exception: TypeError: Invalid variable type: value should be str or int, got None of type <class 'NoneType'> (Invalid variable type: value should be str or int, got None of type <class 'NoneType'>)

#

@sullen phoenix everything should be fixed and ready to be merged now

sullen phoenix
#

just a few more things and you have my approval!

#

i'll be back in like an hour

obsidian patio
#

Alright, perfect. I'll have a look at it tomorrow. Time to sleep now 😄

crude gyro
#

@eternal owl

i get No module named 'git' error when running the website via docker, what am I missing?
you need to rebuild the docker container

#

docker-compose down and then docker-compose up --build will solve it.

#

this happens because we have added a dependency to the docker environment - the git apt package - and you built the docker containers back before we added this.

vocal wolf
#

.issue 796 bot

vocal wolf
#

@sharp timber Will you be taking this issue? I've heard that you had something written up for it before.

green mesa
#

I have one similar command at my bot for fetching the info

#

It gives list of the matching result

sharp timber
#

I did but it's not thorough, could be worth someone else taking a shot at it

green mesa
#

Can I😁

vocal wolf
#

Darn, I was going to ask if I could have it lol

green mesa
#

😅

vocal wolf
#

If you really want it, you can take it.

green mesa
#

Ty

vocal wolf
#

np

green mesa
#

This is the first issue of the pybot which feels like I can work on😁

#

Ok let me comment on this issue

#

Done commented

vocal wolf
#

I've assigned you.

green mesa
#

.issue 1149 bot

dusky shoreBOT
green mesa
#

I didn't understand what we have to do in this issue😅

vocal wolf
junior jewel
eternal owl
#

Once u got Ur Django project running, then go to the admin panel and then into "tokens"

#

U should find it there

tawdry vapor
#

The description says it's what's in the example below. That should be all you need to know

#

Well, maybe not if you're trying to legitimately host your own site

#

In which case you wouldn't want to be using the default key

#

So fair enough if that's the case

cold moon
#

@vocal wolf I haven't started work on it because this isn't approved yet

vocal wolf
#

I see

#

@green mesa halt working on the issue that I've pinged you in before until this issue is approved by the others.

green mesa
#

👍

junior jewel
#

In which case you wouldn't want to be using the default key
@tawdry vapor if i want to add some functionality to my own bot using the api, can i use the default?

tawdry vapor
#

If the API is exposed to the internet, then no, because that'd be insecure.

junior jewel
#

it'll be private

#

or can i get my own api key?

tawdry vapor
#

If it's private i.e. only on the local network then maybe it's fine but creating your own key would still be a good idea.

junior jewel
#

Ohh thats the django key, i thought it was something related to the Site's api, like the python bot relies on that api so yeahh.....

green mesa
#

@neon garnet can u plz click that magic button so wiki command can be added😁

neon garnet
#

I don't have merge perms iirc, gonna have to wait for an Admin

green mesa
#

😅

tawdry vapor
#

What do you mean? It is related to the site's API.

#

As the description stated, it's used to authenticate with the API

eternal owl
#

whats the reason behind using a config.yaml file and a .env file? can't use set the bot token and other env vars within the config file

#

im talking abou the bot repo

junior jewel
#

As the description stated, it's used to authenticate with the API
@tawdry vapor nvm, i confused myself alot, but i got it know :D

clever wraith
#

wait this channel is for python discord.py project discussion?

#

or just project discussion

short snow
#

contributing to the pydis projects

green mesa
#

virtualization need to be enabled in order to work with docker?

#

i am on windows 10 pro

green mesa
#

i wnt to get started with docker

#

for pybot

#

i never worked with docker

#

so i dont know what all i need to have

eternal owl
#

the guides page should have all the information

obsidian patio
#

Did you see my messages about the .snake video not working? I could open an issue about it

subtle kraken
#

It errors out

green mesa
#

Yeh open one issue

#

It's not working

subtle kraken
#

Issue like that is more of a thing to be written by core devs

#

Considering you can't access why it happens in the first place

brazen charm
#

Should be able to comment on an issue through sentry no?

subtle kraken
#

It isn't reported to sentry by the looks of it

#

Though I only looked at live logs of seasonal

#

Sentry doesn't look like it caught it

obsidian patio
#

Yep. Got an error when trying it on my local bot as well

#

I’ll open an issue?

subtle kraken
#

Most likely an api change

obsidian patio
#

Yeah. Seems like it. It gets no response

subtle kraken
#

If you wont open it within 3 or so hours, I will
If you know exactly why it happens, feel free

#

I doubt it will be a hard issue to be fair

obsidian patio
#

Yeah. I’ve got a lot to do, so I won’t be able to handle it right now, but I’ll open an issue now

obsidian patio
#

There we go

green mesa
#

who all merge pr?

#

admins?

short snow
#

yes the admins

#

and the pydis core devs i think

green oriole
#

Yup, admins and core devs

green mesa
#

akrays

#

plz look at my pr

#

2 checks i got passed

#

i wnt to work on other issues also

#

but i have worked on my master branch due to this its pulling all my previous commits

#

so if my this pr will get merged i can work on other issues also

green oriole
#

Yeah, sure

green mesa
#

ty

neon garnet
#

Cool!

#

I really need to start working on a new PR myself

green oriole
#

.wiki cpython

dusky shoreBOT
#

Enter number to choose

green oriole
#

1

dusky shoreBOT
#

CPython is the reference implementation of the Python programming language. Written in C and Python, CPython is the default and most widely used implementation of the language.
CPython can be defined as both an interpreter and a compiler as it compiles Python code into bytecod...

green oriole
#

@green mesa lemon_hyperpleased

eternal owl
#

nice

obsidian patio
#

@green mesa great work😄

green oriole
#

By the way @vocal wolf,i see that you have 3 commits named Replacing the round function with a format specifier. coming from a suggestion, github has a feature to allow you to batch apply suggestions by pressing the Add to batch button, it would be nice to use that for things like that lemon_pleased

green mesa
#

ty Akrays

green mesa
#

and my branching issue also fixed now 😄

green oriole
#

Nice

green mesa
#

😄

neon garnet
#

.issue 454

neon garnet
#

I might work on a toy implementation of this later today, just gotta handle a few things

green mesa
#

hopefully today i will make one more pr for partnerzodiac just making my commits atomic 😄

subtle kraken
#

just a headsup, not all emojis are grouped @neon garnet

short snow
#

also we can make a feature that says which server emojis are used how much,

green oriole
#

I think the issue is about listing the emojis in this server

short snow
#

ye corrected that

green mesa
#

noice

patent pivot
#

lol that would be fun

green mesa
#

make an issue for it

short snow
#

like you have graph there would a graph for that also

obsidian oxide
#

Hello, I’ve never contributed to open source before so I need a bit of guidance.
I’ve forked the repo and got the bot working on my server. Now I’m at the stage of contributing, is there a theme to the issues I can raise or would you suggest collaborating on an existing issue- how would I go about this if so

green mesa
obsidian patio
#

@obsidian oxide awesome to hear that you wanna contribute! I’d recommend having a look at the issue tracker of the bot in question. Maybe have a look at the issues with the “good first issue” tag

green oriole
#

Hey @obsidian oxide, welcome to our open source projects! Which bot did you get up and running, bot (@Python) or seasonalbot (@SeasonalBot) ?

obsidian oxide
#

seasonalbot

green oriole
#

Okay

#

Tell me if you are interested by any of those lemon_pleased

obsidian oxide
#

Yeah I took a look at those three, none seem to be recent and it’s not exactly clear what I’m supposed to do it seems harder than implementing my own feature but I’ll have a go at the minesweeper

green oriole
#

By looking at the issue, vivax suggested to rewrite the cog completely, is it okay for you?

#

It might be a bit much though, if you don't have any experience with discord bots

neon garnet
#

@subtle kraken Ye, I'm only aiming for the ones listed in #changelog

subtle kraken
#

Aight then

neon garnet
#

May I could add an uncategorized/animated categories as well

subtle kraken
#

To be fair we dont have all that many animated emojis sadly

obsidian oxide
#

Well I can try, yeah I have no experience but I’m willing to learn. Thanks everyone for your help, I’ll work on the minesweeper> It might be a bit much though, if you don't have any experience with discord bots
@green oriole

green oriole
#

Okay :)

#

Can you comment on the issue, so I can assign you?

obsidian oxide
#

Done

green oriole
#

Awesome!

#

The code is located in bot/exts/evergreen/minesweeper.py

obsidian oxide
#

Thanks

green oriole
#

If you have any issue, feel free to ask here lemon_pleased

obsidian oxide
#

Definitely, appreciate the help

eternal owl
#

here are some rough benchmarks of the API changes coming in https://github.com/python-discord/site/pull/378

Creating 1000 users(bulk).
0.39 seconds

Creating 10000 users(bulk).
3.14 seconds

Updating 1000 users all in 1 SQL query.
0.74 seconds

Updating 10000 users all in 1 SQL query.
14.67 seconds

Updating 10000 users by updating 1000 users in 1 SQL query.
7.12 seconds

Updating 10000 users by updating 2000 users in 1 SQL query.
6.78 seconds
#

@crude gyro

crude gyro
#

so my estimate of "probably under a second" wasn't actually that bad, huh?

eternal owl
#

yep :p

green mesa
#
error: failed to push some refs to 'github.com:Anubhav1603/seasonalbot.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.```
#

y this

#

when i do git pull

eternal owl
#

do a git pull

green mesa
#

it says upto date

eternal owl
#

git pull <repo> <branch>

#

example: git pull origin branch_name

green mesa
#
Fetching origin
Fetching upstream
PS C:\Users\HP\Desktop\seasonalbot> git pull
Already up to date.  ```
#
From https://github.com/python-discord/seasonalbot
 * branch            master     -> FETCH_HEAD
Already up to date.```
eternal owl
#

what does git pull origin partnerzodiac give

glass pecan
#

wouldn't you want to pull based on upstream, not origin

eternal owl
#

i guess we merge the master with our local branch?

#

when we click on update branch in the PR

green mesa
#

actually i have same name branch at master

#

now i have deleted

#

and now its fine

eternal owl
#

reviewing the partnerzodiac PR currently @green mesa

green mesa
#

ok

#

Akrays mistakly i requested again for review 😅 sorry

green oriole
#

No worries

green mesa
#

y pipenv take so much time to lock dependencies

green oriole
#

It sure does

green mesa
#

@eternal owl if i make datetime object then user has to give int value for month

#

i wnt to take string for matching month

#

looks like i can fix this issue

#

let me try

eternal owl
#

you can use calendar.month_name

#
import calendar
user_input: str = "October"
month_index: int = list(calendar.month_name).index(user_input)```
#

u can also use month abbreviations

#

@green mesa

green mesa
#

ok tnx

#

i am trying to do if user input month as int then also bot respond

#

and if it give str then also bot respond

eternal owl
#

cool

#

I also mentioned about merging zodic and date command

green mesa
#

yeh i have seen

eternal owl
#

so user can input the zodiac name or month/date

#

okay 👍

green mesa
#

yeh and with instance i can check wether it is str or int

obsidian patio
#

Just got a Server Error (500) on the site after logging in, navigating to the home page and clicking “request desktop site”, on iOS

green oriole
#

Right

green mesa
#

congo for helper role vest

green oriole
#

That’s because of AllAuth