crosshair-tool 0.0.92__tar.gz → 0.0.94__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of crosshair-tool might be problematic. Click here for more details.

Files changed (180) hide show
  1. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/PKG-INFO +2 -1
  2. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/__init__.py +1 -1
  3. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/core.py +16 -2
  4. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/core_test.py +25 -1
  5. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/dynamic_typing.py +36 -15
  6. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/dynamic_typing_test.py +18 -3
  7. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/check_examples_test.py +1 -1
  8. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/builtinslib.py +6 -5
  9. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/fractionlib_test.py +24 -1
  10. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/main.py +18 -10
  11. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/main_test.py +18 -9
  12. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/patch_equivalence_test.py +2 -0
  13. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/PKG-INFO +2 -1
  14. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/requires.txt +1 -0
  15. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/setup.py +2 -1
  16. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/LICENSE +0 -0
  17. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/README.md +0 -0
  18. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/__main__.py +0 -0
  19. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_mark_stacks.h +0 -0
  20. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_preliminaries_test.py +0 -0
  21. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_tracers.c +0 -0
  22. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_tracers.h +0 -0
  23. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_tracers_pycompat.h +0 -0
  24. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/_tracers_test.py +0 -0
  25. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/abcstring.py +0 -0
  26. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/auditwall.py +0 -0
  27. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/auditwall_test.py +0 -0
  28. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/codeconfig.py +0 -0
  29. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/codeconfig_test.py +0 -0
  30. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/condition_parser.py +0 -0
  31. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/condition_parser_test.py +0 -0
  32. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/conftest.py +0 -0
  33. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/copyext.py +0 -0
  34. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/copyext_test.py +0 -0
  35. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/core_and_libs.py +0 -0
  36. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/core_regestered_types_test.py +0 -0
  37. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/diff_behavior.py +0 -0
  38. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/diff_behavior_test.py +0 -0
  39. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/enforce.py +0 -0
  40. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/enforce_test.py +0 -0
  41. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/__init__.py +0 -0
  42. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/bugs_detected/__init__.py +0 -0
  43. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/bugs_detected/getattr_magic.py +0 -0
  44. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/bugs_detected/hash_consistent_with_equals.py +0 -0
  45. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/bugs_detected/shopping_cart.py +0 -0
  46. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/bugs_detected/showcase.py +0 -0
  47. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/__init__.py +0 -0
  48. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/arith.py +0 -0
  49. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/chess.py +0 -0
  50. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/nesting_inference.py +0 -0
  51. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/numpy_examples.py +0 -0
  52. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/rolling_average.py +0 -0
  53. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/PEP316/correct_code/showcase.py +0 -0
  54. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/__init__.py +0 -0
  55. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/deal/__init__.py +0 -0
  56. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/__init__.py +0 -0
  57. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/bugs_detected/__init__.py +0 -0
  58. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/bugs_detected/showcase.py +0 -0
  59. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/bugs_detected/wrong_sign.py +0 -0
  60. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/correct_code/__init__.py +0 -0
  61. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/correct_code/arith.py +0 -0
  62. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/examples/icontract/correct_code/showcase.py +0 -0
  63. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/fnutil.py +0 -0
  64. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/fnutil_test.py +0 -0
  65. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/fuzz_core_test.py +0 -0
  66. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/__init__.py +0 -0
  67. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/arraylib.py +0 -0
  68. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/binascii_ch_test.py +0 -0
  69. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/binascii_test.py +0 -0
  70. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/binasciilib.py +0 -0
  71. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/bisectlib_test.py +0 -0
  72. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/builtinslib_ch_test.py +0 -0
  73. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/builtinslib_test.py +0 -0
  74. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/codecslib.py +0 -0
  75. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/codecslib_test.py +0 -0
  76. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/collectionslib.py +0 -0
  77. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/collectionslib_ch_test.py +0 -0
  78. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/collectionslib_test.py +0 -0
  79. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/copylib.py +0 -0
  80. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/copylib_test.py +0 -0
  81. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/datetimelib.py +0 -0
  82. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/datetimelib_ch_test.py +0 -0
  83. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/datetimelib_test.py +0 -0
  84. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/decimallib.py +0 -0
  85. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/decimallib_ch_test.py +0 -0
  86. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/decimallib_test.py +0 -0
  87. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings/__init__.py +0 -0
  88. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings/_encutil.py +0 -0
  89. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings/ascii.py +0 -0
  90. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings/latin_1.py +0 -0
  91. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings/utf_8.py +0 -0
  92. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/encodings_ch_test.py +0 -0
  93. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/fractionlib.py +0 -0
  94. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/functoolslib.py +0 -0
  95. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/functoolslib_test.py +0 -0
  96. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/hashliblib.py +0 -0
  97. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/hashliblib_test.py +0 -0
  98. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/heapqlib.py +0 -0
  99. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/heapqlib_test.py +0 -0
  100. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/importliblib.py +0 -0
  101. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/importliblib_test.py +0 -0
  102. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/iolib.py +0 -0
  103. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/iolib_ch_test.py +0 -0
  104. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/iolib_test.py +0 -0
  105. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/ipaddresslib.py +0 -0
  106. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/itertoolslib.py +0 -0
  107. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/itertoolslib_test.py +0 -0
  108. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/jsonlib.py +0 -0
  109. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/jsonlib_ch_test.py +0 -0
  110. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/jsonlib_test.py +0 -0
  111. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/mathlib.py +0 -0
  112. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/mathlib_ch_test.py +0 -0
  113. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/mathlib_test.py +0 -0
  114. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/oslib.py +0 -0
  115. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/pathliblib_test.py +0 -0
  116. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/randomlib.py +0 -0
  117. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/randomlib_test.py +0 -0
  118. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/relib.py +0 -0
  119. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/relib_ch_test.py +0 -0
  120. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/relib_test.py +0 -0
  121. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/timelib.py +0 -0
  122. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/timelib_test.py +0 -0
  123. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/typeslib.py +0 -0
  124. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/typeslib_test.py +0 -0
  125. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/unicodedatalib.py +0 -0
  126. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/unicodedatalib_test.py +0 -0
  127. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/urlliblib.py +0 -0
  128. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/urlliblib_test.py +0 -0
  129. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/weakreflib.py +0 -0
  130. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/weakreflib_test.py +0 -0
  131. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/zliblib.py +0 -0
  132. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/libimpl/zliblib_test.py +0 -0
  133. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/lsp_server.py +0 -0
  134. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/lsp_server_test.py +0 -0
  135. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/objectproxy.py +0 -0
  136. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/objectproxy_test.py +0 -0
  137. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/opcode_intercept.py +0 -0
  138. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/opcode_intercept_test.py +0 -0
  139. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/options.py +0 -0
  140. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/options_test.py +0 -0
  141. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/path_cover.py +0 -0
  142. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/path_cover_test.py +0 -0
  143. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/path_search.py +0 -0
  144. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/path_search_test.py +0 -0
  145. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/pathing_oracle.py +0 -0
  146. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/pure_importer.py +0 -0
  147. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/pure_importer_test.py +0 -0
  148. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/py.typed +0 -0
  149. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/register_contract.py +0 -0
  150. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/register_contract_test.py +0 -0
  151. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/simplestructs.py +0 -0
  152. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/simplestructs_test.py +0 -0
  153. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/smtlib.py +0 -0
  154. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/smtlib_test.py +0 -0
  155. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/statespace.py +0 -0
  156. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/statespace_test.py +0 -0
  157. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/stubs_parser.py +0 -0
  158. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/stubs_parser_test.py +0 -0
  159. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/test_util.py +0 -0
  160. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/test_util_test.py +0 -0
  161. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tools/__init__.py +0 -0
  162. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tools/check_help_in_doc.py +0 -0
  163. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tools/check_init_and_setup_coincide.py +0 -0
  164. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tools/generate_demo_table.py +0 -0
  165. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tracers.py +0 -0
  166. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/tracers_test.py +0 -0
  167. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/type_repo.py +0 -0
  168. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/unicode_categories.py +0 -0
  169. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/unicode_categories_test.py +0 -0
  170. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/util.py +0 -0
  171. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/util_test.py +0 -0
  172. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/watcher.py +0 -0
  173. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/watcher_test.py +0 -0
  174. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/z3util.py +0 -0
  175. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair/z3util_test.py +0 -0
  176. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/SOURCES.txt +0 -0
  177. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/dependency_links.txt +0 -0
  178. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/entry_points.txt +0 -0
  179. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/crosshair_tool.egg-info/top_level.txt +0 -0
  180. {crosshair_tool-0.0.92 → crosshair_tool-0.0.94}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crosshair-tool
