stone 3.3.7__tar.gz → 3.3.8__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.
Files changed (69) hide show
  1. {stone-3.3.7/stone.egg-info → stone-3.3.8}/PKG-INFO +1 -1
  2. {stone-3.3.7 → stone-3.3.8}/setup.py +1 -1
  3. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_types.py +17 -9
  4. {stone-3.3.7 → stone-3.3.8}/stone/frontend/ir_generator.py +2 -1
  5. {stone-3.3.7 → stone-3.3.8/stone.egg-info}/PKG-INFO +1 -1
  6. {stone-3.3.7 → stone-3.3.8}/LICENSE +0 -0
  7. {stone-3.3.7 → stone-3.3.8}/MANIFEST.in +0 -0
  8. {stone-3.3.7 → stone-3.3.8}/README.rst +0 -0
  9. {stone-3.3.7 → stone-3.3.8}/ez_setup.py +0 -0
  10. {stone-3.3.7 → stone-3.3.8}/setup.cfg +0 -0
  11. {stone-3.3.7 → stone-3.3.8}/stone/__init__.py +0 -0
  12. {stone-3.3.7 → stone-3.3.8}/stone/backend.py +0 -0
  13. {stone-3.3.7 → stone-3.3.8}/stone/backends/__init__.py +0 -0
  14. {stone-3.3.7 → stone-3.3.8}/stone/backends/helpers.py +0 -0
  15. {stone-3.3.7 → stone-3.3.8}/stone/backends/js_client.py +0 -0
  16. {stone-3.3.7 → stone-3.3.8}/stone/backends/js_helpers.py +0 -0
  17. {stone-3.3.7 → stone-3.3.8}/stone/backends/js_types.py +0 -0
  18. {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c.py +0 -0
  19. {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_client.py +0 -0
  20. {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_helpers.py +0 -0
  21. {stone-3.3.7 → stone-3.3.8}/stone/backends/obj_c_types.py +0 -0
  22. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_client.py +0 -0
  23. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_helpers.py +0 -0
  24. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/__init__.py +0 -0
  25. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_base.py +0 -0
  26. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_serializers.py +0 -0
  27. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_rsrc/stone_validators.py +0 -0
  28. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_type_mapping.py +0 -0
  29. {stone-3.3.7 → stone-3.3.8}/stone/backends/python_type_stubs.py +0 -0
  30. {stone-3.3.7 → stone-3.3.8}/stone/backends/swift.py +0 -0
  31. {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_client.py +0 -0
  32. {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_helpers.py +0 -0
  33. {stone-3.3.7 → stone-3.3.8}/stone/backends/swift_types.py +0 -0
  34. {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_client.py +0 -0
  35. {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_helpers.py +0 -0
  36. {stone-3.3.7 → stone-3.3.8}/stone/backends/tsd_types.py +0 -0
  37. {stone-3.3.7 → stone-3.3.8}/stone/cli.py +0 -0
  38. {stone-3.3.7 → stone-3.3.8}/stone/cli_helpers.py +0 -0
  39. {stone-3.3.7 → stone-3.3.8}/stone/compiler.py +0 -0
  40. {stone-3.3.7 → stone-3.3.8}/stone/frontend/__init__.py +0 -0
  41. {stone-3.3.7 → stone-3.3.8}/stone/frontend/ast.py +0 -0
  42. {stone-3.3.7 → stone-3.3.8}/stone/frontend/exception.py +0 -0
  43. {stone-3.3.7 → stone-3.3.8}/stone/frontend/frontend.py +0 -0
  44. {stone-3.3.7 → stone-3.3.8}/stone/frontend/lexer.py +0 -0
  45. {stone-3.3.7 → stone-3.3.8}/stone/frontend/parser.py +0 -0
  46. {stone-3.3.7 → stone-3.3.8}/stone/ir/__init__.py +0 -0
  47. {stone-3.3.7 → stone-3.3.8}/stone/ir/api.py +0 -0
  48. {stone-3.3.7 → stone-3.3.8}/stone/ir/data_types.py +0 -0
  49. {stone-3.3.7 → stone-3.3.8}/stone/py.typed +0 -0
  50. {stone-3.3.7 → stone-3.3.8}/stone/typing_hacks.py +0 -0
  51. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/SOURCES.txt +0 -0
  52. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/dependency_links.txt +0 -0
  53. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/entry_points.txt +0 -0
  54. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/not-zip-safe +0 -0
  55. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/requires.txt +0 -0
  56. {stone-3.3.7 → stone-3.3.8}/stone.egg-info/top_level.txt +0 -0
  57. {stone-3.3.7 → stone-3.3.8}/test/requirements.txt +0 -0
  58. {stone-3.3.7 → stone-3.3.8}/test/test_backend.py +0 -0
  59. {stone-3.3.7 → stone-3.3.8}/test/test_cli.py +0 -0
  60. {stone-3.3.7 → stone-3.3.8}/test/test_js_client.py +0 -0
  61. {stone-3.3.7 → stone-3.3.8}/test/test_python_client.py +0 -0
  62. {stone-3.3.7 → stone-3.3.8}/test/test_python_gen.py +0 -0
  63. {stone-3.3.7 → stone-3.3.8}/test/test_python_type_stubs.py +0 -0
  64. {stone-3.3.7 → stone-3.3.8}/test/test_python_types.py +0 -0
  65. {stone-3.3.7 → stone-3.3.8}/test/test_stone.py +0 -0
  66. {stone-3.3.7 → stone-3.3.8}/test/test_stone_internal.py +0 -0
  67. {stone-3.3.7 → stone-3.3.8}/test/test_stone_route_whitelist.py +0 -0
  68. {stone-3.3.7 → stone-3.3.8}/test/test_tsd_client.py +0 -0
  69. {stone-3.3.7 → stone-3.3.8}/test/test_tsd_types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stone
3
- Version: 3.3.7
3
+ Version: 3.3.8
4
4
  Summary: Stone is an interface description language (IDL) for APIs.
5
5
  Home-page: https://github.com/dropbox/stone
6
6
  Author: Ken Elkabany
@@ -36,7 +36,7 @@ with open('README.rst') as f: # pylint: disable=W1514
36
36
 
37
37
  dist = setup(
38
38
  name='stone',
39
- version='3.3.7',
39
+ version='3.3.8',
40
40
  install_requires=install_reqs,
41
41
  setup_requires=setup_requires,
42
42
  tests_require=test_reqs,
@@ -640,15 +640,23 @@ class PythonTypesBackend(CodeBackend):
640
640
  dt, _, _ = unwrap(data_type)
641
641
  if is_struct_type(dt) or is_union_type(dt):
642
642
  annotation_types_seen = set()
643
- for _, annotation in dt.recursive_custom_annotations:
644
- if annotation.annotation_type not in annotation_types_seen:
645
- yield (annotation.annotation_type,
646
- generate_func_call(
647
- 'bb.make_struct_annotation_processor',
648
- args=[class_name_for_annotation_type(annotation.annotation_type, ns),
649
- 'processor']
650
- ))
651
- annotation_types_seen.add(annotation.annotation_type)
643
+ # If data type enumerates subtypes, recurse to subtypes instead which in turn collect parents' custom annotations
644
+ if is_struct_type(dt) and dt.has_enumerated_subtypes():
645
+ for subtype in dt.get_enumerated_subtypes():
646
+ for annotation_type, recursive_processor in self._generate_custom_annotation_processors(ns, subtype.data_type):
647
+ if annotation_type not in annotation_types_seen:
648
+ yield (annotation_type, recursive_processor)
649
+ annotation_types_seen.add(annotation_type)
650
+ else:
651
+ for _, annotation in dt.recursive_custom_annotations:
652
+ if annotation.annotation_type not in annotation_types_seen:
653
+ yield (annotation.annotation_type,
654
+ generate_func_call(
655
+ 'bb.make_struct_annotation_processor',
656
+ args=[class_name_for_annotation_type(annotation.annotation_type, ns),
657
+ 'processor']
658
+ ))
659
+ annotation_types_seen.add(annotation.annotation_type)
652
660
  elif is_list_type(dt):
653
661
  for annotation_type, recursive_processor in self._generate_custom_annotation_processors(
654
662
  ns, dt.data_type):
@@ -824,10 +824,11 @@ class IRGenerator:
824
824
 
825
825
  annotations = set()
826
826
 
827
- # collect data types from subtypes recursively
828
827
  if is_struct_type(data_type) or is_union_type(data_type):
828
+ # collect custom annotations from ancestor data types
829
829
  if data_type.parent_type:
830
830
  annotations.update(recurse(data_type.parent_type))
831
+ # collct custom annotations from nested data types
831
832
  for field in data_type.fields:
832
833
  annotations.update(recurse(field.data_type))
833
834
  # annotations can be defined directly on fields
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stone
3
- Version: 3.3.7
3
+ Version: 3.3.8
4
4
  Summary: Stone is an interface description language (IDL) for APIs.
5
5
  Home-page: https://github.com/dropbox/stone
6
6
  Author: Ken Elkabany
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes