wsba-hockey 1.1.8__py3-none-any.whl → 1.2.0__py3-none-any.whl

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.
Files changed (145) hide show
  1. wsba_hockey/__init__.py +22 -1
  2. wsba_hockey/tools/scraping.py +166 -190
  3. wsba_hockey/tools/utils/__init__.py +0 -1
  4. wsba_hockey/tools/utils/shared.py +14 -389
  5. wsba_hockey/tools/xg_model.py +6 -1
  6. wsba_hockey/wsba_main.py +330 -20
  7. {wsba_hockey-1.1.8.dist-info → wsba_hockey-1.2.0.dist-info}/METADATA +16 -15
  8. wsba_hockey-1.2.0.dist-info/RECORD +15 -0
  9. wsba_hockey/api/api/index.py +0 -162
  10. wsba_hockey/data_pipelines.py +0 -247
  11. wsba_hockey/evidence/weakside-breakout/node_modules/duckdb/vendor.py +0 -146
  12. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/flatted.py +0 -149
  13. wsba_hockey/evidence/weakside-breakout/node_modules/flatted/python/test.py +0 -63
  14. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  15. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -367
  16. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  17. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1270
  18. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  19. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  20. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -153
  21. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -271
  22. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  23. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -690
  24. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -661
  25. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -78
  26. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -165
  27. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -109
  28. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  29. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  30. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -808
  31. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1173
  32. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1321
  33. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -120
  34. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -103
  35. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -464
  36. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  37. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -58
  38. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2714
  39. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3981
  40. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  41. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2936
  42. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -55
  43. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1394
  44. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -25
  45. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3130
  46. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -98
  47. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -771
  48. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1271
  49. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  50. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  51. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -374
  52. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  53. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -302
  54. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3197
  55. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  56. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/test_gyp.py +0 -261
  57. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/graphviz.py +0 -102
  58. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_gyp.py +0 -156
  59. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_sln.py +0 -181
  60. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +0 -339
  61. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/test/fixtures/test-charmap.py +0 -31
  62. wsba_hockey/evidence/weakside-breakout/node_modules/node-gyp/update-gyp.py +0 -64
  63. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/gyp_main.py +0 -45
  64. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -367
  65. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  66. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1270
  67. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  68. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  69. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -153
  70. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -271
  71. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  72. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +0 -666
  73. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common.py +0 -654
  74. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +0 -78
  75. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -165
  76. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -109
  77. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  78. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  79. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -808
  80. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1173
  81. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1321
  82. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -120
  83. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -103
  84. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -464
  85. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  86. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -58
  87. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2518
  88. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3978
  89. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  90. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2936
  91. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -55
  92. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1394
  93. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -25
  94. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input.py +0 -3137
  95. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +0 -98
  96. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -771
  97. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1271
  98. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  99. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  100. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +0 -374
  101. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  102. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -302
  103. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3197
  104. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  105. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/setup.py +0 -42
  106. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/test_gyp.py +0 -260
  107. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/graphviz.py +0 -102
  108. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_gyp.py +0 -156
  109. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_sln.py +0 -181
  110. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/gyp/tools/pretty_vcproj.py +0 -339
  111. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/test/fixtures/test-charmap.py +0 -31
  112. wsba_hockey/evidence/weakside-breakout/node_modules/sqlite3/node_modules/node-gyp/update-gyp.py +0 -46
  113. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/duos/app.py +0 -210
  114. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/duos/calc.py +0 -163
  115. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/app.py +0 -401
  116. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/game_stats/name_fix.py +0 -47
  117. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/app.py +0 -101
  118. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/plot.py +0 -71
  119. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/goalie/rink_plot.py +0 -245
  120. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/app.py +0 -108
  121. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/plot.py +0 -95
  122. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/heatmaps/rink_plot.py +0 -245
  123. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/app.py +0 -245
  124. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/plot.py +0 -275
  125. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/line-combos/rink_plot.py +0 -245
  126. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/app.py +0 -145
  127. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/plot.py +0 -79
  128. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/matchups/rink_plot.py +0 -245
  129. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/app.py +0 -406
  130. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/plot.py +0 -79
  131. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/pbp/rink_plot.py +0 -245
  132. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/app.py +0 -110
  133. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/plot.py +0 -59
  134. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/skater/rink_plot.py +0 -245
  135. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/app.py +0 -103
  136. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/plot.py +0 -95
  137. wsba_hockey/evidence/weakside-breakout/wsba_nhl_apps/wsba_nhl_apps/team_heatmaps/rink_plot.py +0 -245
  138. wsba_hockey/flask/app.py +0 -77
  139. wsba_hockey/tools/utils/config.py +0 -14
  140. wsba_hockey/tools/utils/save_pages.py +0 -133
  141. wsba_hockey/workspace.py +0 -31
  142. wsba_hockey-1.1.8.dist-info/RECORD +0 -148
  143. {wsba_hockey-1.1.8.dist-info → wsba_hockey-1.2.0.dist-info}/WHEEL +0 -0
  144. {wsba_hockey-1.1.8.dist-info → wsba_hockey-1.2.0.dist-info}/licenses/LICENSE +0 -0
  145. {wsba_hockey-1.1.8.dist-info → wsba_hockey-1.2.0.dist-info}/top_level.txt +0 -0
