stata_kernel icon indicating copy to clipboard operation
stata_kernel copied to clipboard

Repo modernization

Open kylebarron opened this issue 3 years ago • 1 comments

I don't have a ton of free time at the moment, but here are some (opinionated) suggestions for making the repo easier to maintain in the future. Take these as suggestions to be discussed

  • https://github.com/asottile/pyupgrade for upgrading syntax to 3.6+ or newer
  • https://github.com/psf/black for formatting. Not a requirement but I think black is the most popular formatter in Python today https://github.com/psf/black#used-by
  • https://github.com/PyCQA/isort for deterministic ordering of imports
  • https://mypy.readthedocs.io/en/stable/ for static typing. I've become a huge proponent of static typing for being able to quickly understand code (especially old code you haven't looked at for a while)
  • Using click instead of argparse. IMO click is so easy to work with, and a small enough dependency, that it's a better choice.

kylebarron avatar Apr 07 '22 17:04 kylebarron

@kylebarron I don't have particularly strong feelings on these. Of course I have peeves about formatting but I'm self-aware in that I know they're subjective (and inconsistent Un_n).

  • pyupgrade seems like a good idea.

  • black looks good; I would assume moving from YAPF won't be hard.

  • isort seems fine—I reckon consistency matters more than the actual choices in this case.

  • click seems nice (I think I have a memory of argparse being annoying to work around when doing the magics but not 100%).

  • I have mixed feelings on static typing for python. In general I'm quite happy for languages to have static types (or optional static types, like with Julia). In Python's case the interpreter ignores it, AFAIK, which makes me sad ):

    So if there's a situation where typing matters the check has to be added by the programmer. While mypy sounds like a good idea nonetheless, I guess it's hard for me to be excited about it when a) I haven't seen it in action and, more importantly, b) migrating to static typing seems by far to be the most labor-intensive bullet point.

mcaceresb avatar Apr 07 '22 20:04 mcaceresb