civics-cdf-validator 1.68.dev12__tar.gz → 1.68.dev13__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 (32) hide show
  1. {civics_cdf_validator-1.68.dev12/civics_cdf_validator.egg-info → civics_cdf_validator-1.68.dev13}/PKG-INFO +1 -1
  2. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
  3. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/common_rules.py +4 -4
  4. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_rules.py +1 -1
  5. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/version.py +1 -1
  6. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/CONTRIBUTING.md +0 -0
  7. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/LICENSE-2.0.txt +0 -0
  8. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/MANIFEST.in +0 -0
  9. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/README.md +0 -0
  10. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/__init__.py +0 -0
  11. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/base.py +9 -9
  12. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
  13. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
  14. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
  15. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/requires.txt +0 -0
  16. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/civics_cdf_validator.egg-info/top_level.txt +0 -0
  17. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/gpunit_rules.py +0 -0
  18. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/loggers.py +0 -0
  19. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/office_utils.py +0 -0
  20. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rules.py +0 -0
  21. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/__init__.py +0 -0
  22. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/committee_rules.py +0 -0
  23. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_dates_rules.py +0 -0
  24. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/election_results_rules.py +0 -0
  25. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/metadata_rules.py +0 -0
  26. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/officeholder_rules.py +0 -0
  27. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/rule_util.py +0 -0
  28. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/rulesets/voter_information_rules.py +0 -0
  29. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/setup.cfg +0 -0
  30. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/setup.py +0 -0
  31. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/stats.py +0 -0
  32. {civics_cdf_validator-1.68.dev12 → civics_cdf_validator-1.68.dev13}/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.68.dev12
3
+ Version: 1.68.dev13
4
4
  Summary: Checks if an election feed follows best practices
5
5
  Home-page: https://github.com/google/civics_cdf_validator
6
6
  Author: Google Civics
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.68.dev12
3
+ Version: 1.68.dev13
4
4
  Summary: Checks if an election feed follows best practices
5
5
  Home-page: https://github.com/google/civics_cdf_validator
6
6
  Author: Google Civics
@@ -243,7 +243,7 @@ class EmptyText(base.BaseRule):
243
243
  raise loggers.ElectionError.from_message("Text is empty", element)
244
244
 
245
245
 
246
- class EmptyString(base.BaseRule):
246
+ class EmptyString(base.SchemaRule):
247
247
  """Check that string fields are not empty or strictly whitespace."""
248
248
 
249
249
  def elements(self):
@@ -599,7 +599,7 @@ class OtherType(base.BaseRule):
599
599
  raise loggers.ElectionError.from_message(msg, [element])
600
600
 
601
601
 
602
- class UniqueLabel(base.BaseRule):
602
+ class UniqueLabel(base.SchemaRule):
603
603
  """Labels should be unique within a file."""
604
604
 
605
605
  def __init__(self, *args, **kwargs):
@@ -1742,7 +1742,7 @@ class MissingOfficeSelectionMethod(base.BaseRule):
1742
1742
  )
1743
1743
 
1744
1744
 
1745
- class AllInternationalizedTextHaveEnVersion(base.BaseRule):
1745
+ class AllInternationalizedTextHaveEnVersion(base.SchemaRule):
1746
1746
  """Checks for InternationalizedText elements missing an English version."""
1747
1747
 
1748
1748
  def elements(self):
@@ -1811,7 +1811,7 @@ class ProhibitElectionData(base.TreeRule):
1811
1811
  )
1812
1812
 
1813
1813
 
1814
- class UnreferencedEntitiesBase(base.TreeRule):
1814
+ class UnreferencedEntitiesBase(base.TreeRule, base.SchemaRule):
1815
1815
  """All non-top-level entities in a feed should be referenced by at least one other entity.
1816
1816
 
1817
1817
  In the context of this rule, top-level means that an entity is not expected to
@@ -716,7 +716,7 @@ class VoteCountTypesCoherency(base.BaseRule):
716
716
  raise loggers.ElectionError.from_message(msg, [element])
717
717
 
718
718
 
719
- class VoteCountValidSeatsDeltaTypes(base.BaseRule):
719
+ class VoteCountValidSeatsDeltaTypes(base.SchemaRule):
720
720
  """Ensure VoteCount seats delta types are valid."""
721
721
 
722
722
  def elements(self):
@@ -5,4 +5,4 @@ No dependencies should be added to this module.
5
5
  See https://packaging.python.org/guides/single-sourcing-package-version/
6
6
  """
7
7
 
8
- __version__ = '1.68.dev12'
8
+ __version__ = '1.68.dev13'
@@ -97,6 +97,15 @@ class BaseRule(SchemaHandler):
97
97
  def setup(self):
98
98
  """Perform any rule specific setup before checking."""
99
99
 
100
+
101
+ class SchemaRule(BaseRule):
102
+ """Rule that needs the schema tree to be present."""
103
+
104
+ def __init__(self, *args, **kwargs):
105
+ super(SchemaRule, self).__init__(*args, **kwargs)
106
+ if self.schema_tree is None:
107
+ raise ValueError(f"{type(self).__name__} requires a schema_tree.")
108
+
100
109
  def get_element_names_for_types(self, element_types: Set[str]) -> set[str]:
101
110
  element_names = set()
102
111
  for _, element in etree.iterwalk(self.schema_tree):
@@ -138,15 +147,6 @@ class BaseRule(SchemaHandler):
138
147
  return subtypes
139
148
 
140
149
 
141
- class SchemaRule(BaseRule):
142
- """Rule that needs the schema tree to be present."""
143
-
144
- def __init__(self, *args, **kwargs):
145
- super(SchemaRule, self).__init__(*args, **kwargs)
146
- if self.schema_tree is None:
147
- raise ValueError(f"{type(self).__name__} requires a schema_tree.")
148
-
149
-
150
150
  class TreeRule(BaseRule):
151
151
  """Rule that checks entire tree."""
152
152