Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Use module paths for mypy pre-commit instead of filenames to w… #106

Closed
wants to merge 1 commit into from

Conversation

tristanmenzel
Copy link
Collaborator

…ork around command length issue on windows

@tristanmenzel tristanmenzel enabled auto-merge (rebase) February 22, 2024 18:02
Copy link

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/puya
   __main__.py28196%108
   arc4_util.py63494%28, 64, 78, 97
   arc32.py68396%88–89, 100
   compile.py193796%66, 85, 116, 134, 220, 247–248
   errors.py1212976%48–49, 53, 55–58, 83, 137–151, 166–172
   logging_config.py1292878%15, 36–39, 45, 47, 50–54, 69, 88, 141–143, 146–148, 150, 163–172, 194
   options.py29293%12–13
   parse.py1751691%83, 95, 124, 163, 166, 206–212, 230, 271, 297, 311, 324–325
   utils.py1451987%49, 53, 87, 93, 108, 111–113, 120, 142, 153–154, 158, 162–165, 196, 198, 221
src/puya/awst
   function_traverser.py177398%113, 143–144
   nodes.py9255994%37, 46, 80, 86, 90–93, 127, 133, 137–140, 268, 274, 478, 516, 699–700, 717, 757, 763–764, 794, 820, 824–828, 840, 944–945, 950, 965, 1016, 1021, 1079, 1102, 1119, 1298, 1303–1304, 1311–1316, 1417, 1426, 1454, 1461, 1474, 1533, 1535, 1540, 1548, 1553, 1558, 1567, 1572, 1577, 1584
   to_code_visitor.py3101495%85–86, 89–92, 116–117, 198, 323–324, 334, 415–416, 487, 515
   visitors.py2026667%7, 15, 19, 23, 27, 31, 35, 39, 43, 47, 53, 59, 65, 69, 73, 79, 83, 87, 91, 95, 101, 105, 109, 113, 117, 121, 125, 129, 135, 139, 143, 149, 155, 159, 165, 169, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 227, 230, 233, 239, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293
   wtypes.py2833687%21, 64, 176–187, 202–205, 222, 224, 266, 269, 294, 296, 300–301, 304, 328, 348, 384, 387, 414–415, 424–425, 433–434, 445, 448, 507, 514, 530
src/puya/awst_build
   base_mypy_visitor.py1334467%39, 59, 71–77, 95, 106–121, 135, 139, 143, 154, 158, 166, 172, 178, 196, 202, 207, 210, 213, 222, 226, 231, 236, 242, 247, 253, 260, 264, 268, 272, 276, 280, 284, 288, 292, 296, 300, 304, 308
   context.py1392086%120–125, 133, 135–140, 143–144, 164, 169, 173, 186, 198–199
   contract.py3319571%74–80, 124, 141–142, 144–147, 155–156, 159, 171, 182, 204, 222, 228, 230, 241, 251, 260, 288, 292, 308–312, 320–321, 326, 329, 332, 335, 338–341, 344, 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, 388, 402–409, 418–425, 432–433, 462, 472, 501, 503, 506, 518, 547–548, 563, 567, 570, 576, 579, 582, 585, 593, 601, 604, 607–619, 622, 631, 634, 651, 661–662, 669, 675
   intrinsic_models.py32584%21, 26–29
   main.py59592%39, 42, 52, 65, 77
   module.py3307378%93, 112–113, 120, 128, 134, 140–144, 153, 181, 184, 194–195, 222, 237–238, 240, 256–291, 299–300, 341, 366–367, 386, 393, 401–414, 427–428, 451–456, 510–511, 522, 546, 549, 555, 563, 566, 573, 579, 591, 594, 606, 615–616, 630–631, 641–642
   subroutine.py6147288%213, 224, 279, 329, 337, 348, 393–394, 531–545, 553, 561, 564, 576, 605–606, 612, 617, 653, 707–713, 733, 766–767, 772, 788, 791, 794, 802–808, 831, 863, 867–868, 872–873, 889, 891, 894–896, 923–924, 932, 967–975, 1010, 1038, 1042, 1073, 1170, 1177, 1187, 1198–1202, 1211, 1214, 1217, 1220, 1223, 1228, 1233, 1240, 1247
   utils.py1852487%50–51, 66, 103, 118–119, 121, 141–142, 162, 176, 187, 192, 199, 211, 233–246, 267, 338–339
