#black-formatter

1 messages ยท Page 19 of 1

little parrot
#

and undocumented

#

but it works fine for me :)

bright glacier
#

Alright, maybe I'll look into it then.

#

!remind 20H look into the viability of switching to poetry

late dewBOT
#
Sure thing!

Your reminder will arrive <t:1629661991:R>!

short forge
#

After a cursory google search i dont think poetry allows for custom build scripts

little parrot
#

its undocumented

plain atlas
#

1.2.0a2 is buggy enough I wouldn't recommend it for black

little parrot
#

its not on 1.2.0a2

#

im running 1.1.6 so id guess its on at least 1.1.0?

plain atlas
#

@bright glacier nvm I now have a rly buggy thing with isort

#

And IMHO isort is in the wrong here

#
from modmail.utils.threads.embeds import (
    format_close_embed_to_guild, format_close_embed_to_user, format_edited_message_embed_to_guild,
    format_edited_message_embed_to_user, format_generic_embed_to_guild, format_generic_embed_to_user,
    format_inital_embed_to_guild, format_inital_embed_to_user, format_message_embed_to_guild,
    format_message_embed_to_user,
)
#

vs

#
from modmail.utils.threads.embeds import (
    format_close_embed_to_guild,
    format_close_embed_to_user,
    format_edited_message_embed_to_guild,
    format_edited_message_embed_to_user,
    format_generic_embed_to_guild,
    format_generic_embed_to_user,
    format_inital_embed_to_guild,
    format_inital_embed_to_user,
    format_message_embed_to_guild,
    format_message_embed_to_user,
)
#

obviously one of those is superior

#

the first one /s

#

ah well, I guess I just need to turn them in to a class

little parrot
#
[tool.poetry.build]
script = "build.py"
generate-setup-file = false
```and you just add this to the pyproject.toml and build.py is just a normal python file where you can do whatever ie <https://gist.github.com/f5b1077b1ab30bcdf9ba70d95555a95f>
plain atlas
#

huh

flat krakenBOT
#

While this development environment / requirements situation is a mess,
let's at least make it consistent. We're effectively supporting two
modes of development in this project, 1) tox based dev commands
(e.g. tox -e fuzz) that are dead simple to use, and 2) manual dev
commands (e.g. pytest -n auto) that give more control and are usually
faster.

Right now the Pipfile.lock based development environment is incomplete
missing the test requirements specified in ./test_requirements.txt...

bright glacier
#

finally, that took way too long ๐Ÿ˜ฎโ€๐Ÿ’จ

plain atlas
#

why did 20+ workflows skip?

#

oh right because of the thing I mentioned earlier

bright glacier
#

Those ones are on the pull_request event.

plain atlas
#

they run on both push and pr

#

and since its internal

#

skip the pull request event

bright glacier
#

Not ideal since bugs caused from the merging of the base and branch won't be caught via CI, but that seems rare.

plain atlas
#

I mean

#

I just have it required on my project to have branches up to date with the main branch before merging

bright glacier
#

Given how much CI we already have, limiting it is important so it doesn't take forever.

plain atlas
#

yeah lol

#

heh

#

@bright glacier black is behind isort

bright glacier
#

Oh yea, we'll probably have to add another flag as an escape mechanism, TBH not too pleased with that since we already have too many but blocking root by default is still important.

plain atlas
#

yeah

#

why / is right next to . on a keyboard and someone decided to pick the other, idk

#

flake8 will run on root too lol

#

ofc flake8 won't change all files

#

hm

#

just for fun I ran black on my venv, with the check flag obviously

#

I'm curious if there's any files that black won't want to reformat in my venv

#

1823 files would be reformatted, 707 files would be left unchanged.

#

well that's actually a substantial part of my venv

#

about 1/3 of my venv is blackified

west snow
#

hi is there support for Python 3.10.0rc1 yet?

bright glacier
#

running on 3.10rc1: yes, formatting 3.10+ syntax: no (and involves rewriting substantial amounts of the core logic sadly)

plain atlas
#

meanwhile: sets line length to 1 and runs black

flat krakenBOT
#

we don't accidentally add backslashes to them when normalizing quotes
because that's invalid syntax!

The problem this commit fixes is that matches would eat too much
blocking important matches to occur. For example, here's one f-string
body:

{a}{b}{c}

I know there's no risk of introducing backslashes here, but the regex
already goes sideways with this. Throwing this example at regex101
I get:

{a}{b}{c}   # The As and Bs are the two matches, and the upper
---- ---...
late dewBOT
plain atlas
#

Lmfao

#

A piece of useless statistics: this pull request was implemented in full during intercontinental flights. There's something very tranquil about sitting in one place for 10+ hours with no distractions.

bright glacier
#

That honestly sounds pretty damn nice ^^

bright glacier
# late dew

Also, no I am not handling this today, don't feel like it.

#

!remind 3D maybe look into the viability of switching to poetry

plain atlas
late dewBOT
#
Bad argument

look is not a valid duration string.

#
Command Help

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

Commands for managing your reminders.

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

bright glacier
#

wut

plain atlas
#

lol

bright glacier
#

!remind new 3D "maybe look into the viability of switching to poetry"

late dewBOT
#
Bad argument

maybe look into the viability of switching to poetry is not a valid duration string.

#
Command Help

!remind new [mentions]... <expiration> <content>
Can also use: remind add, remind create

*Set yourself a simple reminder.

Expiration is parsed per: http://strftime.org/*

plain atlas
#

3d iirc

bright glacier
#

d'oh

#

!remind 3d maybe look into the viability of switching to poetry

late dewBOT
#
Bad argument

look is not a valid duration string.

#
Command Help

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

Commands for managing your reminders.

Subcommands:

!remind delete <id_>
Delete one of your active reminders.
!remind edit
Commands for modifying your current reminders.
!remind list
View a paginated embed of all reminders for your user.
!remind new [mentions]... <expiration> <content>
Set yourself a simple reminder.

plain atlas
#

i actually don't know then

bright glacier
#

nope.

#

!remind 72H maybe look into the viability of switching to poetry

late dewBOT
#
You're the boss!

Your reminder will arrive <t:1629926848:R>!

plain atlas
#

nice

plain atlas
bright glacier
#

Wow, 2017 -- that feels like such a long time ago!

plain atlas
#

and 3.10 is releasing soon ๐Ÿ‘€

bright glacier
#

PEP 563 was deferred tho

plain atlas
#

which includes these by defaults

#

oh right

bright glacier
#

No? Didn't the SC push the default activation of PEP 563 to 3.11?

plain atlas
# bright glacier No? Didn't the SC push the default activation of PEP 563 to 3.11?

wow, we used to have a py4 planned

Originally, PEP 563 was scheduled to take effect in Python 4, and this
changed recently (after the discussion in the Language Summit of 2020).
It's possible that third-party libraries and users didnโ€™t plan to react in
the current time frame as they were not aware of this change in timing.

bright glacier
#

haha, that's not happening anytime soon given how much of the churn budget 2 ->3 ate

plain atlas
#

yeah lol

#

also guido has officially said there's no plans and the change would be more like 1>2

#

because tbf, there's not much about the current python I would change

#

...except for the stupid classes that were ported from Java andUseCamelCase

bright glacier
#

CamalCase is pretty nice IMO

plain atlas
#

I meeeean its against pep 8, our lord and all-mighty

bright glacier
#

Wut?

plain atlas
#

oh, I mean the methods

#

oops

#

like

#

!d logging.getLogger

late dewBOT
#

logging.getLogger(name=None)```
Return a logger with the specified name or, if name is `None`, return a logger which is the root logger of the hierarchy. If specified, the name is typically a dot-separated hierarchical name like *โ€˜aโ€™*, *โ€˜a.bโ€™* or *โ€˜a.b.c.dโ€™*. Choice of these names is entirely up to the developer who is using logging.

All calls to this function with a given name return the same logger instance. This means that logger instances never need to be passed between different parts of an application.
bright glacier
#

Ok yeah that's not great

bright glacier
#

Heya @halcyon latch, I've been thinking about the mentorship thing w/ black. I got more questions on how it could work. The details are still very fuzzy (and I should bring it up with the rest of the core team but that's for later) but I think I have something that could be an outline.

So an event like this's TL;DR would be "a day where newcomers can come to get help getting ready to make their first dives into development in the context of a real-world FOSS project". To make it work I'll need a few things, 1) excellent beginner-friendly docs, 2) the right volunteers -- basically experienced, friendly people with an strong appreciation for the learning process :D, and 3) potential good-starter issues of basically "your first pr" style with varying levels of friendly writeups. And I can just reuse this text channel since it's pre-existing :)

