JayF | sean-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 positives | 18: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 useful | 18:54 |
JayF | Honestly I'd consider that a downside, not an upside TBH. | 18:55 |
JayF | Any correct spelling being accepted would be better than it enforcing a specific regional standard | 18:55 |
sean-k-mooney[m] | you can disable that but our offcial docs policy for openstack say we use us english | 18:56 |
JayF | but I personally don't care *which* standard | 18:56 |
sean-k-mooney[m] | its just an additoanl correction dictionary | 18:56 |
JayF | that's fair, but I care more about not running someone away with CI churn than I do if a pydoc has an extra u | 18:57 |
sean-k-mooney[m] | https://github.com/codespell-project/codespell/blob/master/codespell_lib/data/dictionary_en-GB_to_en-US.txt | 18:57 |
JayF | yeah, my MVP in IPA is super simple, just invoking with the smallest correction list possible | 18:59 |
JayF | not 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-y | 18:59 |
JayF | I'm mildly tempted to do a similar POC with black/ruff/autopep8 or a similar tool | 18:59 |
sean-k-mooney[m] | we use autopep8 | 19:01 |
sean-k-mooney[m] | we talked about black but so far its a hard no form some so not pushing that at the moment | 19: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 precommit | 19:02 |
sean-k-mooney[m] | ruff is very interesting although i dont know if its packaged widely | 19:02 |
sean-k-mooney[m] | usign pre-commit to run flake8 has similar effect in that it only checks the files you changed | 19:03 |
sean-k-mooney[m] | so it gives a nice speedup althogh im sure its still slower the ruff | 19: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 ported | 19:04 |
JayF | the only reason I'm considering autopep8 at all is Nova's use of it | 19:06 |
JayF | yep, that's basically the #1 primary reason why ruff makes me :( | 19:06 |
JayF | ruff has some neat features around autoupgrading and dropping old python compat code | 19:07 |
JayF | I 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 up | 19:08 |
sean-k-mooney[m] | JayF: i proposed using pyupgrade for that for nova | 19:10 |
sean-k-mooney[m] | but people were kind of uncomfortable with that being used automtically | 19:10 |
sean-k-mooney[m] | so i abandoned the serise | 19:11 |
JayF | pyupgrade is nasty for a handful of reasons | 19:11 |
JayF | ruff is better designed but just younger | 19:11 |
JayF | pyupgrade only running on a per-file basis is really strange | 19:11 |
JayF | let 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/etc | 19:12 |
sean-k-mooney[m] | pyupgarde is using the python ast and validating that the upgraded line has the same behavior | 19:12 |
JayF | you'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 ci | 19:13 |
sean-k-mooney[m] | and provide a way to run that same check locally before its submitted | 19:13 |
JayF | sean-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 afterwards | 19:13 |
sean-k-mooney[m] | with pre-commit or tox or both | 19:13 |
sean-k-mooney[m] | ya same we generally have a policy of nothing other than a huma should modify the code | 19:14 |
sean-k-mooney[m] | i.e. it not modifed after its reviewed before its submited | 19:14 |
sean-k-mooney[m] | anyway hopefully the ironic comunitiy will find codespell useful too | 19: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 eventlet | 19:18 |
JayF | I'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 |
JayF | I 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 stuff | 19:19 |
JayF | but 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 LOL | 19:19 |
sean-k-mooney[m] | well the thing is i dont really want most people to start writing low level asyncio or threaded code | 19:19 |
sean-k-mooney[m] | right so anyio provides trios api over trio or vanila ayncio | 19: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 asyncio | 19: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.8 | 19:22 |
sean-k-mooney[m] | anyway im going to go cooks something and chill for the evening o/ | 19:24 |
JayF | o/ have a good one | 19:25 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!