3
- Version: 0.0.92
3
+ Version: 0.0.94
4
4
  Summary: Analyze Python code for correctness using symbolic execution.
5
5
  Home-page: https://github.com/pschanely/CrossHair
6
6
  Author: Phillip Schanely
@@ -47,6 +47,7 @@ Requires-Dist: setuptools; extra == "dev"
47
47
  Requires-Dist: sphinx>=3.4.3; extra == "dev"
48
48
  Requires-Dist: sphinx-rtd-theme>=0.5.1; extra == "dev"
49
49
  Requires-Dist: rst2pdf>=0.102; extra == "dev"
50
+ Requires-Dist: z3-solver==4.14.1.0; extra == "dev"
50
51
  Dynamic: author
51
52
  Dynamic: author-email
52
53
  Dynamic: classifier
@@ -15,7 +15,7 @@ from crosshair.statespace import StateSpace
15
15
  from crosshair.tracers import NoTracing, ResumedTracing
16
16
  from crosshair.util import IgnoreAttempt, debug
17
17
 
18
- __version__ = "0.0.92" # Do not forget to update in setup.py!
18
+ __version__ = "0.0.94" # Do not forget to update in setup.py!
19
19
  __author__ = "Phillip Schanely"
20
20
  __license__ = "MIT"
21
21
  __status__ = "Alpha"