FWIW I don't think the black project is quite ready for something like this, I'd like to improve the development workflows and contributing documentation in general, but that's just a matter of (me) putting in the work (since they've been thought through somewhat already) :p

Open questions include:

  • How should the intro docs be written like? What examples can I pull inspiration from?
  • How structured should the event be? -- like obviously it's all about the newcomers and helping them make their first waves into development, but I feel like having some structure could be helpful so the ones who aren't quite sure what they want to do still have options. But then again you've said the core of it for you was "you can come and we'll be here ready to ask questions" so maybe I'm just overthinking this :)
  • What other things should I know or change? I have never ever planned or ran an event remotely close of this nature and know almost nothing ๐Ÿ˜”
#

OH my that is one wall of text, apologies for that!

halcyon latch
#

SO! I've been thinking about this a bit as well as this is something enticing to me/us as a whole.

I'll totally trust your judgement on if black is ready or not. Something to keep in mind is that as a concept it can come across as fairly daunting. I think there are maybe some other projects we could convince to join in for this or even do a super easy trial run with our own stuff like lancebot/python.

I can happily create more channels for you under this category for this, even if it's just private to you and admins to slowly work out the details on this.

Intro Docs
So I'll probably have to defer to some more experienced doc writers but my thoughts are this:
There are a few different levels of intro docs: (1) Intro to contributing (aka what is git and how do I use it), (2) I'm shaky with git and I've never used it in a team, (3) I kinda know what I'm doing but how is this project structured? How do I contribute to this project specifically?

Those 3 levels can easily flow from one to another, but it might be worth having a few different resources available for those different levels. The first two I think PyDis actually has resources for, just from the code jam. The third is reliant on the project developers to create.

It should list the overall goal of the project, maybe some words about how the review cycle works, best practices for git messages, PRs, etc. How to communicate ideas for implementation, when to check in, that kind of stuff. Let me see if I can find some from the previous mentored contribution thing I did.

Event Structure
So this can depend. I've always found it helpful to have a kick-off event. Just so that there's a concrete start time that people know they can schedule around and be there for. It can you talking about this event, the resources available, and it can also be where you set the tone for the event. After that it can just... exist and be and people can float in and out.

Other things that come to mind would just be outreach and the like. Depending on who you want attending will change how early you want to start talking to other folks about this and getting their help with promoting it.

I also think it would be helpful to have a sort of wrap-up post or notes or something. Maybe include some stats/shoutouts/nice moments that happened. Something to finalize the event so it's not left in limbo. Provide gateways for further contribution and all that.

That's all that comes to mind currently. I can give it some more thought though now that I have the mental bandwidth.

#

@bright glacier ... sorry about that wall of text

plain atlas
#

lotsa walls here ๐Ÿ˜›

bright glacier
#

sorry, we're doing event hashing today

plain atlas
#

I can happily create more channels for you under this category for this, even if it's just private to you and admins to slowly work out the details on this.
TBF you might be able to create one channel and then use threads

plain atlas
halcyon latch
#

The issue there with a slowburn event planning channel is the thread autoarchive

plain atlas
#

7 days, tho

halcyon latch
#

Yeah, but with a slowburn event planning channel it can easily be two weeks before circling back to a specific topic

plain atlas
#

find it surprising that you wouldn't send any message in 7 days lol

#

inb4 gives ichard manage channel permissions for this category

bright glacier
#

Look, I'm running like 5 different mini-projects for the psf/black project, it is very possible I could go a week without touching a specific one

plain atlas
#

lol

#

didn't you previously figure out that it was either 7 or 12 i can't remember

#

๐Ÿ˜›

bright glacier
#

it's enough where I kinda go "whelp sorry but this one is going to spend some time on the backburner" pretty regularly so I don't burn out

plain atlas
#

i should do that on the features I'm working on rn

#

this is my git history of what I've been working on

halcyon latch
#

@bright glacier But I'm super happy to dedicate some time to this. The rest of the year is purposely chill event-wise to give some breathing room and this kind of mentorship/engagement event is my jam

bright glacier
#

I think there are maybe some other projects we could convince to join in for this or even do a super easy trial run with our own stuff like lancebot/python.
I was thinking of collaborating with other projects but I wasn't sure whether it would be feasible so I left it out for brevity. I guess as a starter, maybe reaching out to the projects that share members of our team (like's Jelle's mypy) would be a good idea. This would mean we should probably move the event to a separate dedicated channel.

So I'll probably have to defer to some more experienced doc writers but my thoughts are this:
Thankfully I'm the documentation lead for the project so this is like the one area I am totally not clueless :)

The first two I think PyDis actually has resources for, just from the code jam.
Wonderful! They'll probably need some tweaking but the core content sounds great!

It should list the overall goal of the project, maybe some words about how the review cycle works, best practices for git messages, PRs, etc. How to communicate ideas for implementation, when to check in, [...]
Love it! Other things that would be good to cover include the test suite and other checks PRs must pass, the various issue types we have and how they differ, an overview of the structure of the codebase, etc.

bright glacier
halcyon latch
#

I think providing some options for people to choose, but a limited amount would be beneficial to contribution.

bright glacier
#

RE. event structure: outreach ... since we're pretty new to this I feel this urge to keep the scale small so yeah. The people I'm trying to target are the ones who want to get their feet wet in development but don't quite know where to get started / how the cards of the trade work for the lack of a better term. So I'm not expecting too much as in sheer PR #count increases ^^

#

I think I prefer a general more relaxed vibe to the event, so there's no pressure (on all of us!), but including a well-defined start and end to the event sounds good. There is something to be said about good endings where even it's bittersweet, it's beautiful :D

flat krakenBOT
#

Run if [ "$RUNNER_OS" == "Windows" ]; then

if [ "$RUNNER_OS" == "Windows" ]; then
python.exe -m pip install black
python.exe -m black qlib -l 120 --check --diff
else
sudo python -m pip install black
python -m black qlib -l 120 --check --diff
fi
shell: /bin/bash --noprofile --norc -e -o pipefail {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.6.14/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.6.14/x64/lib
The directory '/home/runner...

bright glacier
#

what even ... I don't understand this issue at all, anyway moving back to on topic

plain atlas
#

same

#

I'm on windows, time to investigate

#

mostly because I think its very much a 3.6 bug

#

or

#

does black support 3.6?

bright glacier
#

OK, so to summarize the details we have so far:

  • We'll need varying levels of intro docs -- in particular the project-specific kind.
  • Structure-wise, a clear kickoff and finale would be ideal to set expectations and the tone / wrap the event in a pretty bowtie.
  • Outreach & promotion ... I'm just going to defer to the expertise, experience, and influence of PyDis for the time being.
  • We should look into collaborating with other projects so the people ready to contribute have options

Finally ... I think moving to a dedicated space for event planning is probably best since these words will end up buried from day-to-day psf/black development and discussion eventually.

#

I don't know why I didn't assume this would get buried but it's painfully obvious to me now

plain atlas
bright glacier
#

I also don't know if that's even the official action

#

the official action's main logic is in a Python script so the output they provided doesn't make any sense.

plain atlas
#

its not

#

since it shows a nice diff of all of their changes to the main repo, where it works, if it exists

bright glacier
#

So cool, they basically want us to debug their github actions workflow ... great! /s

plain atlas
#

ikr

#

this is my favorite part!

bright glacier
#

And honestly it sounds like a problem with pip and how they are using it

late dewBOT
#

.github/workflows/conda.yml line 15

os: [windows-latest, ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]```
plain atlas
#

that's my favorite line!

#

why are you testing on ubuntu-16.04

#

aaaaaa

#

although this does make me realise I probably need to start running my tests on windows... hm..

bright glacier
#

If I knew anything about conda I would be open (even if rather begrudgingly) to helping them out but I don't know anything about conda

plain atlas
#

just why

late dewBOT
#

.github/workflows/test.yml lines 33 to 34

sudo python -m pip install black
python -m black qlib -l 120 --check --diff```
plain atlas
#

I think this is the problem lol

bright glacier
#

WHY ARE THEY USING SUDO WITH PIP

plain atlas
#

also they need to set pip to not use a cache because pip is dumb

bright glacier
#

honestly I'd bet that using pip with sudo is the source of their problems

plain atlas
#

they sent that in their (poorly formatted) issue

The directory '/home/runner/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/runner/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
bright glacier
#

Oh nice, there's literally a line about sudo in there ^^

halcyon latch
plain atlas
#

darn, I want access to it... ๐Ÿ˜”

plain atlas
#

psf/black#2438 pithink

bright glacier
#

I sometimes wonder how they make connection that a failure to install black means it's black's problem

#

especially when the cache is at all

halcyon latch
#

@bright glacier channel made~ gave you some permissions that looked alright at first glance. Feel free to bug me if it needs to be adjusted

plain atlas
#

I commented on it

bright glacier
#

Alright perfect! Thank you! I'll go and figure out an intro (pun not intended :p) post so when the rest of the black / admin team comes by they hopefully aren't too confused

plain atlas
#

oh, huh. When did I get the contributor badge on the black repo

bright glacier
#

when you fixed an unnecessary backslash escape in some YAML file

plain atlas
#

yep, psf/black#2423

toxic stormBOT
plain atlas
#

how did you remember that ๐Ÿ‘€

halcyon latch
bright glacier
plain atlas
#

inb4 30 minutes sometimes

bright glacier
#

I mean, some folks were confused that there was a new bot so I assume not too long lol

halcyon latch
#

"Kat ... why are there 3 new channels in Event Planning"
"Don't worry! It'll make sense! Just uhhhh... hold on"

plain atlas
#

oh, 7.

#

jeez

halcyon latch
bright glacier
#

7 if you count the 3.10 bot that doesn't have access here if i'm not mistaken

plain atlas
#

]e heh

