#dev-contrib
1 messages · Page 62 of 1
I tried that as well as 3.8
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
Hmm, ok. I'm trying to redo the pipenv sync --dev and seeing if that'll fix anything
Sure
Okay. I'll try that ut
.cc decrypt 23 QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
wrong place?
is this a seasonalbot feature or something
I thought I'd be stronk enough but I guess not :(
stronk lol
It's indexing now. Looks good so far
Seems like it's all set up now 😄
Thanks a lot for the help
is this rot13
it's generic, so you specific the shift
pycharm just has too many darn ways to do things lol
courtesy of @neon garnet
Pog
remove the decrypt function and make the kids count
lol
"time to pull out the pencils boys and girls"
Is there any good way to run the project in PyCharm? I've been using pipenv run start in the terminal so far
that's fine to do both in term and pycharm
You can make that a run script through pycharm too
i personally prefer running my dockers though
How do you mean Akarys?
You see the run/stop at the top right of the- well this, you can make it run the project
Basically, you’d select shell command, press create new, and type pipenv run start as the shell command
You’re on a python config, you need a shell one
Alright
bleh i'll stick to compose
The start is just an alias so you can use a normal start config for it when the interpreter is set properly for pycharm
Yeah, but you also have to use an extension to load the dotenv
This is how it's looking right now
How do you mean that it would be set up? Can't find much of a good documentation or resources for it
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
There isn’t an actual command line option instead of a shell script?
Otherwise, I could probably just use a bash command there
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
Yeah. Have been using VSC
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
Yeah. Will probably be doing that quite soon
sad azure noises
@green mesa Does the .wiki command has a way of filtering out potentially R-18 pages?
I'll just use pipenv run start for now
@neon garnet pretty sure that was discussed already and we dropped it
Hmm
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 ^
@stable mountain and @dusky shore aren't hosted on linode?
they are
what does azure do here
azure is our CI
Also, Wikipedia doesn't have an actual tag about if the article is +18 or not
CI is like github actions/travis?
Yup
yes
azure devops is quite nice, but i decided to just switch to github actions
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
whats the reason we are using azure istead of github actions
I'm curious about if we sw- oh well, switch incoming!
because gh actions didn't exist when we setup azure
oh okay
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
oki
however, we do have actions used for other repos instead of azure
and actions do things on ones we do have azure on
I actually have a small list of reasons why actions is better than azure
can u list the reasons, just curious
- 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
what is codeQL
The plan is to switch to GitHub Actions eventually, yes
Newer repositories have it, as well as repositories that publish to PyPI
The github code analytics thing™️
We now have some experience with GH Actions, so that means we can start thinking about migrating everything
graphql, yes
I got the name wrong? Ah yes
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
I think we can currently do everything we want in GitHub Actions, so there's nothing major blocking us at the moment.
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
yeah i love actions purely for not leaving github mostly
I'd be interested in participating to the switch, I have a good experience with actions 
There are a few things that we're still looking into:
- What's the exact effect of
pull_request_targetinstead thepull_requestevent; 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
It's not really safe https://github.community/t/running-code-from-forks-with-pull-request-target/126688/3
Even it runs in the context of the base repository, people usually check out and test codes from the fork in pull request CI workflows. In this process, codes from the fork are executed. If we run actions/checkout with persist-credentials: true (which is by default) or pass t...
reading that, the malicious actor would have to be coming from origin, rather than fork, right?
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
oh its running secrets from our repo, not from theirs, if it's in a PR
So if any secrets are being passed to code that is checked out, there is an opportunity for it to be hijacked
What docstring format do we use for Seasonalbot?
human, just make sure the lint passes
Hahah. So anything?
just reference what exists for examples
simple docstring style, no arg listing or such
we do type annotations already
Why not? They're quite convenient for knowing what the arguments are actually for
"""
Summary here.
Optionally extra text after an empty line.
"""
There's no need for listing everything with typehints and no tools analyzing them
it's just redundant, yeah
A lot of args should be self explanatory with their names, like any other variable
yep
and yeah kwzrds on point there
probably should have directed you to that much earlier
the entire contributing guide is considered must-read
Yep. Didn't remember that part from when I was reading through it
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
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>
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
Well, the files should still be there, but untracked, right?
That's what I was expecting. They aren't, though
Your IDE should be able to revert that anyway
I have no clue how to do that with PyCharm. It's the first time I'm using it
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
I've tried that as well. Doesn't do anything
@sullen phoenix @nocturne hare
Here's your reminder: do the thing.
[Jump back to when you created the reminder](#dev-contrib message)
i did the thing
nice
Well, this is disturbing. Wasn't expecting everything to be that gone
I really hope the files are still there, somewhere, deep inside git
@neon garnet nope pure😅
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.
hahah yeah
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^
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
They are still there as a git glob, so in the worst case they are still recoverable
I usually make one backup branch after I messed my fork master😅
check the local history on the rot dir n pycharm, should be able to restore it with one click there
i did the thing
@nocturne hare what is the thing?
the thing he timed me to do
the thing
The thing lol😂
I think my command will get 1 more check pass soon floppy requesting for 2 change only 😁
@brazen charm How would that be done?
(Is this the right way? https://www.jetbrains.com/help/pycharm/local-history.html)
right click on the folder in the proejct view, the history button should be somewhere in the lower half
Aaah; found it
@brazen charm is revert what I use to go back to that version?
Or create patch?
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
Aah, alright
https://github.com/python-discord/site/pull/378
this PR needs some love please... 
@brazen charm You're a life saver (and a literal code saver). Thanks a lot!
closing unnecessary issues
Core dev went rogue on unit tests - the log
Alright
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
very nice work, @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
Yeh I am also learning unit test I will also try to make pr for that😁
Is there any chance we're gonna add unit tests in the future for @dusky shore ?
@crude gyro can i start working on this issue?
https://github.com/python-discord/bot/issues/1119
the site side PR is open currently
Also @green mesa, I started a review on your PR, feel free to ping me for new changes
Ty pure 🙂
@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.
assigned
thx
Can I get assigned to https://github.com/python-discord/site/issues/383 ?
Should be guides under static dir?
Or resources under app?
In the resources I'd say
Can we have many RedisCache per cog?
There's no restriction in the number of RedisCache instances per cog, no
Each will get a unique base namespace
That's interesting, so you base yourself on the attribute name to know which cache correspond to what?
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
That's pretty cool
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
Does site have any sort of caching? I want to load all guides to cache on startup and then use them in views.
@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
@subtle kraken I commented to issue
Assigned :+1:
Are # TODO:s and other code tags not allowed for @dusky shore? Seems like they don't pass linting
What does the linter say?
yes, that's correct, we don't allow TODO comments to be committed
Typically, when you PR in a new feature, it's reasonably done and should not have TODO comments in it
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
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
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
Is precommit preventing you from commiting?
I'd consider that pretty annoying, each commit doesn't have to be production ready
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
mmm yea
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
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
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.
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
Is there any way to cache all guides content and metadata on startup with Django?
@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
often it does, it's often the exception that it doesn't
sure I'm not trying to debate pre-commit
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
I just think it's fine to not use it if it feels restrictive and you clean up your history before it's published
Migrated one guide one part to Markdown for new system. How this looks like?
Okay
Is this better?
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
tbh i'd rather that meta info under the title in small discreet writing, similar to news article meta
yeah, I think I agree
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
This is my first time working with Bulma. I have used much Bootstrap, but never Bulma before
https://paste.pythondiscord.com/bilugefeha.sql This is how MD file looks like
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
I think yes, this is best solution
Yeah, that looks quite good
Now guides listing... and categories...
That's pretty annoying to use PyCharm Community when I used PyCharm Professional for a long time...
Oh bleh, I blew the tests
haha it happens
How do I even run them?
install dev deps with pipenv, run pipenv test
I do, it's failing out because it's not in docker, presumably
shouldn't. more likely missing envs
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
where? in CI or locally?
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
I was just going to start the whole thing up with -d
you need to run site
The bot tests should run fine on their own
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..
oh well, at least it's working now
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
if nobody else has worked on it, yep
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
if you need help with tests, i'd highly recommend asking ves
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
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
That should be fine
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
Does that mean you figured it out?
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
Why did you remove string.isascii() and string.isdigit()
It's still in there
it's int() now
@green mesa Are you still planning on doing this issue? https://github.com/python-discord/seasonalbot/issues/432
.issue 432
@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
Alright, just making sure.
👍
@neon garnet i have made changes according to what u said and pushed the changes, u can check my changes now 😄
@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.
yes just seen 😅
I'll be doing future reviews in chunks, make sure to check #dev-log for easier access 😄
ok 😄
Now only category view left
noice
changes made @neon garnet and pushed to github 😁
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
you could copy across the current guides
I can get you an export of all the markdown for them to simplify it for you
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
Is there a guide for getting started contributing to PyDis repositories for newbies?
There is guide on how all the setup works
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Cool, thanks.
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
Documentation for PyWeek.org. Contribute to pyweekorg/docs development by creating an account on GitHub.
ok
joe still same
i can see everyone pfp but not yours 😅
might be something messed up at my client side
lol
Am I allowed to add https://highlightjs.org/ to site to make syntax highlight working again in new system?
fine by me
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
Can anyone give opinion about https://hastebin.com/ohekuqicoy.http this guide about how to make a guide?
Also, we could use the short description as a description for the link embeds
How to do this?
html structure would need to be adjusted so discord can scrape short description I assume
It is a meta tag I think, but I never tried it
Yes, Open Graph meta properties. Googled it
OK, gonna add them now, then I will write unit tests, then push + PR
Sounds great 
I agree, sounds pretty nice
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
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
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.
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?
This is all in view, this use os.path.join to get paths
I'm making only response code checks
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
I have never done something like this before
We have some resources about unit testing here, maybe you should check them out first? https://github.com/python-discord/bot/blob/master/tests/README.md#additional-resources
i am working on source command can i hardcode thishttps://github.com/python-discord/seasonalbot/tree/master/
There isn't anything about HTML tests
And it's not good idea to do assertEqual for HTML
There's an assertHtml, or something similar iirc
I suppose that should be fine. You could put it in a separate file as well, like constants.py, to store them
There is some UI testing frameworks, maybe should we implement this somehow.
Currently nothing is using HTML tests on site
@green mesa you have copied the implementation of @stable mountain to @dusky shore, right ?
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
You can use django for that @cold moon https://docs.djangoproject.com/en/dev/topics/testing/tools/#django.test.SimpleTestCase.assertHTMLEqual
@green mesa well, it looks like you should be able to just copy paste the code from @stable mountain, why not start by that?
I would not hardcode that url, github has changed it in the past
It looks like you can make it work by changing only a few URLs/attribute names
broke a ton of my links at the time
Did it?
@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
Well I mean, if the code is that huge, there's a reason for it
i will write code and try with it
yeh make sense might be some reason
😅
actually i looked at pybot code first
Like they say, no needs to reinvent the wheel 
yeh
ok then all of my pr is ready as soon as one will get approved 2 will be pushed 😄
Yeah
Will I open issue for this?
Sure thing
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😁
There's already a pr for the help
@green mesa seems like there’s no need to open an issue for it
Can anybody have a look why https://github.com/ks129/site/blob/guides-app/pydis_site/apps/guides/tests/test_views.py#L49 and https://github.com/ks129/site/blob/guides-app/pydis_site/apps/guides/tests/test_views.py#L81 is failing?
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.
What is duckpond?
are you aware of starboards?
it's that, but using ducks and limited to staff channels
because that would be a mess
Yeh I agree
we use it because we ran out of pins
Hmm
Haha you say so many amazing things in the staff channels?
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
I do similar things on my server, with an "archived" channel that things you might want to look back on later go
Aah, yeah, that’s reasonable. I quite like the idea of having a ducky pond
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
The bot has to be ran as a module with -m, the setup is described in https://pythondiscord.com/pages/contributing/bot/
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
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
How do I check users deafen status using the discord.py?
@queen dawn I think #discord-bots can probably help you.
np
Any thoughts on adding a type checking command for @stable mountain through
snekboxandmypy? I might make an issue for both repositories later, just gonna ask for feedback first
small bump
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?
I think the mypy playground covers this better than the bot can
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.
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?
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
ok
<@&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.
heheh now wnt to become contributor fast UwU
@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.
@neon garnet i have addressed that thats y my last to last commit passed but when i commit suggestion
it fails
with same error
I assume they're committing changes within GitHub
Oh well, it is pretty easy to see
Right, you applied the suggestion and it made the linting fails
Well, now you can pull the code on your computer, fix the linting and push again 🙂
yeh i do that only
i have pulled the code from github
now fixing and pushing it again
Sounds about right
Wdym?
i meant i added Optional[List[str]] -> now its back to List[str]
this might be causing problem
and making liniting fail
Well, yes, because you’re still importing Optional but not using it
yeh now i added it again
Well, since you’re not using it, you need to get rid of the import
i am using it now
Why are you using it again?
Optional is saying it's going to return None or something. Your search will always return a list
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
Most of the time it's better to apply the suggestion from GitHub manually to make sure everything works
now u can check the changes @nocturne hare
How does one generally become a core developer? Are there any specific repos to contribute to and/or other specific requirements?
when u do some core contribute to site or main pydis bot
is this bug
i think if we ping the user also when bot denies to execute code in particular channel
then it will be nice
I believe joe removed all of his roles to check if that would work
Not really needed to be fair, most users who try it realize sooner or later
but joe has one role in ss
Core devs are staff that regularly contribute to the projects afaik
so we can become core dev if we contribute to one repo only
So, necessarily staff...? Do you know if it’s project specific?
i meant only to seasonal bot
Probably not, I'm if course not familiar with it but you probably get put in the org and have the same permissions everywhere
hmm
Yeah, true. If anyone has some more info about it, I’d love to hear
Theres description of the core dev role
https://pythondiscord.com/pages/roles/#pydis-core-developers
And you do have to be staff to be a core dev
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
What’s the reasoning behind restricting it to staff only?
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
Aah, alright. That makes sense
I’ve reviewed scrag’s PR using the new codespace thingy by github, I have to say, it was pretty awesome
Codespace?
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?
I like this😁
@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...?
There's a config file https://docs.github.com/en/github/developing-online-with-codespaces/configuring-codespaces-for-your-project
You can set up a default configuration for every new codespace for your repository to ensure that contributors have all the tools and settings they need in their online development environment.
Aah, alright. Maybe I’ll have to try out the beta. Seems promising
is it fine to use emojis in commit messages?
like a check mark
is it a good thing to use emojis in commit messages?
like these
Should I write tests for production guides validity?
Like checking is all required metadata exists
And categories have _info.yml file with required fields?
That'd be nice, yeah
I will do this as normal unit tests, just this relay on production data.
Don't wanna be a grammar nazi but you forgot to add a : after Description in the Moderators role tab
fixed
epic response time
@nocturne hare i have tested the code and its working 🙂
Great, I've approved iirc, so just get the rest who reviewed it to go over it real quick
Can you link your pr again, Just wanna go over it with a few concerns i just had
sure
.pr 430
y it took so time 
¯_(ツ)_/¯
Looks good, just wanted to make sure there weren't any exploits in making the bot mention people and etc
Someone has to press the magic button
i wish i could press 🙃
@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.
alright then 👍
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.
Fix 👏 bug 👏 and 👏 rewrite 👏 tests 👏 to 👏 reflect 👏 changes.
at work we often do emoji and a prefix instead of just emoji
like
🔨 Kaizen: Fix an incorrect type hint
but what if user do two things at once or more
don't do that. commits should be atomic
one change is one commit. that change can be big or small.
but not too big.
i have to change my habit 😅
If you want the term atomic explained, by Ves:
#dev-contrib message
tnx
good definition
Indeed
I've found that following that atomic commit structure has helped me better organize and complete projects without it getting haphazard.
ty
happy to.
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?
You sometime will have to have non-working versions
yeah, I just don't see the appeal of having emojis in commit messages
That said, it is probably me
It could definitely add a quick look at what it’s for
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
Without having to read "Add support for boolean expression" to know that it’s a feature (or is it a bug fix?)
I know what the commit is supposed to do, if that's what you mean
It adds support for boolean expressions
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?
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
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?
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.
Sublime Merge is pretty good too, I use it when I don't have Pycharm available
Hmm, alright. Thanks a lot for the help. Time to learn some more git!
Pycharm needs a little bit of help with chunking sometimes yea
Sublime merge is for sublime text ?
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)
i use vsc only 😅
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
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
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
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 )
You can do that with the command line as well, if you want
i use vsc terminal
But a GUI may help there
git add -i, select patch, select the file(s), and have a go
Yea I guess I have to use patch mode via terminal, but I think GUI will be clearer
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
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
I've never tried it; I always use the terminal for that
I've been very happy with gitkraken so far
Old habits
I'm more comfortable rebasing from the terminal, but the GUI is convenient for staging
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
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.
i am also learning django so i can also contribute to site UwU
I have no idea what I'm doing with the test.
![]()
?
.issue 1166 bot
Last line
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
It is called with_role
Ah, thanks!
Any time 
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
I think the decorator uses the with_role_check
I'll look that over again
At least within @stable mountain, https://github.com/python-discord/bot/blob/master/bot/decorators.py#L48
It does explicitly use the with_role_check()
Huh, that's strange that it's not the same in seasonal
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
Entirely up to you. If you're wanting to take the time to make it consistent across the two, I won't say no
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
I don't think you'll have too many bugs, just red everywhere
Time to open guides PR
Aaand we have touchdown. The new extensions command for @dusky shore should be good to go
.issue 449
thanks, i'll have a look
@crude gyro In how much time are you expecting the bulk patch/update to complete in? say for 1000 users in one request
Awesome😄
@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
okay then i need to refactor my code
@eternal owl Is this for the pagination PR?
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
metricity bulk upserts 2,500 at a time
@tough imp Mod utils tests PR fixed
metricity uses django orm?
thanks ks, going to look soon
metricity does not use Django ORM, no
@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
@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
Hmm.. it worked perfectly in my tests
interesting
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
hmm, i'll look into it
Alright, thanks. Just tell me if you change your mind
.issue 697 bot
@patent pivot Looking at this issue, do you know if the bot and site are hosted on the same machine?
they are, yes
ah
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
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
I'm new to contributing to @stable mountain. Where would I get started with finding connections to the site?
hmmm, well it's just a HTTP API, but the most important metric is the ping between the bot and the cloudflare IP
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 ishttp://web:8000
So I could just time the bot's http session doing a get request from that url.
should use the config value instead of hardcoding it https://github.com/python-discord/bot/blob/master/config-default.yml#L319
or make the request to site_api/bot
sick
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
What os are you on? Also had the problem on win but only used a quick patch for it
linux
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
i commented out all the use cases of GIT_SHA and looks like its working, thanks @brazen charm
seems like a good module for it @vocal wolf https://github.com/stellarbit/aioping
@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/
The .snake video command doesn't seem to be working
(Not on my test server or here. Check #sir-lancebot-playground )
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
Alright, perfect. I'll have a look at it tomorrow. Time to sleep now 😄
@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.
.issue 796 bot
@sharp timber Will you be taking this issue? I've heard that you had something written up for it before.
I have one similar command at my bot for fetching the info
It gives list of the matching result
I did but it's not thorough, could be worth someone else taking a shot at it
Can I😁
Darn, I was going to ask if I could have it lol
😅
If you really want it, you can take it.
Ty
np
This is the first issue of the pybot which feels like I can work on😁
Ok let me comment on this issue
Done commented
I've assigned you.
.issue 1149 bot
I didn't understand what we have to do in this issue😅
@cold moon Were you planning to do something with https://github.com/python-discord/bot/issues/796? Since it's been inactive for many months, I let @green mesa take it. I completely forgot to ask you, I am sorry for that.
Heyyy, what exactly is the bot api key in this
Once u got Ur Django project running, then go to the admin panel and then into "tokens"
U should find it there
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
@vocal wolf I haven't started work on it because this isn't approved yet
I see
@green mesa halt working on the issue that I've pinged you in before until this issue is approved by the others.
👍
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?
If the API is exposed to the internet, then no, because that'd be insecure.
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.
DRF describes how to do that https://www.django-rest-framework.org/api-guide/authentication/#using-django-managepy-command
Django, API, REST, Authentication
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.....
@neon garnet can u plz click that magic button so wiki command can be added😁
I don't have merge perms iirc, gonna have to wait for an Admin
😅
What do you mean? It is related to the site's API.
As the description stated, it's used to authenticate with the API
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
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
wait this channel is for python discord.py project discussion?
or just project discussion
contributing to the pydis projects
virtualization need to be enabled in order to work with docker?
i am on windows 10 pro
i wnt to get started with docker
for pybot
i never worked with docker
so i dont know what all i need to have
the guides page should have all the information
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
Did you see my messages about the .snake video not working? I could open an issue about it
It errors out
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
Should be able to comment on an issue through sentry no?
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
Most likely an api change
Yeah. Seems like it. It gets no response
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
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
There we go
Yup, admins and core devs
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
Yeah, sure
ty
.wiki cpython
1 CPython
2 IronPython
3 Python (programming language)
4 PyPy
5 Cython
6 Global interpreter lock
7 Reference implementation
8 YouTube
9 Jython
10 Resource acquisition is initialization
Enter number to choose
1
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 mesa 
nice
@green mesa great work😄
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 
ty Akrays
Nice
😄
.issue 454
I might work on a toy implementation of this later today, just gotta handle a few things
hopefully today i will make one more pr for partnerzodiac just making my commits atomic 😄
just a headsup, not all emojis are grouped @neon garnet
also we can make a feature that says which server emojis are used how much,
I think the issue is about listing the emojis in this server
ye corrected that
noice
lol that would be fun
make an issue for it
like you have graph there would a graph for that also
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
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
@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
Hey @obsidian oxide, welcome to our open source projects! Which bot did you get up and running, bot (@Python) or seasonalbot (@SeasonalBot) ?
seasonalbot
Okay
Like vest said, you should take a look at our good first issue https://github.com/python-discord/seasonalbot/issues?q=is%3Aopen+is%3Aissue+label%3A"good+first+issue"
Tell me if you are interested by any of those 
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
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
@subtle kraken Ye, I'm only aiming for the ones listed in #changelog
Aight then
May I could add an uncategorized/animated categories as well
To be fair we dont have all that many animated emojis sadly
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
Done
Thanks
If you have any issue, feel free to ask here 
Definitely, appreciate the help
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
so my estimate of "probably under a second" wasn't actually that bad, huh?
yep :p
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
do a git pull
it says upto date
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.```
what does git pull origin partnerzodiac give
wouldn't you want to pull based on upstream, not origin
i guess we merge the master with our local branch?
when we click on update branch in the PR
reviewing the partnerzodiac PR currently @green mesa
No worries
y pipenv take so much time to lock dependencies
It sure does
@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
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
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
yeh i have seen
yeh and with instance i can check wether it is str or int
Just got a Server Error (500) on the site after logging in, navigating to the home page and clicking “request desktop site”, on iOS
Right
congo for helper role vest
That’s because of AllAuth