src/puya/awst_build/eb
   app_account_state.py1122479%53–55, 63, 80, 82, 120–121, 157, 159, 162–163, 176, 218–225, 243–244, 247
   app_state.py971684%48–55, 77–78, 81, 123–124, 145–146, 159
   array.py684534%26–27, 30–32, 37–44, 57–73, 78–80, 83, 86–89, 94–96, 101–103, 113–124
   base.py1725071%21–27, 97, 101, 105, 111, 115, 121–126, 137–143, 148–154, 160, 166, 176, 187, 191, 195, 205, 208, 211, 214, 217, 220, 225, 228, 236, 249, 260, 263, 276, 297, 302, 312, 315, 319, 325, 328, 331, 336, 341, 346, 352
   biguint.py932276%35–39, 64–65, 79, 94, 104–107, 129–132, 149–154, 184–192, 195–196
   bool.py401270%27–31, 48–55, 73
   bytes.py1432384%56–60, 83–84, 95–96, 117–118, 122, 126, 131, 133–134, 154, 176, 251–255, 269–270, 363–364
   bytes_backed.py29486%38–39, 48–49
   ensure_budget.py481569%25–29, 50–51, 71–72, 80, 92, 98–103
   intrinsics.py1564372%32–34, 56–57, 65–66, 72–73, 90–91, 98, 128, 137, 139–163, 170–171, 215, 223, 235–236, 238, 255–256, 268, 273, 280, 283
   log.py591181%26–30, 85–95, 105, 107
   named_int_constants.py20290%23–24
   struct.py321553%21–22, 25, 36–42, 47–49, 52–57
   subroutine.py35294%52, 72
   temporary_assignment.py36683%23, 34, 40, 43, 46, 51
   tuple.py1002377%38–39, 46, 57, 59–60, 82–83, 92–93, 106, 112, 130–131, 136–137, 149, 157–163, 171, 203
   type_registry.py27293%138–139
   uint64.py791581%37–41, 63–64, 85, 103, 126, 145–148, 162–170, 173–174
   unsigned_builtins.py701184%30–34, 52, 59, 94, 97–98, 129, 132–133
   value_proxy.py391269%24, 27, 30, 33, 36, 41, 56, 66, 75, 85, 88, 91
src/puya/awst_build/eb/arc4
   arrays.py2223186%58–62, 75–76, 104, 135, 155–156, 192, 194, 228, 260, 277–278, 291, 334–335, 341, 346, 401–402, 424, 434–435, 443, 472, 492–493, 501, 547
   base.py1121785%35–39, 69–70, 91–92, 162, 183, 200–201, 215–216, 233–234, 240, 245
   bool.py28679%26–33, 59–60
   numeric.py831977%26–31, 43, 58, 89–90, 92, 95–96, 113, 120–121, 139, 153–154, 159, 164
   string.py651282%31–35, 65–66, 101, 120–121, 146–147, 165–166
   struct.py601083%26–33, 69, 72, 107–108, 114, 119
   tuple.py832175%30–34, 49, 53–54, 79, 84–86, 95, 106, 115, 128, 132–133, 145, 161–162, 171–172
src/puya/awst_build/eb/reference_types
   account.py46883%24–26, 44, 53–57
   application.py31487%17–19, 41–42
   asset.py52688%27–29, 51–52, 89–90
   base.py44491%25–27, 61, 87
src/puya/awst_build/eb/transaction
   base.py33779%16, 24, 28, 33–34, 41, 50
   group.py57984%33–37, 88–89, 98, 152, 155–156
   inner.py56984%28–31, 64–65, 101–102, 116, 144
   inner_params.py981189%29–33, 46–47, 69, 105, 141, 166, 183, 215
src/puya/awst_build/validation
   arc4_copy.py29197%38
   inner_transactions.py941188%93, 101, 112, 122, 126, 129, 134, 142, 152, 165, 170
   scratch_slots.py38489%18, 31, 47, 49
src/puya/ir
   arc4_router.py2702192%171, 275, 293, 301, 457, 537, 583, 650–651, 665, 705–706, 718, 723, 728, 733, 738, 743, 763–768
   avm_ops.py316299%44–45
   avm_ops_models.py34294%18, 26
   context.py931188%18, 37–38, 40, 53, 69, 79–85, 90
   main.py138696%56, 59, 181, 183, 245, 252
   models.py4332694%29, 45, 63, 79, 186, 196, 200, 342, 416, 458, 538, 554, 595, 598, 605, 608, 655, 664, 672, 678, 689–691, 701, 713, 750
   ssa.py136993%43, 51–52, 99, 105, 141, 145, 166, 170
   to_text_visitor.py132795%82, 87, 169–174
   types_.py39685%25–26, 51–54
   visitor.py1643678%10–12, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 167, 179, 194, 197, 200, 203, 206, 212, 215, 218, 221, 224, 227, 230, 233
   visitor_mutator.py91298%134–135
   vla.py73297%50, 87