@@ -1,65 +0,0 @@
1
- # Copyright (c) 2011 Google Inc. All rights reserved.
2
- # Use of this source code is governed by a BSD-style license that can be
3
- # found in the LICENSE file.
4
-
5
- """Applies a fix to CR LF TAB handling in xml.dom.
6
-
7
- Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
8
- Working around this: http://bugs.python.org/issue5752
9
- TODO(bradnelson): Consider dropping this when we drop XP support.
10
- """
11
-
12
-
13
- import xml.dom.minidom
14
-
15
-
16
- def _Replacement_write_data(writer, data, is_attrib=False):
17
- """Writes datachars to writer."""
18
- data = data.replace("&", "&amp;").replace("<", "&lt;")
19
- data = data.replace('"', "&quot;").replace(">", "&gt;")
20
- if is_attrib:
21
- data = data.replace("\r", "&#xD;").replace("\n", "&#xA;").replace("\t", "&#x9;")
22
- writer.write(data)
23
-
24
-
25
- def _Replacement_writexml(self, writer, indent="", addindent="", newl=""):
26
- # indent = current indentation
27
- # addindent = indentation to add to higher levels
28
- # newl = newline string
29
- writer.write(indent + "<" + self.tagName)
30
-
31
- attrs = self._get_attributes()
32
- a_names = sorted(attrs.keys())
33
-
34
- for a_name in a_names:
35
- writer.write(' %s="' % a_name)
36
- _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True)
37
- writer.write('"')
38
- if self.childNodes:
39
- writer.write(">%s" % newl)
40
- for node in self.childNodes:
41
- node.writexml(writer, indent + addindent, addindent, newl)
42
- writer.write(f"{indent}</{self.tagName}>{newl}")
43
- else:
44
- writer.write("/>%s" % newl)
45
-
46
-
47
- class XmlFix:
48
- """Object to manage temporary patching of xml.dom.minidom."""
49
-
50
- def __init__(self):
51
- # Preserve current xml.dom.minidom functions.
52
- self.write_data = xml.dom.minidom._write_data
53
- self.writexml = xml.dom.minidom.Element.writexml
54
- # Inject replacement versions of a function and a method.
55
- xml.dom.minidom._write_data = _Replacement_write_data
56
- xml.dom.minidom.Element.writexml = _Replacement_writexml
57
-
58
- def Cleanup(self):
59
- if self.write_data:
60
- xml.dom.minidom._write_data = self.write_data
61
- xml.dom.minidom.Element.writexml = self.writexml
62
- self.write_data = None
63
-
64
- def __del__(self):
65
- self.Cleanup()
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # Copyright (c) 2009 Google Inc. All rights reserved.
4
- # Use of this source code is governed by a BSD-style license that can be
5
- # found in the LICENSE file.
6
-
7
- from os import path
8
-
9
- from setuptools import setup
10
-
11
- here = path.abspath(path.dirname(__file__))
12
- # Get the long description from the README file
13
- with open(path.join(here, "README.md")) as in_file:
14
- long_description = in_file.read()
15
-
16
- setup(
17
- name="gyp-next",
18
- version="0.10.0",
19
- description="A fork of the GYP build system for use in the Node.js projects",
20
- long_description=long_description,
21
- long_description_content_type="text/markdown",
22
- author="Node.js contributors",
23
- author_email="ryzokuken@disroot.org",
24
- url="https://github.com/nodejs/gyp-next",
25
- package_dir={"": "pylib"},
26
- packages=["gyp", "gyp.generator"],
27
- entry_points={"console_scripts": ["gyp=gyp:script_main"]},
28
- python_requires=">=3.6",
29
- classifiers=[
30
- "Development Status :: 3 - Alpha",
31
- "Environment :: Console",
32
- "Intended Audience :: Developers",
33
- "License :: OSI Approved :: BSD License",
34
- "Natural Language :: English",
35
- "Programming Language :: Python",
36
- "Programming Language :: Python :: 3",
37
- "Programming Language :: Python :: 3.6",
38
- "Programming Language :: Python :: 3.7",
39
- "Programming Language :: Python :: 3.8",
40
- "Programming Language :: Python :: 3.9",
41
- ],
42
- )
@@ -1,260 +0,0 @@
1
- #!/usr/bin/env python3
2
- # Copyright (c) 2012 Google Inc. All rights reserved.
3
- # Use of this source code is governed by a BSD-style license that can be
4
- # found in the LICENSE file.
5
-
6
- """gyptest.py -- test runner for GYP tests."""
7
-
8
-
9
- import argparse
10
- import os
11
- import platform
12
- import subprocess
13
- import sys
14
- import time
15
-
16
-
17
- def is_test_name(f):
18
- return f.startswith("gyptest") and f.endswith(".py")
19
-
20
-
21
- def find_all_gyptest_files(directory):
22
- result = []
23
- for root, dirs, files in os.walk(directory):
24
- result.extend([os.path.join(root, f) for f in files if is_test_name(f)])
25
- result.sort()
26
- return result
27
-
28
-
29
- def main(argv=None):
30
- if argv is None:
31
- argv = sys.argv
32
-
33
- parser = argparse.ArgumentParser()
34
- parser.add_argument("-a", "--all", action="store_true", help="run all tests")
35
- parser.add_argument("-C", "--chdir", action="store", help="change to directory")
36
- parser.add_argument(
37
- "-f",
38
- "--format",
39
- action="store",
40
- default="",
41
- help="run tests with the specified formats",
42
- )
43
- parser.add_argument(
44
- "-G",
45
- "--gyp_option",
46
- action="append",
47
- default=[],
48
- help="Add -G options to the gyp command line",
49
- )
50
- parser.add_argument(
51
- "-l", "--list", action="store_true", help="list available tests and exit"
52
- )
53
- parser.add_argument(
54
- "-n",
55
- "--no-exec",
56
- action="store_true",
57
- help="no execute, just print the command line",
58
- )
59
- parser.add_argument(
60
- "--path", action="append", default=[], help="additional $PATH directory"
61
- )
62
- parser.add_argument(
63
- "-q",
64
- "--quiet",
65
- action="store_true",
66
- help="quiet, don't print anything unless there are failures",
67
- )
68
- parser.add_argument(
69
- "-v",
70
- "--verbose",
71
- action="store_true",
72
- help="print configuration info and test results.",
73
- )
74
- parser.add_argument("tests", nargs="*")
75
- args = parser.parse_args(argv[1:])
76
-
77
- if args.chdir:
78
- os.chdir(args.chdir)
79
-
80
- if args.path:
81
- extra_path = [os.path.abspath(p) for p in args.path]
82
- extra_path = os.pathsep.join(extra_path)
83
- os.environ["PATH"] = extra_path + os.pathsep + os.environ["PATH"]
84
-
85
- if not args.tests:
86
- if not args.all:
87
- sys.stderr.write("Specify -a to get all tests.\n")
88
- return 1
89
- args.tests = ["test"]
90
-
91
- tests = []
92
- for arg in args.tests:
93
- if os.path.isdir(arg):
94
- tests.extend(find_all_gyptest_files(os.path.normpath(arg)))
95
- else:
96
- if not is_test_name(os.path.basename(arg)):
97
- print(arg, "is not a valid gyp test name.", file=sys.stderr)
98
- sys.exit(1)
99
- tests.append(arg)
100
-
101
- if args.list:
102
- for test in tests:
103
- print(test)
104
- sys.exit(0)
105
-
106
- os.environ["PYTHONPATH"] = os.path.abspath("test/lib")
107
-
108
- if args.verbose:
109
- print_configuration_info()
110
-
111
- if args.gyp_option and not args.quiet:
112
- print("Extra Gyp options: %s\n" % args.gyp_option)
113
-
114
- if args.format:
115
- format_list = args.format.split(",")
116
- else:
117
- format_list = {
118
- "aix5": ["make"],
119
- "freebsd7": ["make"],
120
- "freebsd8": ["make"],
121
- "openbsd5": ["make"],
122
- "cygwin": ["msvs"],
123
- "win32": ["msvs", "ninja"],
124
- "linux": ["make", "ninja"],
125
- "linux2": ["make", "ninja"],
126
- "linux3": ["make", "ninja"],
127
- # TODO: Re-enable xcode-ninja.
128
- # https://bugs.chromium.org/p/gyp/issues/detail?id=530
129
- # 'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'],
130
- "darwin": ["make", "ninja", "xcode"],
131
- }[sys.platform]
132
-
133
- gyp_options = []
134
- for option in args.gyp_option:
135
- gyp_options += ["-G", option]
136
-
137
- runner = Runner(format_list, tests, gyp_options, args.verbose)
138
- runner.run()
139
-
140
- if not args.quiet:
141
- runner.print_results()
142
-
143
- return 1 if runner.failures else 0
144
-
145
-
146
- def print_configuration_info():
147
- print("Test configuration:")
148
- if sys.platform == "darwin":
149
- sys.path.append(os.path.abspath("test/lib"))
150
- import TestMac
151
-
152
- print(f" Mac {platform.mac_ver()[0]} {platform.mac_ver()[2]}")
153
- print(f" Xcode {TestMac.Xcode.Version()}")
154
- elif sys.platform == "win32":
155
- sys.path.append(os.path.abspath("pylib"))
156
- import gyp.MSVSVersion
157
-
158
- print(" Win %s %s\n" % platform.win32_ver()[0:2])
159
- print(" MSVS %s" % gyp.MSVSVersion.SelectVisualStudioVersion().Description())
160
- elif sys.platform in ("linux", "linux2"):
161
- print(" Linux %s" % " ".join(platform.linux_distribution()))
162
- print(f" Python {platform.python_version()}")
163
- print(f" PYTHONPATH={os.environ['PYTHONPATH']}")
164
- print()
165
-
166
-
167
- class Runner:
168
- def __init__(self, formats, tests, gyp_options, verbose):
169
- self.formats = formats
170
- self.tests = tests
171
- self.verbose = verbose
172
- self.gyp_options = gyp_options
173
- self.failures = []
174
- self.num_tests = len(formats) * len(tests)
175
- num_digits = len(str(self.num_tests))
176
- self.fmt_str = "[%%%dd/%%%dd] (%%s) %%s" % (num_digits, num_digits)
177
- self.isatty = sys.stdout.isatty() and not self.verbose
178
- self.env = os.environ.copy()
179
- self.hpos = 0
180
-
181
- def run(self):
182
- run_start = time.time()
183
-
184
- i = 1
185
- for fmt in self.formats:
186
- for test in self.tests:
187
- self.run_test(test, fmt, i)
188
- i += 1
189
-
190
- if self.isatty:
191
- self.erase_current_line()
192
-
193
- self.took = time.time() - run_start
194
-
195
- def run_test(self, test, fmt, i):
196
- if self.isatty:
197
- self.erase_current_line()
198
-
199
- msg = self.fmt_str % (i, self.num_tests, fmt, test)
200
- self.print_(msg)
201
-
202
- start = time.time()
203
- cmd = [sys.executable, test] + self.gyp_options
204
- self.env["TESTGYP_FORMAT"] = fmt
205
- proc = subprocess.Popen(
206
- cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=self.env
207
- )
208
- proc.wait()
209
- took = time.time() - start
210
-
211
- stdout = proc.stdout.read().decode("utf8")
212
- if proc.returncode == 2:
213
- res = "skipped"
214
- elif proc.returncode:
215
- res = "failed"
216
- self.failures.append(f"({test}) {fmt}")
217
- else:
218
- res = "passed"
219
- res_msg = f" {res} {took:.3f}s"
220
- self.print_(res_msg)
221
-
222
- if stdout and not stdout.endswith(("PASSED\n", "NO RESULT\n")):
223
- print()
224
- print("\n".join(f" {line}" for line in stdout.splitlines()))
225
- elif not self.isatty:
226
- print()
227
-
228
- def print_(self, msg):
229
- print(msg, end="")
230
- index = msg.rfind("\n")
231
- if index == -1:
232
- self.hpos += len(msg)
233
- else:
234
- self.hpos = len(msg) - index
235
- sys.stdout.flush()
236
-
237
- def erase_current_line(self):
238
- print("\b" * self.hpos + " " * self.hpos + "\b" * self.hpos, end="")
239
- sys.stdout.flush()
240
- self.hpos = 0
241
-
242
- def print_results(self):
243
- num_failures = len(self.failures)
244
- if num_failures:
245
- print()
246
- if num_failures == 1:
247
- print("Failed the following test:")
248
- else:
249
- print("Failed the following %d tests:" % num_failures)
250
- print("\t" + "\n\t".join(sorted(self.failures)))
251
- print()
252
- print(
253
- "Ran %d tests in %.3fs, %d failed."
254
- % (self.num_tests, self.took, num_failures)
255
- )
256
- print()
257
-
258
-
259
- if __name__ == "__main__":
260
- sys.exit(main())
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # Copyright (c) 2011 Google Inc. All rights reserved.
4
- # Use of this source code is governed by a BSD-style license that can be
5
- # found in the LICENSE file.
6
-
7
- """Using the JSON dumped by the dump-dependency-json generator,
8
- generate input suitable for graphviz to render a dependency graph of
9
- targets."""
10
-
11
-
12
- import collections
13
- import json
14
- import sys
15
-
16
-
17
- def ParseTarget(target):
18
- target, _, suffix = target.partition("#")
19
- filename, _, target = target.partition(":")
20
- return filename, target, suffix
21
-
22
-
23
- def LoadEdges(filename, targets):
24
- """Load the edges map from the dump file, and filter it to only
25
- show targets in |targets| and their depedendents."""
26
-
27
- file = open("dump.json")
28
- edges = json.load(file)
29
- file.close()
30
-
31
- # Copy out only the edges we're interested in from the full edge list.
32
- target_edges = {}
33
- to_visit = targets[:]
34
- while to_visit:
35
- src = to_visit.pop()
36
- if src in target_edges:
37
- continue
38
- target_edges[src] = edges[src]
39
- to_visit.extend(edges[src])
40
-
41
- return target_edges
42
-
43
-
44
- def WriteGraph(edges):
45
- """Print a graphviz graph to stdout.
46
- |edges| is a map of target to a list of other targets it depends on."""
47
-
48
- # Bucket targets by file.
49
- files = collections.defaultdict(list)
50
- for src, dst in edges.items():
51
- build_file, target_name, toolset = ParseTarget(src)
52
- files[build_file].append(src)
53
-
54
- print("digraph D {")
55
- print(" fontsize=8") # Used by subgraphs.
56
- print(" node [fontsize=8]")
57
-
58
- # Output nodes by file. We must first write out each node within
59
- # its file grouping before writing out any edges that may refer
60
- # to those nodes.
61
- for filename, targets in files.items():
62
- if len(targets) == 1:
63
- # If there's only one node for this file, simplify
64
- # the display by making it a box without an internal node.
65
- target = targets[0]
66
- build_file, target_name, toolset = ParseTarget(target)
67
- print(
68
- f' "{target}" [shape=box, label="{filename}\\n{target_name}"]'
69
- )
70
- else:
71
- # Group multiple nodes together in a subgraph.
72
- print(' subgraph "cluster_%s" {' % filename)
73
- print(' label = "%s"' % filename)
74
- for target in targets:
75
- build_file, target_name, toolset = ParseTarget(target)
76
- print(f' "{target}" [label="{target_name}"]')
77
- print(" }")
78
-
79
- # Now that we've placed all the nodes within subgraphs, output all
80
- # the edges between nodes.
81
- for src, dsts in edges.items():
82
- for dst in dsts:
83
- print(f' "{src}" -> "{dst}"')
84
-
85
- print("}")
86
-
87
-
88
- def main():
89
- if len(sys.argv) < 2:
90
- print(__doc__, file=sys.stderr)
91
- print(file=sys.stderr)
92
- print("usage: %s target1 target2..." % (sys.argv[0]), file=sys.stderr)
93
- return 1
94
-
95
- edges = LoadEdges("dump.json", sys.argv[1:])
96
-
97
- WriteGraph(edges)
98
- return 0
99
-
100
-
101
- if __name__ == "__main__":
102
- sys.exit(main())
@@ -1,156 +0,0 @@
1
- #!/usr/bin/env python3
2
-
3
- # Copyright (c) 2012 Google Inc. All rights reserved.
4
- # Use of this source code is governed by a BSD-style license that can be
5
- # found in the LICENSE file.
6
-
7
- """Pretty-prints the contents of a GYP file."""
8
-
9
-
10
- import sys
11
- import re
12
-
13
-
14
- # Regex to remove comments when we're counting braces.
15
- COMMENT_RE = re.compile(r"\s*#.*")
16
-
17
- # Regex to remove quoted strings when we're counting braces.
18
- # It takes into account quoted quotes, and makes sure that the quotes match.
19
- # NOTE: It does not handle quotes that span more than one line, or
20
- # cases where an escaped quote is preceded by an escaped backslash.
21
- QUOTE_RE_STR = r'(?P<q>[\'"])(.*?)(?<![^\\][\\])(?P=q)'
22
- QUOTE_RE = re.compile(QUOTE_RE_STR)
23
-
24
-
25
- def comment_replace(matchobj):
26
- return matchobj.group(1) + matchobj.group(2) + "#" * len(matchobj.group(3))
27
-
28
-
29
- def mask_comments(input):
30
- """Mask the quoted strings so we skip braces inside quoted strings."""
31
- search_re = re.compile(r"(.*?)(#)(.*)")
32
- return [search_re.sub(comment_replace, line) for line in input]
33
-
34
-
35
- def quote_replace(matchobj):
36
- return "{}{}{}{}".format(
37
- matchobj.group(1),
38
- matchobj.group(2),
39
- "x" * len(matchobj.group(3)),
40
- matchobj.group(2),
41
- )
42
-
43
-
44
- def mask_quotes(input):
45
- """Mask the quoted strings so we skip braces inside quoted strings."""
46
- search_re = re.compile(r"(.*?)" + QUOTE_RE_STR)
47
- return [search_re.sub(quote_replace, line) for line in input]
48
-
49
-
50
- def do_split(input, masked_input, search_re):
51
- output = []
52
- mask_output = []
53
- for (line, masked_line) in zip(input, masked_input):
54
- m = search_re.match(masked_line)
55
- while m:
56
- split = len(m.group(1))
57
- line = line[:split] + r"\n" + line[split:]
58
- masked_line = masked_line[:split] + r"\n" + masked_line[split:]
59
- m = search_re.match(masked_line)
60
- output.extend(line.split(r"\n"))
61
- mask_output.extend(masked_line.split(r"\n"))
62
- return (output, mask_output)
63
-
64
-
65
- def split_double_braces(input):
66
- """Masks out the quotes and comments, and then splits appropriate
67
- lines (lines that matche the double_*_brace re's above) before
68
- indenting them below.
69
-
70
- These are used to split lines which have multiple braces on them, so
71
- that the indentation looks prettier when all laid out (e.g. closing
72
- braces make a nice diagonal line).
73
- """
74
- double_open_brace_re = re.compile(r"(.*?[\[\{\(,])(\s*)([\[\{\(])")
75
- double_close_brace_re = re.compile(r"(.*?[\]\}\)],?)(\s*)([\]\}\)])")
76
-
77
- masked_input = mask_quotes(input)
78
- masked_input = mask_comments(masked_input)
79
-
80
- (output, mask_output) = do_split(input, masked_input, double_open_brace_re)
81
- (output, mask_output) = do_split(output, mask_output, double_close_brace_re)
82
-
83
- return output
84
-
85
-
86
- def count_braces(line):
87
- """keeps track of the number of braces on a given line and returns the result.
88
-
89
- It starts at zero and subtracts for closed braces, and adds for open braces.
90
- """
91
- open_braces = ["[", "(", "{"]
92
- close_braces = ["]", ")", "}"]
93
- closing_prefix_re = re.compile(r"(.*?[^\s\]\}\)]+.*?)([\]\}\)],?)\s*$")
94
- cnt = 0
95
- stripline = COMMENT_RE.sub(r"", line)
96
- stripline = QUOTE_RE.sub(r"''", stripline)
97
- for char in stripline:
98
- for brace in open_braces:
99
- if char == brace:
100
- cnt += 1
101
- for brace in close_braces:
102
- if char == brace:
103
- cnt -= 1
104
-
105
- after = False
106
- if cnt > 0:
107
- after = True
108
-
109
- # This catches the special case of a closing brace having something
110
- # other than just whitespace ahead of it -- we don't want to
111
- # unindent that until after this line is printed so it stays with
112
- # the previous indentation level.
113
- if cnt < 0 and closing_prefix_re.match(stripline):
114
- after = True
115
- return (cnt, after)
116
-
117
-
118
- def prettyprint_input(lines):
119
- """Does the main work of indenting the input based on the brace counts."""
120
- indent = 0
121
- basic_offset = 2
122
- for line in lines:
123
- if COMMENT_RE.match(line):
124
- print(line)
125
- else:
126
- line = line.strip("\r\n\t ") # Otherwise doesn't strip \r on Unix.
127
- if len(line) > 0:
128
- (brace_diff, after) = count_braces(line)
129
- if brace_diff != 0:
130
- if after:
131
- print(" " * (basic_offset * indent) + line)
132
- indent += brace_diff
133
- else:
134
- indent += brace_diff
135
- print(" " * (basic_offset * indent) + line)
136
- else:
137
- print(" " * (basic_offset * indent) + line)
138
- else:
139
- print("")
140
-
141
-
142
- def main():
143
- if len(sys.argv) > 1:
144
- data = open(sys.argv[1]).read().splitlines()
145
- else:
146
- data = sys.stdin.read().splitlines()
147
- # Split up the double braces.
148
- lines = split_double_braces(data)
149
-
150
- # Indent and print the output.
151
- prettyprint_input(lines)
152
- return 0
153
-
154
-
155
- if __name__ == "__main__":
156
- sys.exit(main())