tall condorBOT
plain atlas
#

oof

#

bad bot

#

๐Ÿค”

#

why is 3.10 not allowed in #bot-commands?

bright glacier
#

in4b the bot says something mean to you

plain atlas
#

is it going to be shutdown soon enough to make that moot?

halcyon latch
#

It... is? It's a listed channel

plain atlas
#

no?

halcyon latch
#

OH HA. It's our test server bot commands

plain atlas
#

ah

#

that's the deleted channel

bright glacier
#

totally not confusing at a glance

halcyon latch
#

Scale set it up for me in our test server while I prepped for the event

bright glacier
plain atlas
#

lol

#

so uh, is it going to be added to #bot-commands or is it not going to be kept around long enough to matter?

halcyon latch
#

I'll ask scale about it when he's avail, but we already have two dedicated bot command channels for it

plain atlas
#

right, just thinking those seem like they're going to be removed soon since that category doesn't have an emoji

bright glacier
#

They'll probably stay up for a little bit after the video goes up on the PyDis channel causing the next wave of traffic to to the bot command channels.

plain atlas
#

true ig

#

ah well, time to work on using future annotations for my project

bright glacier
#

Weee thank you @dense jungle for the reviews ^^

#

I see you are trying to up your closed issue count tho ๐Ÿ˜

dense jungle
#

just my unread notifs count ๐Ÿ™‚

bright glacier
#

How was the land of too many boxes?

dense jungle
#

Mostly cleared up! Except that Ikea is apparently out of bookcases so I still have some boxes of books

bright glacier
#

Wait what ... heh, what how is IKEA out of bookcases ๐Ÿ‘€

plain atlas
#

they bought them all, somehow

bright glacier
#

I didn't know Jelle was an avid book collector ๐Ÿ‘€ * 2

#

It's great finishing up that last box though, marks the end of an adventure that is moving wayyyy too much cargo and realizing you own far too much *stuff*.

bright glacier
#

You sure do realize just how much stuff you own when packing up things ^^

dense jungle
#

I think this is why

bright glacier
dense jungle
#

we did throw a lot of things away too, but the new place is bigger ๐Ÿ™‚

bright glacier
#

How much time are we betting before every last storage nook and cranny is filled up?

bright glacier
#

yeah I'm just going to assume my internet is being dumb again

#

Actually I just tried on my phone and it works now ๐Ÿค”

#

I love how they call it "the great lumber crisis of 2021", y'know gotta make it super dramatic for 'em kids these days.

plain atlas
#

yeah, its like saying The Great Country of Britain

dense jungle
#

The OP seems to be having some... issues though

plain atlas
#

@bright glacier not sure if you're still there since you're typing

plain atlas
#

it was previously discussed in greater detail in this channel, as well

#

most notable/memorable against it was @glad pilot

#

clicks linked issue
well that was obvious

bright glacier
plain atlas
#

aha

bright glacier
#

I was typing here mostly because so I could reference things more easily.

plain atlas
#

yeah makes sense

#

aside: if you haven't sent it yet, I would send a message link in the event channel to the conversation had here so its easier to find later

bright glacier
#

oh I definitely added some links because I can't write up everything that was discussed since it's 11:55 over here

plain atlas
#

lol

#

hmm, was the docstring stuff reverted?

bright glacier
#

I don't think so but I'd probably would if it was up to me

plain atlas
#

Yeah, I would appreciate docstring stuff removed too

glad pilot
#

I'll respond to the ping by noting: yep, I don't think that Black ought to change the contents of string literals, because it has no way of knowing whether those changes will affect the program's behavior. Changes to trailing whitespace within string literals are syntactically significant.

plain atlas
dense jungle
#

Just noting that we do in fact change the contents of docstrings (but not other strings) right now

#

I believe it's mostly whitespace at the beginning/end of strings

plain atlas
#

Is there not a way to turn that off?

dense jungle
#

no

plain atlas
#

I find that as a bad thing

#

docstrings are another piece of ast that is changed

#

which IMO should not be

dense jungle
plain atlas
#

I read that.

#

hmmm

next oar
#

ai

lament crow
#

it can be if the program does something with the trailing whitespace

#

sure it's frowned upon but Black can't really assume anything there

#

Black is said to produce "a valid AST that is effectively equivalent to the original"

#

it is IMO one of its selling features

#

but ye, docstrings are currently exempt from that and Black cleans up leading and trailing whitespace of docstrings

glad pilot
#