src/puya/ir/builder
   arc4.py4185088%75–76, 125, 149–155, 219, 227, 450, 462, 465, 621–635, 964–978, 1004–1028, 1037–1053, 1076, 1177–1178, 1223–1240, 1279–1280, 1333, 1366–1367, 1389–1396, 1517–1518, 1581
   assignment.py44589%69, 87, 114, 144–145
   blocks.py931089%61, 71, 75, 111, 119, 123, 147–149, 155–157
   flow_control.py98496%66, 121, 145, 159
   iteration.py190597%52, 72, 101, 182–183
   itxn.py2251792%109–110, 119–122, 132–133, 141, 166, 445–446, 451–452, 458, 474–475
   main.py4845289%92, 109, 138, 187–188, 203–204, 231, 239, 246–247, 333, 361–362, 377, 389, 406, 427, 434, 468, 586, 599–600, 627, 688–689, 711, 759, 787, 795, 825–826, 841, 901, 904, 910, 917–918, 948–949, 964, 1010–1011, 1027–1028, 1062, 1077–1079, 1088, 1091–1092
   utils.py64691%34, 54–55, 136, 182–183
src/puya/ir/destructure
   coalesce_locals.py941584%33, 36, 118, 127–128, 131–134, 137–139, 153–156
   parcopy.py84298%47, 83
src/puya/ir/optimize
   arithmetic.py2393386%137, 199, 203, 205, 207, 209, 212–213, 229, 275, 277, 284, 316, 320, 322, 325–326, 341, 343, 345, 347, 349, 355, 357, 359, 361, 363, 365, 367, 370–371, 374–375
   collapse_blocks.py92595%65–69
   control_op_simplification.py108794%155–161, 231, 252
   dead_code_elimination.py119298%288, 324
   intrinsic_simplification.py62592%25–26, 41, 118–119
   main.py86397%108–109, 125
src/puya/mir
   annotaters.py173796%57, 63, 99, 103, 136, 140, 217
   builder.py122695%82, 132, 138, 145, 252–253
   context.py39197%35
   models.py3092293%13–18, 30, 41, 53, 64, 75, 86, 116, 226, 257, 294, 306, 323, 331–337, 343
   output.py61297%29, 31
   stack.py2502291%68, 72, 105, 109, 115, 125, 136, 147, 157, 172, 189, 199, 218, 236, 242, 244, 283, 294, 318, 350, 355, 393
   visitor.py732368%7, 15, 19, 23, 27, 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, 71, 75, 79, 83, 87, 91, 95, 99
src/puya/mir/stack_allocation
   baileys.py208697%31, 103, 123, 330–334, 359
   frame_allocation.py78396%21, 57–58
   koopmans.py61198%55
   peephole.py100694%75, 89, 99, 101, 103, 145
src/puya/teal
   main.py36197%26
   models.py220399%181, 279, 285
src/puya/teal/optimize
   peephole.py106496%63, 146–156
   repeated_rotations.py30197%13
   repeated_rotations_search.py88693%34, 40–41, 57, 67–68
TOTAL14650163389% 

Tests Skipped Failures Errors Time
227 2 💤 0 ❌ 0 🔥 6m 3s ⏱️

@achidlow
Copy link
Collaborator

Doesn't this mean every single file will be type checked on every pre-commit, massively slowing it down? I'd prefer if we found another way around the line length issue - is there any prior art we can leverage?

@tristanmenzel
Copy link
Collaborator Author

We could maybe wait for this to be resolved as I suspect it might be the cause: pre-commit/pre-commit#3124

@achidlow

@achidlow
Copy link
Collaborator

achidlow commented Mar 1, 2024

We need to get to the bottom of the issue, as per the linked issue in pre-commit - @tristanmenzel can you attach a debugger and see what's going on on Windows?

@achidlow achidlow closed this Mar 1, 2024
auto-merge was automatically disabled March 1, 2024 07:46

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants