Thursday, 2023-12-28

JayFsean-k-mooney[m]: https://review.opendev.org/q/topic:%22codespell%22+repo:openstack/ironic-python-agent talent borrows; genius steals :P (seriously; thanks for doing that in nova; hadn't seen the tool before and it looks awesome, going to see if Ironic community agrees)18:44
sean-k-mooney[m]givven how much time i spend respining my code for typos it felt worth my time to try out a few of the options and codespell seams to be one the nicer solutions. i wanted something that was pure python, i.e. had not deps on programs on your system, and that was designed for code i.e. was designed to reduce false positives18:52
sean-k-mooney[m]JayF:  i was kind of surprised at the number of issues found in nova 18:53
sean-k-mooney[m]the fact it automatically has suggestions for converting uk to us english is also really useful18:54
JayFHonestly I'd consider that a downside, not an upside TBH.18:55
JayFAny correct spelling  being accepted would be better than it enforcing a specific regional standard18:55
sean-k-mooney[m]you can disable that but our offcial docs policy for openstack say we use us english18:56
JayFbut I personally don't care *which* standard18:56
sean-k-mooney[m]its just an additoanl correction dictionary18:56
JayFthat's fair, but I care more about not running someone away with CI churn than I do if a pydoc has an extra u18:57
sean-k-mooney[m]https://github.com/codespell-project/codespell/blob/master/codespell_lib/data/dictionary_en-GB_to_en-US.txt18:57
JayFyeah, my MVP in IPA is super simple, just invoking with the smallest correction list possible18:59
JayFnot sure if that's the right path or not, but bluntly, don't wanna invest that much time in a PoC that I made without talking to anyone else ironic-y18:59
JayFI'm mildly tempted to do a similar POC with black/ruff/autopep8 or a similar tool18:59
sean-k-mooney[m]we use autopep819:01
sean-k-mooney[m]we talked about black but so far its a hard no form some so not pushing that at the moment19:01
sean-k-mooney[m]we are currently trying to move as much of this to precommit wih optional tox targets for those that dont wnt to use precommit19:02
sean-k-mooney[m]ruff is very interesting although i dont know if its packaged widely19:02
sean-k-mooney[m]usign pre-commit to run flake8 has similar effect in that it only checks the files you changed19:03
sean-k-mooney[m]so it gives a nice speedup althogh im sure its still slower the ruff19:03
sean-k-mooney[m]the main problem with ruff would be hacking i.e. hacking checks would still need to be run elsewhere or ported19:04
JayFthe only reason I'm considering autopep8 at all is Nova's use of it19:06
JayFyep, that's basically the #1 primary reason why ruff makes me :( 19:06
JayFruff has some neat features around autoupgrading and dropping old python compat code19:07
JayFI think it could have some real utility in OpenStack if we could bridge that gap, but I do think it's a bit early in the lifecycle compared to most tools we'd pick up19:08
sean-k-mooney[m]JayF:  i proposed using pyupgrade for that for nova19:10
sean-k-mooney[m]but people were kind of uncomfortable with that being used automtically19:10
sean-k-mooney[m]so i abandoned the serise19:11
JayFpyupgrade is nasty for a handful of reasons19:11
JayFruff is better designed but just younger19:11
JayFpyupgrade only running on a per-file basis is really strange19:11
JayFlet me put it this way: pyupgrade is written in an extremely opinionated way, and CI-style tooling like that with strong opinions I find offputting, as opposed to things with knobs you can turn to make them work in different ways/environments/runners/etc19:12
sean-k-mooney[m]pyupgarde is using the python ast and validating that the upgraded line has the same behavior19:12
JayFyou're already on pre-commit, so that probably was easily glossed over :)19:12
sean-k-mooney[m]welll the way we have been trating this is if the linters would change the code then you reject the patch in ci19:13
sean-k-mooney[m]and provide a way to run that same check locally before its submitted19:13
JayFsean-k-mooney[m]: yeah, my complaints are mostly about the interface/style than they are about the technical aspects of it. It's a useful tool; but I'd never trust it in a CI environment or anywhere that a human would not review it afterwards19:13
sean-k-mooney[m]with pre-commit or tox or both19:13
sean-k-mooney[m]ya same we generally have a policy of nothing other than a huma should modify the code19:14
sean-k-mooney[m]i.e. it not modifed after its reviewed before its submited19:14
sean-k-mooney[m]anyway hopefully the ironic comunitiy will find codespell useful too19:16
sean-k-mooney[m]JayF:  on a different note, while im off im catching up on some python confernce videos ectra. i have been thinking about replaceing eventlet and lookign at https://anyio.readthedocs.io/en/stable/ as a possible lib to use if we are to prot off of eventlet19:18
JayFI'm going to be completely honest and transparent with you: I'm maybe one of the worst folks to have this conversation with.19:18
JayFI don't have a good mind for this style of programming or a lot of background on it, it's part of why I pulled in the big brains with that knowledge from GR-OSS to help with that stuff19:19
JayFbut I will say please lets pick the most vanilla basic implementation that 90% of everyone else is using, asyncio, trio, something like that, not another weirdo thing that someone will have to rescue next decade LOL19:19
sean-k-mooney[m]well the thing is i dont really want most people to start writing low level asyncio or threaded code19:19
sean-k-mooney[m]right so anyio provides trios api over trio or vanila ayncio19:20
sean-k-mooney[m]trio and asyncio are not directly comtible. anyio give you taskgroups and cancelation_scopes(timeouts) form trio but on plain asyncio19:21
sean-k-mooney[m]its also supports py38+19:21
sean-k-mooney[m]so while 3.11 has taskgroups anyio gives them to you on 3.819:22
sean-k-mooney[m]anyway im going to go cooks something and chill for the evening o/19:24
JayFo/ have a good one19:25

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!