!e ```py
class Foo:
""" X """

print("1", "2", "3", sep=Foo.doc)

late dewBOT
#

@glad pilot :white_check_mark: Your eval job has completed with return code 0.

1 X 2 X 3
glad pilot
#

Run that through black and then run it, and the output changes to 1X2X3 without any spaces.

bright glacier
#
--- test.py    2021-08-23 16:18:15.618015 +0000
+++ test.py    2021-08-23 16:18:19.539408 +0000
@@ -1,4 +1,5 @@
 class Foo:
-    """ X """
+    """X"""
+
 
 print("1", "2", "3", sep=Foo.__doc__)
glad pilot
#

Leading and trailing spaces inside string literals are obviously syntactically significant. Black today recognizes if a string literal is a docstring and if so chooses to modify it anyway, but that can change the behavior of a valid program, since docstrings are introspectable, @silent void

plain atlas
mint barn
#

no rights formatter

bright glacier
#

?

mint barn
#

its black

bright glacier
#

Yes black is the tool's name, but it has no relation to the race. It's used as a reference to a color and a quote from Henry Ford (which admittedly is apparently a pretty questionable figure doing some research)

mint barn
#

it was a joke

#

but the henry ford hting

#

pretty true

molten hare
#

"You can have any color you want"

mint barn
#

i mean

#

nvm

bright glacier
#

Well ford is famous for saying you can only have black

mint barn
#

too far

#

i know

molten hare
#

Also, would having the repo / contributing links pinned to the channel be helpful for others?

mint barn
#

and walt disney was anti semetic

glad pilot
#

!warn 863274087010533396 That joke was wildly inappropriate. In the future, if you know something is too far, you shouldn't say it.

late dewBOT
#

:incoming_envelope: :ok_hand: applied warning to @mint barn.

plain atlas
bright glacier
glad pilot
# plain atlas *are you going to delete them?*

We generally don't delete messages unless they violate the Discord terms of service. We can, but we prefer not to, since other people have responded and deleting messages makes it harder to follow what was said

molten hare
bright glacier
#

Thank you lemon_hyperpleased

molten hare
#

No worries! Figured it would save someone a few minutes of searching lol

plain atlas
#

granted given the current conversation I would repost it in an hour or so and pin it then lol

glad pilot
#

aight - if we want to pin that message, I can do some deleting to clean things up around the pinned message. @bright glacier want that?

plain atlas
#

I mean, the stuff above it is about how the ast is changed ๐Ÿ˜ 

bright glacier
#

I don't really care either way shrug

glad pilot
#

I'll leave it alone for now, then - feel free to reach out if you want something deleted.

bright glacier
#

Good to know, thanks!

heavy heron
#

Now I'm curious, why is black named black?

molten hare
#

Henry Ford quote regarding car paint colors

bright glacier
#

"you can have any colour you want as long it's black" -- I'm paraphrasing

plain atlas
storm rampart
bright glacier
#

Wait what, I can delete messages too ??? mind blown

plain atlas
#

can't you pin them?

#

if you can pin you can delete, they're the same permission

bright glacier
#

I thought deletion was a higher privilege operation

storm rampart
plain atlas
heavy heron
#

Ah yeah, I remember now

bright glacier
#

On GitHub, a lot of delete operations require more privileges compared to other things of a similar nature.

plain atlas
#

yeah

heavy heron
#

But discord

plain atlas
#

discord perms bad

#

embrace the slack

#

side note: discord devs use slack when discord breaks

storm rampart
#

Does Slack have a Bot API ๐Ÿค”

molten hare
#

Nah, Outlook email chains ๐Ÿ’ฏ

storm rampart
bright glacier
dense jungle
#

huh I can delete messages too. such power

plain atlas
molten hare
#

So to start with helping out at black, should I just try to get a development environment setup and then tackle a "good first issue" label?

gusty grail
bright glacier
molten hare
flat krakenBOT
bright glacier
#

I'm very nervous and unsure how we could do this safely

heavy heron
#

is black supposed to do that? If I read the issue correctly, you'd go from a an erroring state to a non erroring one, meaning black would have changed the actual code, not just the format

bright glacier
#

Ah yeah that's not great either

#

I just skimmed the issue and immediately went "that sounds hard to do safely"

flat krakenBOT
#

The fix for #1688 in #1761 breaks help("modules") introspection and also leads to unhappy results when inadvertently importing blackd from python. E.g.:

$ python
Python 3.8.10 | packaged by conda-forge | (default, May 11 2021, 07:01:05) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help('modules')

Please wait a moment while I gather a list of all available modules...

aiohttp dependency is not installed: No module named ...
flat krakenBOT
flat krakenBOT
flat krakenBOT
#

Commented strings are currently realigned and repositioned.

Original:

# Matches:
#   li>*:first-child:before -> li
#   li:first-child>*:first-child:before -> li:first-child
#   *:before -> *
SELECTORS_TO_RETARGET = re.compile(
    r"(" +                         # Return this (as \1)...
    r"[^\:\>\s]+" +                # Anything before a pseudo (:), child (>) or descendant ( )
    r"(:first-child)?" +           # Include :first-child in the match if it's there
 ...
bright glacier
#

:O Zsolt was active on the repository

dense jungle
#

if you mention blackd it summons him ๐Ÿ˜„

silver sluice
#

whaaat is this

bright glacier
plain atlas
#

Hi

plain atlas
bright glacier
#

Aren't they already in the topic?

plain atlas
#

Remember yesterday?

bright glacier
#

Yeah and what so about it?

plain atlas
#

ยฏ\_(ใƒ„)_/ยฏ

bright glacier
#

Didn't I do that yesterday?

plain atlas
#

No.

#

You didn't actually pin the message lol

bright glacier
#

Fine.

molten hare
#

Nice!

plain atlas
#

Yay

flat krakenBOT
flat krakenBOT
#

Describe the bug
The issue with my code is I forgot to have a method to handle the route.
However black formatter is telling me it cannot parse what is otherwise valid code in a misleading / unexpected place.

Is this the default behavior of black or am I doing something wrong / having the wrong expectations?

To Reproduce
Run black on the following code snippet.

import json
from flask import Flask, render_template

app = Flask(__name__)

@app.route("/", meth...
flat krakenBOT
pure sable
#

are you all black devs? :o

flat krakenBOT
flat krakenBOT
#

Describe the bug

If I have a string that is slightly too long for my column limit (usually 100 characters), then often I can make it fit by surrounding it in brackets and moving it into its own line:

LONG_TEXT = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."

# Becomes

LONG_TEXT = (
    "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."
)

Black will undo this formatting.
...

molten hare
#

I'm still trying to wrap my head around how black works, so I can hopefully contribute some. Any recommendations?

plain atlas
#

IIRC

#

Which is going to need a huge internal rewrite

molten hare
#

Oh damn. Where should I try to learn more about the "behind the scenes" for the project?

teal goblet
#

What about 3.10 doesn't work?

little parrot
#

match cases

plain atlas
#

Match and typing iirc

#

Lemme find the issue

little parrot
#

typing?

#

like the union operator?

#

that works fine

plain atlas
#

psf/black#2318

toxic stormBOT
dense jungle
#

match and parenthesized with are the only issues I believe. There is no new typing syntax in 3.10

plain atlas
#

There is.

dense jungle
#

though black may format the | in weird ways, it won't crash

plain atlas
#

Yeah that syntax

dense jungle
#

That is not new syntax

plain atlas
#

Is technically new

#

Given where its used, it is new

dense jungle
#

nope, pre-3.10 Python will parse it fine, it just used to not work at runtime

teal goblet
#

Technically, str | type(None) works :p

plain atlas
#

Wild

plain atlas
dense jungle
#

The parser will accept it. You can use it in type annotations with from __future__ import annotations too

teal goblet
#

not at runtime, but pycharm doesn't complain

plain atlas
#

In my experience at least

teal goblet
#

will from __future__ import annotations mess up libraries that rely on annotations like pydantic?

#

I know it has a function update_forward_refs()

dense jungle
#

@mint barn It won't work in places where the code is executed at runtime, like type aliases. It definitely does work in annotations.

plain atlas
#

Which are Type aliases?

dense jungle
#

@teal goblet It does make life harder for pydantic and friends. That's part of why turning on the feature by default was deferred from 3.10

plain atlas
#

I think that's a different thing?

dense jungle
#

@mint barn MyType = str | None def f(x: MyType) -> None: ...

plain atlas
#

!pep 563

late dewBOT
#
**PEP 563 - Postponed Evaluation of Annotations**
Status

Accepted

Python-Version

3.7

Created

08-Sep-2017

Type

Standards Track

plain atlas
#

But the union operator and such are different

dense jungle
#

Yes, from __future__ import annotations

plain atlas
#

Then there's stringify everything

dense jungle
#

With that feature on, type annotations aren't executed at runtime, so the union or operator won't throw a runtime error

mint barn
#

LMFAO

#

its fine

dense jungle
#

Oops, sorry ๐Ÿ™‚

plain atlas
uncut patio
#

@plain atlasyou can also just do ```py
a = 54
b = 6
c: a | b

plain atlas
#

But only in 3.10?

dense jungle
#

No, in any version that supports from __future__ import annotations (so 3.7+)

bright glacier
#

!eval

import sys

print(sys.version_info)
a = 54
b = 6
c: a | b
print(__annotations__)
late dewBOT
#

@bright glacier :white_check_mark: Your eval job has completed with return code 0.

001 | sys.version_info(major=3, minor=9, micro=6, releaselevel='final', serial=0)
002 | {'c': 54}
bright glacier
#

Looks like GitHub either changed the styling while I was sleeping or while I was eating breakfast cause wow things look a lot harsher and grayer ._.

plain atlas
#

There's three themes :)

#

Make sure you're on the theme you want

plain atlas
#

You may, have switched to the gray theme, which is the one I use

bright glacier
#

I'm on default light.

plain atlas
#

Oh rats.

bright glacier
#

I'm mildly annoyed that I can't find the OS option to have it automatically switch between light and dark mode so all of my websites can auto pick that up.

#

I'd prefer light mode most of the time but dark mode is well nice at night :)

plain atlas
#

It's in settings somewhere

bright glacier
#

I'm on Ubuntu, it's probably a command line options isn't it :/

#

after some quick searching I think I might have a way to make it automatic, but why does it involve extensions and maybe an apt install here or there, it's literally ubuntu, one of the Linux distros for less techy people I'd've thought this would be less involved

bright glacier
runic hearth
#

oh a project

#

what's it about?

#

can I get a description of some kind?

molten hare
bright glacier
#

Basically psf/black is one of those autoformatters that are quite popular these days.

short forge
#

quite popular

#

laughs in used by 74k projects

runic hearth
#

damn cool

bright glacier
#

I mean, yeah it's impressive but it does mean the decisions we make affect a lot of people ๐Ÿ˜…

late dewBOT
dense jungle
flat krakenBOT
#

Describe the bug

I cannot use black-jupyter in my precommit list

To Reproduce

I have the following .pre-commit-config.yaml :

default_language_version:
    python: python3