@@ -127,6 +127,14 @@ from crosshair.util import (
127
127
  warn,
128
128
  )
129
129
 
130
+ if sys.version_info >= (3, 12):
131
+ from typing import TypeAliasType
132
+
133
+ TypeAliasTypes = (TypeAliasType,)
134
+ else:
135
+ TypeAliasTypes = ()
136
+
137
+
130
138
  _MISSING = object()
131
139
 
132
140
 
@@ -329,9 +337,10 @@ def with_realized_args(fn: Callable, deep=False) -> Callable:
329
337
 
330
338
  def realizer(*a, **kw):
331
339
  with NoTracing():
332
- a = map(realize_fn, a)
340
+ a = [realize_fn(arg) for arg in a]
333
341
  kw = {k: realize_fn(v) for (k, v) in kw.items()}
334
- return fn(*a, **kw)
342
+ # You might think we don't need tracing here, but some operations can invoke user-defined behavior:
343
+ return fn(*a, **kw)
335
344
 
336
345
  functools.update_wrapper(realizer, fn)
337
346
  return realizer
@@ -666,6 +675,11 @@ def proxy_for_type(
666
675
  typ = normalize_pytype(typ)
667
676
  origin = origin_of(typ)
668
677
  type_args = type_args_of(typ)
678
+ while isinstance(origin, TypeAliasTypes):
679
+ type_var_bindings = dict(zip(origin.__type_params__, type_args))
680
+ unified = dynamic_typing.realize(origin.__value__, type_var_bindings)
681
+ return proxy_for_type(unified, varname, allow_subtypes)
682
+
669
683
  # special cases
670
684
  if isinstance(typ, type) and issubclass(typ, enum.Enum):
671
685
  enum_values = list(typ) # type:ignore
@@ -5,6 +5,7 @@ import re
5
5
  import sys
6
6
  import time
7
7
  from typing import *
8
+ from unittest import skipIf
8
9
 
9
10
  import pytest # type: ignore
10
11
 
@@ -28,7 +29,7 @@ from crosshair.core_and_libs import (
28
29
  standalone_statespace,
29
30
  )
30
31
  from crosshair.fnutil import FunctionInfo, walk_qualname
31
- from crosshair.libimpl.builtinslib import SymbolicInt
32
+ from crosshair.libimpl.builtinslib import LazyIntSymbolicStr, SymbolicInt
32
33
  from crosshair.options import DEFAULT_OPTIONS, AnalysisOptionSet
33
34
  from crosshair.statespace import (
34
35
  CANNOT_CONFIRM,
@@ -735,6 +736,29 @@ def test_newtype() -> None:
735
736
  assert isinstance(x, SymbolicInt)
736
737
 
737
738
 
739
+ @skipIf(sys.version_info < (3, 12), "type statements added in 3.12")
740
+ def test_type_statement() -> None:
741
+ env: dict[str, Any] = {}
742
+ exec("type MyIntNew = int\n", env)
743
+ assert "MyIntNew" in env
744
+ MyIntNew = env["MyIntNew"]
745
+ with standalone_statespace:
746
+ x = proxy_for_type(MyIntNew, "x")
747
+ assert isinstance(x, SymbolicInt)
748
+
749
+
750
+ @skipIf(sys.version_info < (3, 12), "type statements added in 3.12")
751
+ def test_parameterized_type_statement() -> None:
752
+ env: dict[str, Any] = {}
753
+ exec("type Pair[A, B] = tuple[B, A]\n", env)
754
+ assert "Pair" in env
755
+ Pair = env["Pair"]
756
+ with standalone_statespace:
757
+ x = proxy_for_type(Pair[int, str], "x")
758
+ assert isinstance(x[0], LazyIntSymbolicStr)
759
+ assert isinstance(x[1], SymbolicInt)
760
+
761
+
738
762
  def test_container_typevar() -> None:
739
763
  T = TypeVar("T")
740
764
 
@@ -1,4 +1,5 @@
1
1
  import collections.abc
2
+ import sys
2
3
  import typing
3
4
  from inspect import Parameter, Signature
4
5
  from itertools import zip_longest
@@ -223,21 +224,41 @@ def get_bindings_from_type_arguments(pytype: Type) -> Mapping[object, type]:
223
224
  return {}
224
225
 
225
226
 
226
- def realize(pytype: Type, bindings: Mapping[object, type]) -> object:
227
- if typing_inspect.is_typevar(pytype):
228
- return bindings[pytype]
229
- if not hasattr(pytype, "__args__"):
230
- return pytype
231
- newargs: List = []
232
- for arg in pytype.__args__: # type:ignore
233
- newargs.append(realize(arg, bindings))
234
- # print('realizing pytype', repr(pytype), 'newargs', repr(newargs))
235
- pytype_origin = origin_of(pytype)
236
- if not hasattr(pytype_origin, "_name"):
237
- pytype_origin = getattr(typing, pytype._name) # type:ignore
238
- if pytype_origin is Callable: # Callable args get flattened
239
- newargs = [newargs[:-1], newargs[-1]]
240
- return pytype_origin.__getitem__(tuple(newargs))
227
+ if sys.version_info >= (3, 9):
228
+
229
+ def realize(pytype: Type, bindings: Mapping[object, type]) -> object:
230
+ if typing_inspect.is_typevar(pytype):
231
+ return bindings[pytype]
232
+ if not hasattr(pytype, "__args__"):
233
+ return pytype
234
+ newargs: List = []
235
+ for arg in pytype.__args__: # type:ignore
236
+ newargs.append(realize(arg, bindings))
237
+ pytype_origin = origin_of(pytype)
238
+ if pytype_origin in (
239
+ collections.abc.Callable,
240
+ typing.Callable,
241
+ ): # Callable args get flattened
242
+ newargs = [newargs[:-1], newargs[-1]]
243
+ return pytype_origin.__class_getitem__(tuple(newargs))
244
+
245
+ else:
246
+
247
+ def realize(pytype: Type, bindings: Mapping[object, type]) -> object:
248
+ if typing_inspect.is_typevar(pytype):
249
+ return bindings[pytype]
250
+ if not hasattr(pytype, "__args__"):
251
+ return pytype
252
+ newargs: List = []
253
+ for arg in pytype.__args__: # type:ignore
254
+ newargs.append(realize(arg, bindings))
255
+ # print('realizing pytype', repr(pytype), 'newargs', repr(newargs))
256
+ pytype_origin = origin_of(pytype)
257
+ if not hasattr(pytype_origin, "_name"):
258
+ pytype_origin = getattr(typing, pytype._name) # type:ignore
259
+ if pytype_origin is Callable: # Callable args get flattened
260
+ newargs = [newargs[:-1], newargs[-1]]
261
+ return pytype_origin.__getitem__(tuple(newargs))
241
262
 
242
263
 
243
264
  def isolate_var_params(
@@ -1,4 +1,5 @@
1
1
  import collections
2
+ import sys
2
3
  from inspect import Parameter, Signature, signature
3
4
  from typing import (
4
5
  Callable,
@@ -60,7 +61,12 @@ def test_typedicts():
60
61
  def test_typevars():
61
62
  bindings = collections.ChainMap()
62
63
  assert unify(Tuple[int, str, List[int]], Tuple[int, _T, _U], bindings)
63
- assert realize(Mapping[_U, _T], bindings) == Mapping[List[int], str]
64
+
65
+ ret = realize(Mapping[_U, _T], bindings)
66
+ if sys.version_info >= (3, 9):
67
+ assert ret == collections.abc.Mapping[List[int], str]
68
+ else:
69
+ assert ret == Mapping[List[int], str]
64
70
 
65
71
 
66
72
  def test_bound_vtypears():
@@ -79,7 +85,13 @@ def test_callable():
79
85
 
80
86
  assert not unify(Callable[[List], bool], Callable[[Iterable], bool], bindings)
81
87
  assert unify(Callable[[int, _T], List[int]], Callable[[int, str], _U], bindings)
82
- assert realize(Callable[[_U], _T], bindings) == Callable[[List[int]], str]
88
+ if sys.version_info >= (3, 9):
89
+ assert (
90
+ realize(Callable[[_U], _T], bindings)
91
+ == collections.abc.Callable[[List[int]], str]
92
+ )
93
+ else:
94
+ assert realize(Callable[[_U], _T], bindings) == Callable[[List[int]], str]
83
95
 
84
96
 
85
97
  def test_plain_callable():
@@ -131,7 +143,10 @@ class Pair(Generic[_U, _T]):
131
143
  def test_bindings_from_type_arguments():
132
144
  var_mapping = get_bindings_from_type_arguments(Pair[int, str])
133
145
  assert var_mapping == {_U: int, _T: str}
134
- assert realize(List[_U], var_mapping) == List[int]
146
+ if sys.version_info >= (3, 9):
147
+ assert realize(List[_U], var_mapping) == list[int]
148
+ else:
149
+ assert realize(List[_U], var_mapping) == List[int]
135
150
 
136
151
 
137
152
  def test_intersect_signatures_basic():
@@ -24,7 +24,7 @@ def extract_linenums(text: str) -> List[int]:
24
24
 
25
25
  def find_examples() -> Iterable[Path]:
26
26
  examples_dir = pathlib.Path(os.path.realpath(__file__)).parent
27
- for path in sorted(examples_dir.glob("**/*.py")):
27
+ for path in sorted(examples_dir.glob("*/**/*.py")):
28
28
  if path.stem != "__init__":
29
29
  yield path
30
30
 
@@ -4441,10 +4441,11 @@ def _int(val: Any = 0, base=_MISSING):
4441
4441
  else:
4442
4442
  ret = (ret * base) + ch_num
4443
4443
  return ret
4444
- if base is _MISSING:
4445
- return int(deep_realize(val))
4446
- else:
4447
- return int(deep_realize(val), base=realize(base))
4444
+ elif isinstance(val, CrossHairValue):
4445
+ val = deep_realize(val)
4446
+ base = deep_realize(base)
4447
+
4448
+ return int(val) if base is _MISSING else int(val, base=base)
4448
4449
 
4449
4450
 
4450
4451
  _FLOAT_REGEX = re.compile(
@@ -4549,7 +4550,7 @@ def _len(ls):
4549
4550
  def _map(fn, *iters):
4550
4551
  # Wrap the `map` callback in a pure Python lambda.
4551
4552
  # This de-optimization ensures that the callback can be intercepted.
4552
- return map(lambda x: fn(x), *iters)
4553
+ return map(lambda *a: fn(*a), *iters)
4553
4554
 
4554
4555
 
4555
4556
  def _memoryview(source):
@@ -5,7 +5,8 @@ from crosshair.core import deep_realize
5
5
  from crosshair.core_and_libs import proxy_for_type
6
6
  from crosshair.statespace import POST_FAIL
7
7
  from crosshair.test_util import check_states
8
- from crosshair.tracers import ResumedTracing
8
+ from crosshair.tracers import ResumedTracing, is_tracing
9
+ from crosshair.util import CrossHairInternal
9
10
 
10
11
 
11
12
  def test_fraction_realize(space):
@@ -16,6 +17,28 @@ def test_fraction_realize(space):
16
17
  deep_realize(Fraction(n, d))
17
18
 
18
19
 
20
+ class UserFraction(Fraction):
21
+ def __int__(self):
22
+ if not is_tracing():
23
+ raise CrossHairInternal("tracing required while in user code")
24
+ return 1
25
+
26
+ def __round__(self, *a, **kw):
27
+ if not is_tracing():
28
+ raise CrossHairInternal("tracing required while in user code")
29
+ return super().__round__(*a, **kw)
30
+
31
+
32
+ def test_user_fraction_tracing(space):
33
+ n = proxy_for_type(int, "n")
34
+ d = proxy_for_type(int, "d")
35
+ with ResumedTracing():
36
+ space.add(d != 0)
37
+ fraction = UserFraction(n, d)
38
+ round(fraction) # (works via with_realized_args)
39
+ int(fraction) # (custom interception)
40
+
41
+
19
42
  def test_fraction_copy_doesnt_realize(space):
20
43
  n = proxy_for_type(int, "n")
21
44
  with ResumedTracing():
@@ -860,16 +860,24 @@ def check(
860
860
  if isinstance(entities, int):
861
861
  return entities
862
862
  full_options = DEFAULT_OPTIONS.overlay(report_verbose=False).overlay(options)
863
- for entity in entities:
864
- debug("Check ", getattr(entity, "__name__", str(entity)))
865
- for message in run_checkables(analyze_any(entity, options)):
866
- line = describe_message(message, full_options)
867
- if line is None:
868
- continue
869
- stdout.write(line + "\n")
870
- debug("Traceback for output message:\n", message.traceback)
871
- if message.state > MessageType.PRE_UNSAT:
872
- any_problems = True
863
+ checkables = [c for e in entities for c in analyze_any(e, options)]
864
+ if not checkables:
865
+ extra_help = ""
866
+ if full_options.analysis_kind == [AnalysisKind.asserts]:
867
+ extra_help = "\nHINT: Ensure that your functions to analyze lead with assert statements."
868
+ print(
869
+ "WARNING: Targets found, but contain no checkable functions." + extra_help,
870
+ file=stderr,
871
+ )
872
+
873
+ for message in run_checkables(checkables):
874
+ line = describe_message(message, full_options)
875
+ if line is None:
876
+ continue
877
+ stdout.write(line + "\n")
878
+ debug("Traceback for output message:\n", message.traceback)
879
+ if message.state > MessageType.PRE_UNSAT:
880
+ any_problems = True
873
881
  return 1 if any_problems else 0
874
882
 
875
883
 
@@ -251,19 +251,28 @@ def test_no_args_prints_usage(root):
251
251
  assert re.search(r"^usage", out)
252
252
 
253
253
 
254
- def DISABLE_TODO_test_assert_mode_e2e(root):
254
+ def test_assert_mode_e2e(root, capsys: pytest.CaptureFixture[str]):
255
255
  simplefs(root, ASSERT_BASED_FOO)
256
- try:
257
- sys.stdout = io.StringIO()
258
- exitcode = unwalled_main(["check", root / "foo.py", "--analysis_kind=asserts"])
259
- finally:
260
- out = sys.stdout.getvalue()
261
- sys.stdout = sys.__stdout__
262
- assert exitcode == 1
256
+ exitcode = unwalled_main(["check", str(root / "foo.py"), "--analysis_kind=asserts"])
257
+ (out, err) = capsys.readouterr()
258
+ assert err == ""
263
259
  assert re.search(
264
- r"foo.py\:8\: error\: AssertionError\: when calling foofn\(x \= 100\)", out
260
+ r"foo.py\:8\: error\: AssertionError\: when calling foofn\(100\)", out
265
261
  )
266
262
  assert len([ls for ls in out.split("\n") if ls]) == 1
263
+ assert exitcode == 1
264
+
265
+
266
+ def test_assert_without_checkable(root, capsys: pytest.CaptureFixture[str]):
267
+ simplefs(root, SIMPLE_FOO)
268
+ exitcode = unwalled_main(["check", str(root / "foo.py"), "--analysis_kind=asserts"])
269
+ (out, err) = capsys.readouterr()
270
+ assert (
271
+ err
272
+ == "WARNING: Targets found, but contain no checkable functions.\nHINT: Ensure that your functions to analyze lead with assert statements.\n"
273
+ )
274
+ assert out == ""
275
+ assert exitcode == 0
267
276
 
268
277
 
269
278
  def test_directives(root):
@@ -1,5 +1,6 @@
1
1
  import copy
2
2
  import itertools
3
+ import operator
3
4
  import re
4
5
  import sys
5
6
  from dataclasses import dataclass
@@ -39,6 +40,7 @@ possible_args = [
39
40
  (42, int), # isinstance
40
41
  (re.compile("(ab|a|b)"), r"\n", ""), # re methods
41
42
  (bool, [1, 1, 0]), # itertools.takewhile and friends
43
+ (operator.add, [1, 0], [1, 1]), # multi-iterable map
42
44
  ([(1, 2), (3, 4)]), # key-value pairs
43
45
  ([(1, 2), ([], 4)]), # key-value pairs w/ unhashable key
44
46
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crosshair-tool
3
- Version: 0.0.92
3
+ Version: 0.0.94
4
4
  Summary: Analyze Python code for correctness using symbolic execution.
5
5
  Home-page: https://github.com/pschanely/CrossHair
6
6
  Author: Phillip Schanely
@@ -47,6 +47,7 @@ Requires-Dist: setuptools; extra == "dev"
47
47
  Requires-Dist: sphinx>=3.4.3; extra == "dev"
48
48
  Requires-Dist: sphinx-rtd-theme>=0.5.1; extra == "dev"
49
49
  Requires-Dist: rst2pdf>=0.102; extra == "dev"
50
+ Requires-Dist: z3-solver==4.14.1.0; extra == "dev"
50
51
  Dynamic: author
51
52
  Dynamic: author-email
52
53
  Dynamic: classifier
@@ -20,6 +20,7 @@ setuptools
20
20
  sphinx>=3.4.3
21
21
  sphinx-rtd-theme>=0.5.1
22
22
  rst2pdf>=0.102
23
+ z3-solver==4.14.1.0
23
24
 
24
25
  [dev:python_version < "3.12"]
25
26
  numpy==1.23.4
@@ -14,7 +14,7 @@ from setuptools import Extension, find_packages, setup # type: ignore
14
14
  # the pre-commit checks through check_init_and_setup_coincide.py.
15
15
  setup(
16
16
  name="crosshair-tool",
17
- version="0.0.92", # Update this in crosshair/__init__.py too
17
+ version="0.0.94", # Update this in crosshair/__init__.py too
18
18
  author="Phillip Schanely",
19
19
  author_email="pschanely+vE7F@gmail.com",
20
20
  ext_modules=[
@@ -66,6 +66,7 @@ setup(
66
66
  "sphinx>=3.4.3",
67
67
  "sphinx-rtd-theme>=0.5.1",
68
68
  "rst2pdf>=0.102",
69
+ "z3-solver==4.14.1.0", # TODO: the 4.15 release has significant performance improvements
69
70
  ]
70
71
  },
71
72
  classifiers=[
File without changes