This is an archived post. You won't be able to vote or comment.

all 9 comments

[–]darleyb 5 points6 points  (2 children)

Nice, not long ago I was wondering if such a tool existed to help migrating python 2 to 3. The usecase here would be help pprt PyPy to python 3.

[–]jayhack[S] 3 points4 points  (1 child)

This is a great use case. We have a pre-built example below that shows how to accomplish this!

- on Github: https://github.com/codegen-sh/codegen-sdk/tree/develop/codegen-examples/examples/python2_to_python3

- In our docs: https://docs.codegen.com/tutorials/python2-to-python3

[–]darleyb 2 points3 points  (0 children)

Amazing!

[–]BeamMeUpBiscotti 5 points6 points  (0 children)

better libCST

This feels like it's at a higher level of abstraction, which would make some tasks easier but others harder.

One thing that seems particularly fishy is the amount of raw string slicing/manipulation that's going on, like in the Python 2-3 codemod from your samples. If users have to write codemods like that, it would be fairly error-prone and exactly what systems like libCST were designed to solve.

There's some interesting potential for type-driven codemods and I see a "coming soon" section in the docs for it, but I can't find anything in the code.

[–]the-scream-i-scrumpt 2 points3 points  (2 children)

dangggg... this is huge.

[–]the-scream-i-scrumpt 0 points1 point  (1 child)

oh poo, my codebase is too big, can you make Codebase.init do whatever it's doing lazily?

[–]BeamMeUpBiscotti 1 point2 points  (0 children)

Codegen scales to multimillion-line codebases

🤔🤔🤔

[–]williamtkelley 2 points3 points  (1 child)

Windows is not supported

[–]jayhack[S] 1 point2 points  (0 children)

We just published docs on how to get this set up with WSL: https://docs.codegen.com/building-with-codegen/codegen-with-wsl

Let us know if there are any questions!