repos:
-   repo: https://github.com/psf/black
    rev: 21.7b0
    hooks:
    -   id: black
    -   id: black-jupyter

the precommit hook fails with the following error message :

[ERROR] black-jupyter is not present in repository https://github.com/psf/black. Typo? Perhap...

heavy heron
#

@steel steppe please don't post rickrolls in random channels

dense jungle
#

The release slipped for a while, @neon loom shall we just cut a release today?

neon loom
#

I'm down

dense jungle
#

Before it's too late for 2021.8

bright glacier
#

Am I missing something or what's so particular about having an release in August ๐Ÿ˜…

#

Sorry @dense jungle I forgot to tell you that some of the new crashes need ESP to reproduce

#

Cooper's post above contains the list of the three files needing ESP to crash

#

IIRC it was test_base64, test_xml_etree, and test_tokenize

#

for me, test_tokenize actually never finished formatting even giving it a solid 8 minutes

#

I can only reproduce the crash if I set the recursion limit a bit lower from my default of 1000

dense jungle
#

Oh right, should have thought of that

fleet depot
#

aside from line length, where can I find a list of config options

bright glacier
#

by passing the --help flag ^^

fleet depot
#

๐Ÿ˜ฎ

#

look at genius me poring over their docs and google

tidal lark
potent viper
#

yikes

bright glacier
#

Also, I just tried adding tests for the backport so unparentheized assignment expressions are allowed in slices indices, set literals & comprehensions. It hasn't gone very smoothly to say the least since parametrization is a pain with both pytest' and parameterized' implementation due to our mix of unittest and pytest style test cases.

#

Wait what, PEP 563 (Postponed Evaluation of Annotations) still stops people from using syntactically invalid expressions, TIL.

dense jungle
bright glacier
#

Ah yea that makes sense. Should've realized that ^^

flat krakenBOT
#

Description

Implementation stolen from PR davidhalter/parso#162. Thanks parso!

I could add support for these newer syntactical constructs in the target version detection logic, but until I get diff-shades up and running I don't feel very comfortable adding the code.

Checklist - did you ...

  • [x] Add a CHANGELOG entry if necessary?
  • [x] Add / update tests if necessary?
  • [x] Add new / update outdated documentation? -- not applicable
bright glacier
#

