Closed nrser closed 1 year ago
Thanks a lot for this @nrser 🙌 I hope I can take a closer look later this week.
blib2to3
does indeed sound like a stop gap solution, but I'm happy to use it as long as it unblocks using docspec with the new syntax. I was hoping to migrating to libCST
in the future (#3) but that's a big chunk of work.
The update-changelogs
task action isn't really working for PRs from forks I guess (https://github.com/NiklasRosenstein/slap/issues/90), so I'm ignoring that failed test.
Thanks a lot for this @nrser!
In response to issue #79.
The built-in lib2to3 does not support pattern matching (Python 3.10+):
https://docs.python.org/3.11/library/2to3.html#module-lib2to3
The black project managed to get some level of parsing support for
match
out of their modified versionblib2to3
, see:This change adds
black
as a dependency and switches to usingblib2to3
to parse.Tests pass, and I am currently using it on an actual project of moderate complexity, but this is a significant change to core functionality... caution is advised. It seems like
blib2to3
itself is a bit of hack/stop-gap, and that's not counting my hasty integration withdocspec-python
.However, for users now in a broken state due to
match
syntax in their source files this may be worth a shot.