Commit 846d795
committed
Pin openrewrite Python package version in PythonRewriteRpc bootstrap
PythonRewriteRpc.bootstrapOpenrewrite() was running bare `pip install
openrewrite` without a version specifier, unlike the JavaScript side
which reads /META-INF/version.txt and pins `@openrewrite/rewrite@<version>`.
This meant the Python RPC could end up with a mismatched openrewrite
package version, and the existence-only check meant users could get
stuck on a stale version indefinitely.
Changes:
- Generate META-INF/version.txt in the build (PEP 440 format) so the
Java code can read the expected Python package version at runtime
- Pin `openrewrite==<version>` in bootstrapOpenrewrite() for release
and CI builds; skip pinning for local .dev0 builds
- Track installed version via a marker file to detect and upgrade
stale installs
- Add license exclude for version.txt and .gitignore entry1 parent e7f8710 commit 846d795
3 files changed
Lines changed: 59 additions & 5 deletions
File tree
- rewrite-python
- src/main/java/org/openrewrite/python/rpc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
199 | | - | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
214 | 240 | | |
215 | 241 | | |
216 | 242 | | |
| |||
364 | 390 | | |
365 | 391 | | |
366 | 392 | | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
607 | 608 | | |
608 | 609 | | |
609 | 610 | | |
610 | | - | |
611 | | - | |
612 | | - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
613 | 629 | | |
614 | 630 | | |
| 631 | + | |
| 632 | + | |
615 | 633 | | |
616 | 634 | | |
617 | 635 | | |
618 | 636 | | |
619 | 637 | | |
620 | 638 | | |
621 | 639 | | |
622 | | - | |
| 640 | + | |
623 | 641 | | |
624 | 642 | | |
625 | 643 | | |
| |||
652 | 670 | | |
653 | 671 | | |
654 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
655 | 678 | | |
656 | 679 | | |
657 | 680 | | |
| |||
0 commit comments