looks like my spell checker failed me :(

#

or I forgot to run it :p

sonic tundra
#

!warn 860652150929883136 Can you not post rickrolls in this channel please. You were warned earlier today.

late dewBOT
#

:incoming_envelope: :ok_hand: applied warning to @steel steppe.

flat krakenBOT
bright glacier
#

Hmm I wonder if that's feasible with the current design of EmptyLineTracker (or whatever the class is called)

#

I'm sure hacks could be added, just curious if they would be necessary or not ^^

#

Heya, I'd appreciate quick look over for this PR: psf/black#2416. After that I don't have anything I want to add to the release.

toxic stormBOT
dense jungle
#

and maybe follow up later on how to improve the thing with the version in the docs

tribal thistle
flat krakenBOT
#

Currently

conda create --name test python==3.7.10 (just to have fresh environment of python 3.7 for showcase (not a conda issue)
conda activate test
pip install black==20.8b1

fails with

Collecting black==20.8b1
  Using cached black-20.8b1.tar.gz (1.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python ...
tiny rock
#

Hi! I made this issue 2 months ago: https://github.com/psf/black/issues/2370
This is about blank lines between functions docstring and body.
It didn't get a lot of responses, but I still think this is a cause of inconsistency.
What's your opinion about it ?

GitHub

Describe the style change Currently, black does not check blank lines between functions docstring and body. That means both these options are valid: def foo(): """docstri...

flat krakenBOT
#

Description

The setuptools-scm dependency in setup.cfg did not have a version specified, leading to the issues described in #2499 after a faulty release of setuptools-scm was published.
To avoid this issue in the future, the last version before that faulty update is now pinned.

Checklist - did you ...

  • [x] Add a CHANGELOG entry if necessary?
  • [x] Add / update tests if necessary? -> Not needed
  • [x] Add new / update outdated documentation? -> Not needed
    ...
flat krakenBOT
#
$ black .                                          
[1]    25245 segmentation fault  black .
$  pip install regex==2021.8.21
Collecting regex==2021.8.21
  Using cached regex-2021.8.21-cp38-cp38-macosx_10_9_x86_64.whl (285 kB)
Installing collected packages: regex
  Attempting uninstall: regex
    Found existing installation: regex 2021.8.27
    Uninstalling regex-2021.8.27:
      Successfully uninstalled regex-2021.8.27
Successfully installed regex-2021.8.21
$  black .         ...
#

Describe the bug

Using exclude with a regex causes a segfault

To Reproduce

$ .tox/format_style/bin/black --check -v --exclude "foo/[^/]+/baar" .
[1]    97566 segmentation fault  .tox/format_style/bin/black --check -v --exclude "foo/[^/]+/baar" .

The issue is caused by https://bitbucket.org/mrabarnett/mrab-regex/issues/421/2021827-results-in-fatal-python-error
And get's fixed by forcing an older version of the package like regex==2021.8.21

No action to do ...

dense jungle
#

seems like a bad day for our dependencies

#

summary: a new release of regex made black segfault for some users; a new release of setuptools-scm made black uninstallable for some

flat krakenBOT
#

Is your feature request related to a problem? Please describe.
It's simple, quite similar to the formatter of PyCharm. Would like black to break the strings into parts when the max length if the line max length is exceeded.

A clear and concise description of what the problem is.
None precisely? But well say if this is my string:

a = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

Here maximum...

neon loom
#

I donโ€™t want to release with the pins personally - Iโ€™m a pinning is the end users testing job IMO โ€ฆ but agree there is benefits both ways

#

Im also not looking forward to mypyc set fault issues

#

*seg

molten hare
#

I'm still reading through the code and docs to wrap my head around how everything works, is most of the heavy lifting done in black/src/black/_init_.py?

I guess the "critical path" is:
main() -> reformat_code() -> format_stdin_to_stdout() -> format_file_contents() -> format_str() -> transform_line() -> run_transformer()

Or maybe I'm going a bit cross-eyed trying to read through and build understanding

dense jungle
#

If I understand correctly there's no way for a user to fix this

#

If it was a runtime dependency they could just pin the version of that dep themselves, but not for install-time deps

#

Correct me if I'm wrong though

stuck vapor
#

Seems like it's fine now that the setuptools_scm release has been yanked?

dense jungle
#

That's true, this could happen again though

tawny bluff
#

Good Evening, one small question, How can i configure black to not add extra , in last always? I mean this

bright glacier
#

I'm personally a bit wary of pinning setuptools-scm

#

I'd at least prefer it to be pinned in pyproject.toml

tawny bluff
bright glacier
#

Also, wow last night was a fire wasn't it ๐Ÿ”ฅ

bright glacier
dense jungle
bright glacier
#

doesn't run_transformer also handle right hand side splitting?

dense jungle
bright glacier
#

Oh wow primer got rekted by the borked regex release

bright glacier
flat krakenBOT
bright glacier
#

Should we temporarily pin the dependencies troubles issues?

dense jungle
#

The setuptools one should be resolved since they yanked the bad release, right?

bright glacier
#

Yup

#

How's the status on the regex one?

dense jungle
bright glacier
#

whelp :/

lament crow
#

asking because there is a flag for skipping magic trailing comma handling which would not change this style but it would make it so that this extra , doesn't prevent black from shortening it in the future if it can

bright glacier
#

Hmm, looks like the latest release of regex has been yanked as like with setuptools-scm?

tawny bluff
bright glacier
#

the trailing comma is not used for the magic trailing comma feature, but also as a way to reduce diff noise FWIW

#

I don't know how important that is, but that is one of the selling points Black uses so yea

plain atlas
plain atlas
#

@bright glacier ffs. 2021.8.28 has been released

plain atlas
#

it feels like regex is not handled that well

bright glacier
#

Well it's definitely worse than how setuptools-scm handled their fire but it's good enough

#

I just wished the yanking happened earlier

#

I mean yeah I understand why you'd like a reproducer but I think preventing further harm via yanking is more important first

plain atlas
#

weed

bright glacier
#

Hmm, now since the version of black is untied to the value of - uses: psf/black@whatever should we still promote pinning?

plain atlas
#

wdym?

bright glacier
#

So there's this PR I want to resolve: psf/black#1574

toxic stormBOT
bright glacier
#

And it adds a comment suggesting to change the stable value for a tag

#

BUT since then the action allows configuration of what version of black is used

#

so now the action version != black version

#

my question is that should we still suggest pinning the action version (that just happens to be linked to black's versions because we host the action in the same repo - I know it's not the best idea don't @ me)

plain atlas
#

I don't have enough knowledge on this, after reading this lol

Black uses CalVer not SemVer, so a full version tag may be best.

bright glacier
#

My main concern is that if we suggest pinning people may assume that's also the version of black it'll use -- which is not true!

#

Hm, does anyone remember why setuptools-scm is defined both in pyproject.toml PLUS setup.cfg?

#

I guess technically it does help the people who 1) aren't using build isolation, 2) aren't using PEP 517 builds, and 3) want to use a setuptools-scm version older than 42.0, but like that seems like a tiny minority.

charred forge
#

So, @bright glacier
My problem is:
I downloaded the black module and then opened the Powershell in the folder that my Python file was in and then I typed in "black characters.py", and then it gave me an error.

bright glacier
#

What is that error?

#

I need to know the error message so I can figure out whether it's an installation issue, an issue with black, or something else.

charred forge
# bright glacier What is that error?
black: The term 'black' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
bright glacier
#

Ah sounds like an issue with your PATH.

plain atlas
#

you need to add black to your PATH

#

yep

bright glacier
#

an alternative is use python -m black

#

Basically whatever the python command you regularly use and installed to (eg. python, python3, python3.9, etc.) + -m black

#

instead of relying on the python scripts to be added during the pip install, you're asking Python to search the package via the normal lookup process and run the package.

charred forge
plain atlas
#

well, given that its windows, its a bit complicated, so first try what ichard suggested, and see if what they said above works

bright glacier
#

yeah also if you mess it up system executables can end up shadowed which well .. isn't great to say the least ๐Ÿ˜…

plain atlas
#

I cleaned my path yesterday

#

had 1800+ characters in it

#

and apparently there's a 2047 or 4095 character limit on some windows versions

bright glacier
#
>>> len(os.environ["PATH"])
225
plain atlas
#

its now 1400 which is a lot happier

bright glacier
#

"only" 1400 chars :p

plain atlas
#

whups, 1587

#

I deleted a bunch of duplicated paths from it

charred forge
plain atlas
#

how did you install black?

#

or: what command did you run to install black on windows?

#

@bright glacier The irony of E501

#

# noqa: E501

#

tests/modmail/utils/addons/test_sources.py:59:111: E501 line too long (113 > 110 characters)

#

yeesh, this is happening in my tests

#
@pytest.mark.parametrize("entry, user, repo, plugin, reflike, githost",
    [("onerandomusername/addons planet", "onerandomusername", "addons", "planet", None, "github"),
    ("github onerandomusername/addons planet @master", "onerandomusername", "addons", "planet", "master", "github"),
    ("gitlab onerandomusername/repo planet @v1.0.2", "onerandomusername", "repo", "planet", "v1.0.2", "gitlab"),
    ("github onerandomusername/repo planet @master", "onerandomusername", "repo", "planet", "master", "github"),
    ("gitlab onerandomusername/repo planet @main", "onerandomusername", "repo", "planet", "main", "gitlab"),
    ("https://github.com/onerandomusername/repo planet", "onerandomusername", "repo", "planet", None, "github"),
    ("https://gitlab.com/onerandomusername/repo planet" , "onerandomusername", "repo", "planet", None, "gitlab"),
    ]
)
#

black makes that so much longer

#
@pytest.mark.parametrize(
    "entry, user, repo, plugin, reflike, githost",
    [
        ("onerandomusername/addons planet", "onerandomusername", "addons", "planet", None, "github"),
        (
            "github onerandomusername/addons planet @master",
            "onerandomusername",
            "addons",
            "planet",
            "master",
            "github",
        ),
        (
            "gitlab onerandomusername/repo planet @v1.0.2",
            "onerandomusername",
            "repo",
            "planet",
            "v1.0.2",
            "gitlab",
        ),
        (
            "github onerandomusername/repo planet @master",
            "onerandomusername",
            "repo",
            "planet",
            "master",
            "github",
        ),
        (
            "gitlab onerandomusername/repo planet @main",
            "onerandomusername",
            "repo",
            "planet",
            "main",
            "gitlab",
        ),
        (
            "https://github.com/onerandomusername/repo planet",
            "onerandomusername",
            "repo",
            "planet",
            None,
            "github",
        ),
        (
            "https://gitlab.com/onerandomusername/repo planet",
            "onerandomusername",
            "repo",
            "planet",
            None,
            "gitlab",
        ),
    ],
)
charred forge
plain atlas
#

hm, pip --version and then send the output of that command here.

bright glacier
#

I was going to say use where python and where pip but that works too

#

It's where right, or is it which on windows?

plain atlas
charred forge
short forge
#

Get-Command

plain atlas
#

and also python --version?

short forge
#

is PS7 equivalent of where

plain atlas
short forge
#

uh, which isnt a thing in ps i dont think

plain atlas
#

it is

#

its aliased

#

lemme double check I didn't put that in my profile

#

oop

#

yep I aliased that

charred forge
plain atlas
#

python -m pip install black && python -m black should get a working black installed then

#

I tend to not run pip directly since that can sometimes be for a different python

charred forge
plain atlas
#

no, you can run it wherever

charred forge
#

But do I have to run it in Powershell or CMD?

charred forge
plain atlas
#

interesting

#

I uh, I'm out of most options at this point

bright glacier
#

Is the installation even working correctly?

charred forge
bright glacier
#

oh did the installation error out?

charred forge
bright glacier
#

but installing packages as administrator sounds unnecessary since you usually do user installations of python on windows

charred forge
#

When I check black in cmd, it says:

No Path provided. Nothing to do
plain atlas
#

well, that's good

charred forge
#

?

#

(Man, how am I gonna keep my code organized now?)

plain atlas
#

honestly, I'd install pipx and install black with that

#

hmmm

bright glacier
#

you need to pass a filepath or directory to black

plain atlas
#

what's your full dev tool chain

bright glacier
#

it won't ever run automatically in the CWD because that's too unsafe

plain atlas
plain atlas
#

black . --diff which works on the CWD

bright glacier
#

I'd recommend the black . --diff --color option first

#

just so you can see what it'll do first before actually touching your files

plain atlas
#

ehhh, color may not work on CMD

bright glacier
#

well we use colorama for that reason but I guess it can still go wrong even with that?

plain atlas
#

yep!

#

cmd is like, the least support of all support

charred forge
bright glacier
#

Oh does the current directory have any python files?

charred forge
bright glacier
#

Well black operates on python files (so it can reformat 'em) so yea..

charred forge
charred forge
plain atlas
#

lol

#

I use

  • powershell with a custom profile and starship
  • pyenv for windows
  • pipx
  • black
#

in that specific order

charred forge
plain atlas
#

nice

plain atlas
#

but highly recommend pipx for certain dev tools

bright glacier
#

pipx is amazing

#

I used to use this setup where my Python installation wasn't on PATH nor in a standard location and then I'd would manually symlink the scripts when adding a new global python tool but pipx does it way better ^^

plain atlas
#

that sounds... cursed

bright glacier
#

TL;DR the python command is symlinked to /opt/python3.8.5/bin/python3 which isn't on PATH

plain atlas
#

ah

bright glacier
#

via update-alternatives of course

plain atlas
#

you built python from source..?

bright glacier
#

yes sir-e

plain atlas
#

i did that

#

once

#

now i use pyenv

#

so installing a new python is super easy

bright glacier
#
drwxr-xr-x   - root     root     21 Dec  2020 python3.6.0
drwxr-xr-x   - root     root     26 Oct  2020 python3.6.12
drwxr-xr-x   - root     root     16 Sep  2020 python3.7.8
drwxr-xr-x   - ichard26 ichard26  9 Sep  2020 python3.8.5
drwxr-xr-x   - root     root     26 Sep  2020 python3.9.0b1
drwxr-xr-x   - root     root     24 Dec  2020 python3.9.1
drwxr-xr-x   - ichard26 ichard26  9 May 12:06 python3.9.5
drwxr-xr-x   - ichard26 ichard26  9 May 12:16 python3.9.5-support
#

these are my python installations

#

yeah I know the permission setup is dumb but oh well

plain atlas
#
>>> pyenv versions
  system
  3.10.0rc1
  3.7.11
* 3.8.11 (set by /home/aru/discord-modmail/modmail/.python-version)
* 3.9.6 (set by /home/aru/discord-modmail/modmail/.python-version)
#

those are mine

#

pyenv >>> building from source

plain atlas
bright glacier
#

Yeah, sometimes I need to test out stuff on 3.6.0

plain atlas
#

and not 3.6.12??

bright glacier
#

3.6.X was painful in terms of the typing changes

#

also why not, they aren't that big anyway

plain atlas
#

you should use pyenv

bright glacier
#

Maybe one day

plain atlas
#

mostly because you could write a quick and dirty script to install all python versions ever ๐Ÿ˜›

#

!paste

late dewBOT
#

Pasting large amounts of code

If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

bright glacier
#

how would that work on linux?

#

does it build from source or use the system package repos?

plain atlas
plain atlas
plain atlas
#

the one for windows downloads installers from the python.org website and installs them

lament crow
plain atlas
#

it is, yeah

bright glacier
#

!remind 16H figure out more details on that thing y'all been discussing

late dewBOT
#
I'll allow it.

Your reminder will arrive on <t:1630178536:F>!

plain atlas
#

!pypi that

late dewBOT
bright glacier
#

that's not what I was reminding myself about but sure

plain atlas
#

hehe

bright glacier
#

I don't want to share any details of this tho

plain atlas
#

its either poetry, pyenv, or the event stuff

#

๐Ÿ™‚

bright glacier
#

let's just leave it at "we may or may not be planning events"

plain atlas
#

you do realise you could probably set the reminder in that channel then lol

#

although I presume you did it here intentionally

bright glacier
#

oh yeah cause I'm a partner

#

whoops oh well

plain atlas
#

yep!

#

I can't use this channel even

tired shard
#

psf/black#2360 Any updates on this? I had a working fix for this, so wanted to know

toxic stormBOT
errant barn
silent apex
#

^ isn't that just because of blank lines between import groups?

bright glacier
#

@dense jungle what is even going on, the case of you and I writing at the same time (although you type out a response faster than me :p) in reply to the same issue happened again

dense jungle
bright glacier
#

IDK, I just started going through my GitHub notifications. Moments before I looked over the PRs you merged haha

late dewBOT
#

src/black/__init__.py line 51

from black.parsing import InvalidInput  # noqa F401```
dense jungle
#

we should make a release for real today

dense jungle
bright glacier
#

ah yeah

dense jungle
#

let me run on our codebase just to make sure there's no regressions

bright glacier
#

I should've thought of that, I literally contributed code to the black playground that used black.InvalidInput ๐Ÿ˜…

nocturne hill
#

do we need this suppression thing!?

#

it 's just a waste of time

bright glacier
#

Context?

#

And if you're referencing the name. Yes black is the tool's name, but it has no relation to the race. It's used as a reference to a color and a quote from Henry Ford (which admittedly is apparently a pretty questionable figure doing some research)

bright glacier
#

Is it worth pinning setuptools-scm?

dense jungle
bright glacier
#

Alright, I'll get it merged then.

#

I wouldn't mind driving the release process for this one, looks like our resident BRMFN aka Cooper is a bit busy :p

plain atlas
#

gurd darn it

dense jungle
#

sounds good! the run on our codebase completed and found no problems

bright glacier
#

whew lemon_hyperpleased

plain atlas
bright glacier
#

Oh, I don't have permissions to write to the setuptools-scm PR's branch :(

plain atlas
#

how not

bright glacier
#
1โฏ git push -u https://github.com/FabianNiehaus/black.git FabianNiehaus/main
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 2 threads
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 700 bytes | 700.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (3/3), completed with 3 local objects.
To https://github.com/FabianNiehaus/black.git
 ! [remote rejected] FabianNiehaus/main -> FabianNiehaus/main (permission denied)
error: failed to push some refs to 'https://github.com/FabianNiehaus/black.git'
plain atlas
#

ah its a fork

#

wait so that's how you do ti

#

THANKS

#

ergh

#

why did they use main

bright glacier
#

not sure, but oh well I'll just comment what I'd like to see changed even tho I literally have a commit ready locally :/

plain atlas
#

heh, fork their repo and make a pull request

neon loom
#

Im homeless but can do a release if we want

plain atlas
neon loom
#

Happy for others to do it even more so ๐Ÿ™‚

#

Got my accept stamp ready

plain atlas
#

And seems like you have some other stuff going on right now.... take care of your self regardless

neon loom
#

Just fires approaching my home so Iโ€™ve left and gone to a friends. Itโ€™s fine. Only a house. Can always get another.

plain atlas
#

smh

neon loom
#

Price of living in the Woods. @bright glacier - Hola if you need anything or want me to cut the PR for release. I have some time until 16:00 pacific today.

bright glacier
#

wait a sec, I can just open a new PR and then credit the original author so I don't have to wait for them ugh why did that take so long to cross my mind

plain atlas
dense jungle
neon loom
#

Ya ya, that's the winner. I'm in Oakland. So sorry to have the smoke follow me.

#

I'm not "technically" homeless yet ...

#

It's still there

dense jungle
#

so close! I just moved to Orinda

neon loom
#

O nice. I'm going to Walnut Creek tonight to see mates.

#

Funnily enough Tahoe looks a lot clearer today but still AQI of ~200

bright glacier
#

Uh that's horrible, never lived on the west side so I've been disconnected from this disaster ๐Ÿ˜”

neon loom
#

Seems the new norm in California

bright glacier
#

Yeah sadly enough, seems to be getting more common for BC over here too :(

plain atlas
#

lmao

Image updated every minute if Cooper's Internet is Up!

#

well that's a disappointing way to find out if it goes down

flat krakenBOT
#

Description

The setuptools-scm dependency in setup.cfg did not have a version specified, leading to the issues described in #2449 after a faulty release of setuptools-scm was published. To avoid this issue in the future, the last version before that faulty update is now pinned.

richard's tweaks and comments:

Mostly since it's non-build-backend specific configuration and more
widely standardized file. Not sure what benefits pinning in setup.cfg
gives us on top of pyproje...

late dewBOT
neon loom
plain atlas
#

what are your specs?

bright glacier
#

I suppose this is what happens when I'm from Canada, but I'm looking at the temperatures here and the 30C+ I'm seeing is scaring me from going outside by a little bit :p Explains the heat warning tho!

neon loom
plain atlas
#

your server running your website

bright glacier
#

this guy has multiple websites :)

plain atlas
#

lmao

This server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials (e.g., bad password), or your browser doesn't understand how to supply the credentials required.
Lovely error message, about the browser being dumb

neon loom
plain atlas
#

ah

neon loom
#

I want my house bandwidth for me - Only got shitty 40mbit up

#

940/40 cable

bright glacier
#

oh lovely it just occurred to me that we planned to add a warning when formatting python 2 code.

#

we can push that off for 21.9b0 tho

plain atlas
#

what kind of warning?

dense jungle
#

stop using Python 2 already

#

something like that

plain atlas
#

a warning that support will be dropped or that python 2 should be dead but its your fault it isn't?

dense jungle
#

in more polite terms

bright glacier
#

"WARNING: black will drop support formatting for Python 2 $insert-date / $insert-in-X-releases"

plain atlas
#

ah

plain atlas
neon loom
#

"Why do you hate yourself enough to be dealing with python 2 still?"

plain atlas
#

oh god

#

imagine finding a person with python1 still

bright glacier
#

"your business planned for this, right?"

plain atlas
#

the earliest that pyenv will install is 2.4

#

oh btw, I've been wondering. Why does a lot of stuff support 2.7 or exactly 3.5.3 ?

#

what was so bad with 3.0 to 3.5.2??

bright glacier
#

I wouldn't be surprised if they brought back compatibility shims in the bugfix versions. I don't actually know though, so don't quote me on this.

plain atlas
#

lol

#

side note: i just wrote 66 tests

neon loom
#

Before 3.5 python2 was faster than 3.X - 3.5 was the first real usable 3.X release

#

In many ways

plain atlas
#

aha

bright glacier
#

crap, I forgot to run prettier before commiting

plain atlas
#

...

plain atlas
bright glacier
#

huh?

plain atlas
#

why do you not use black to format black itself??

bright glacier
#

@stuck vapor whelp good job, you just saved me from a dumb mistake already :D

Check pre-commit rev in example..........................................Failed
- hook id: check-pre-commit-rev-in-example
- exit code: 1

Please set the rev in ``source_version_control.md`` to be the latest one.
Expected 21.8b0, got 21.7b0.
plain atlas
#

sorry, that was a but too abrasive

bright glacier
#

We use prettier for formatting everything else other than python code

#

like Markdown

plain atlas
#

ohhhhh

#

huh nice

stuck vapor
plain atlas
#

lol

bright glacier
#

all right pre-commit run -a passed, hopefully there isn't another problem

plain atlas
#

hm, what is action.yml?

bright glacier
#

other than my ability to type apparently

bright glacier
plain atlas
#

ah

flat krakenBOT
#

Description

Hopefully my first release doesn't end up in flames :fire:

Checklist - did you ...

  • [x] Add a CHANGELOG entry if necessary? I thought the release was the NEWS itself, no?
  • [x] Add / update tests if necessary? Who needs tests when you got Quora's codebase?
  • [x] Add new / update outdated documentation? No one reads them anyway, there's no point.
bright glacier
#
  • Add a CHANGELOG entry if necessary? I thought the release was the NEWS itself, no?
  • Add / update tests if necessary? Who needs tests when you got Quora's codebase?
  • Add new / update outdated documentation? No one reads them anyway, there's no point.
#

Got a bit sassy in the release PR :p

plain atlas
#

๐Ÿ˜• about quora

bright glacier
plain atlas
#

lmao

#

...open source quora?

bright glacier
#

Remember that Jelle works at Quora?

late dewBOT
#

docs/usage_and_configuration/the_basics.md line 176

black, version 21.5b0```
bright glacier
#

oh yeah I should add a check for that lol

plain atlas
#

except to be fair I'm a fan of non-existant versions on bug reports or related stuff

bright glacier
#

Jelle is going to be very annoyed or disappointed with me ๐Ÿ˜ฐ .

plain atlas
#

that way when a person reports a bug, its obvious if they used the version already there or found their version

bright glacier
#

people don't like it when they can't control-C + control-P so yeah.. about that

plain atlas
#

why are they control p-ing?

#

its ctrl-v to paste

#

why are they printing the black docs

#

~yes i know it was a typo~~ ๐Ÿ˜›

bright glacier
#

Look, I'm driving a release at the same time, give me a break /hj.

plain atlas
#

~`if you're driving you should focus on the road~~

#

...i'll be back in a few moments when i don't want to respond with a snappy answer to everything

plain atlas
#

ok.

neon loom
plain atlas
#

or make it a fake version ๐Ÿ˜›

neon loom
#

Yeah

plain atlas
#

21.7b1

#

or something

bright glacier
#

Wait what Jelle is going to be very disappointed with me.

โฏ black --version
black, version 21.5b2

I thought my local user install of black was up to date ๐Ÿ˜ฅ

plain atlas
#

smh

#

pipx upgrade

bright glacier
#

I'm doing that right now.

plain atlas
#

i actually didn't know your black was pipx installed

bright glacier
#

I thought I had told you I moved to pipx yesterday?

plain atlas
#

okay I did some researching

plain atlas
elder tusk
bright glacier
#

heck even typing's constant changes were an issue in 3.6.X

plain atlas
#

gosh darn it

#

so fast

flat krakenBOT
plain atlas
#

thonk

lament crow
#

The magic trailing comma handling is not supported in isort

#

Everything else is

#

Best to just use the black profile

mint barn
#

How does black compare to VSCode?

gilded mauve
#

It doesn't. VSCode is an editor and black is a code formatter

#

But you can use one in the other lemon_hyperpleased

plain atlas
#

The black profile is just configuring other isort values

#

Ohhh wait. Okay, yeah.

lament crow
#

I'm talking about magic trailing comma specifically

plain atlas
#

Yea

lament crow
#

isort will put it in one line if it meets the line length limit while Black respects the existing trailing comma

#

causes a bit of churn in git diffs

plain atlas
#

Right

#

Hmmmm, how does the github action work

#

Thinking of switching to the action given that if it reports errors as annotations that would be nice

bright glacier
#

What kind of errors?

lament crow
#

annotations don't support multi-line

plain atlas
lament crow
#

well, the GH Actions annotations that is

bright glacier
#

How would annotations be much better than just the coloured diff?

plain atlas
#

And printing the lines to the format which github expects for annotations

lament crow
#

I think the API does support the mutiline annotations

plain atlas
#

They show up when you view the commits, I can find one that shows some flake8 annotations soon

bright glacier
#

Yea, but it's a linter so it's better suited to annotations

#

black doesn't operate on this formatting violations -> fix them model

#

it just formats the file to whatever the logic makes it

lament crow
#

auto-fixing GH Action or app is probably better than annotations when it comes to code formatters

plain atlas
#

To get flake8 we pass flake8 a special format string for output, so when it outputs like that we can view it in the pr order

#

True

#

That'd be nice, ofc with an option to have it on or not.

bright glacier
#

Would 30 GitHub annotations all saying "this line / block of lines doesn't follow black's style" really be useful?

#

One per problematic file, OK, I can see the value in that, but that's simple enough to not really require first-party support.

lament crow
#

but annotations are going to be more clunky than just having the action comment with a diff or having you manually go to the logs

plain atlas
#

Tbf that would be more useful big time

lament crow
#

this is a GH App feature so not something for black maintainers to do though

bright glacier
#

I'm already hesitant to add a JUnit XML report mode to black and atleast that has some value, even if it's of limited value

lament crow
#

3rd-party app could easily be made if one wanted it

#

but there's probably not enough demand if there isn't one already lol

bright glacier
plain atlas
#

True

#

I can't exactly use that right now tho

#

It can't use local hooks ๐Ÿ˜”

#

(Yes I know how to get around that I just don't want to rn)

#

Well actually

#

I'm using it on one project right now, since I didn't feel the need to have a work flow, and because it only needs to lint, everything else about the repo is seperate, kind of a monorepo, if you will

bright glacier
#

I can't use it on black either unfortunately for that reason but oh well

plain atlas
#

So

plain atlas
bright glacier
#

kinda kills the value by still requiring gha to run the local hooks imo :/

plain atlas
#

true...

flat krakenBOT
plain atlas
#

ooooo

bright glacier
#

Weird failure re. fuzz on 3.10-dev

plain atlas
#

๐Ÿ‘€

bright glacier
#
Traceback (most recent call last):
  File "/home/runner/work/black/black/fuzz.py", line 10, in <module>
    import hypothesmith
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/hypothesmith/__init__.py", line 3, in <module>
    from hypothesmith.cst import from_node
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/hypothesmith/cst.py", line 18, in <module>
    import libcst
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/libcst/__init__.py", line 7, in <module>
    from libcst._exceptions import MetadataException, ParserSyntaxError
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/libcst/_exceptions.py", line 9, in <module>
    from typing_extensions import final
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/typing_extensions.py", line 2390, in <module>
    class _ConcatenateGenericAlias(list):
  File "/home/runner/work/black/black/.tox/fuzz/lib/python3.10/site-packages/typing_extensions.py", line 2394, in _ConcatenateGenericAlias
    __class__ = _GenericAlias
NameError: name '_GenericAlias' is not defined
plain atlas
#

hmmm

little parrot
#

thats already been reported

#

they are currently working on a fix

bright glacier
#

ah OK, I'm not actually too worried about it since everything else passes anyway including 3.6-3.9 fuzz

little parrot
#

wait 3.10

bright glacier
#

huh?

little parrot
#

3.10 should have Concatenate

#

i thought the error only happened in 3.6

#

thats odd

bright glacier
#

cc @dense jungle know what's up here?

little parrot
#

thats the issue for this

dense jungle
#

Maybe pin out typing-extensions 3.10.0.1 for now

little parrot
#

i must have misread

dense jungle
#

Hopefully we'll be able to release a fixed typing-extensions soon

#

Or maybe I should yank the release

#

then again 3.10 is unreleased so maybe it's not worth it to yank

bright glacier
#

Is the impact widespread on 3.10-dev? In that case, pinning on black seems like a drop in the bucket

dense jungle
#

I think it breaks everything uses typing-extension in 3.10

bright glacier
#

ah I see it was recently released

little parrot
#

whys the class defined for 3.10?

dense jungle
#

honestly I haven't really looked into what's going on

#

the fact that typing's CI was still on Travis and it just stopped working completely isn't helping

bright glacier
#

Yeah I saw that issue, looks like someone made a PR?

dense jungle
#

it needs some work

#

well looks like I'm not powerful enough to yank typing-extensions releases anyway

#

I can yank Black releases though

bright glacier
#

I can't :p

#

I guess excluding 3.10.0.1 would be good for now

plain atlas
#

you can make a release, but not yank it

dense jungle
#

don't worry I'll yank all of @bright glacier 's releases