civics-cdf-validator 1.67.dev17__tar.gz → 1.67.dev18__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 (31) hide show
  1. {civics_cdf_validator-1.67.dev17/civics_cdf_validator.egg-info → civics_cdf_validator-1.67.dev18}/PKG-INFO +1 -1
  2. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
  3. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/common_rules.py +15 -0
  4. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/election_rules.py +0 -15
  5. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/version.py +1 -1
  6. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/CONTRIBUTING.md +0 -0
  7. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/LICENSE-2.0.txt +0 -0
  8. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/MANIFEST.in +0 -0
  9. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/README.md +0 -0
  10. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/__init__.py +0 -0
  11. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/base.py +0 -0
  12. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/civics_cdf_validator.egg-info/SOURCES.txt +0 -0
  13. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
  14. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
  15. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/civics_cdf_validator.egg-info/requires.txt +0 -0
  16. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/civics_cdf_validator.egg-info/top_level.txt +0 -0
  17. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/gpunit_rules.py +0 -0
  18. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/loggers.py +0 -0
  19. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/office_utils.py +0 -0
  20. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rules.py +0 -0
  21. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/__init__.py +0 -0
  22. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/committee_rules.py +0 -0
  23. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/election_dates_rules.py +0 -0
  24. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/metadata_rules.py +0 -0
  25. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/officeholder_rules.py +0 -0
  26. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/rule_util.py +0 -0
  27. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/rulesets/voter_information_rules.py +0 -0
  28. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/setup.cfg +0 -0
  29. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/setup.py +0 -0
  30. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/stats.py +0 -0
  31. {civics_cdf_validator-1.67.dev17 → civics_cdf_validator-1.67.dev18}/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.67.dev17
3
+ Version: 1.67.dev18
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.67.dev17
3
+ Version: 1.67.dev18
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
@@ -1858,6 +1858,20 @@ class UnreferencedEntitiesBase(base.TreeRule):
1858
1858
  )
1859
1859
 
1860
1860
 
1861
+ class CoalitionParties(base.BaseRule):
1862
+ """Coalitions should always define the Party IDs."""
1863
+
1864
+ def elements(self):
1865
+ return ["Coalition"]
1866
+
1867
+ def check(self, element):
1868
+ party_id = element.find("PartyIds")
1869
+ if party_id is None or not party_id.text or not party_id.text.strip():
1870
+ raise loggers.ElectionError.from_message(
1871
+ "Coalition must define PartyIDs", [element]
1872
+ )
1873
+
1874
+
1861
1875
  COMMON_RULES = (
1862
1876
  # go/keep-sorted start
1863
1877
  AllCaps,
@@ -1865,6 +1879,7 @@ COMMON_RULES = (
1865
1879
  AllLanguages,
1866
1880
  BadCharactersInPersonFullName,
1867
1881
  CandidateImageInContactInformation,
1882
+ CoalitionParties,
1868
1883
  DeprecatedPartyLeadershipSchema,
1869
1884
  DiplomaticOfficesHaveCorrespondingGpUnitsSet,
1870
1885
  DuplicateGpUnits,
@@ -220,20 +220,6 @@ class PartisanPrimaryHeuristic(base.BaseRule):
220
220
  raise loggers.ElectionWarning.from_message(msg, [contest_elem])
221
221
 
222
222
 
223
- class CoalitionParties(base.BaseRule):
224
- """Coalitions should always define the Party IDs."""
225
-
226
- def elements(self):
227
- return ["Coalition"]
228
-
229
- def check(self, element):
230
- party_id = element.find("PartyIds")
231
- if party_id is None or not party_id.text or not party_id.text.strip():
232
- raise loggers.ElectionError.from_message(
233
- "Coalition must define PartyIDs", [element]
234
- )
235
-
236
-
237
223
  class CandidatesReferencedInRelatedContests(base.BaseRule):
238
224
  """Candidate should not be referred to by multiple unrelated contests.
239
225
 
@@ -2639,7 +2625,6 @@ ELECTION_RULES = common_rules.COMMON_RULES + (
2639
2625
  BallotTitle,
2640
2626
  CandidateContestTypesAreCompatible,
2641
2627
  CandidatesReferencedInRelatedContests,
2642
- CoalitionParties,
2643
2628
  ComposingContestIdsAreValidRelatedContests,
2644
2629
  ContestContainsValidEndDate,
2645
2630
  ContestContainsValidStartDate,
@@ -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.67.dev17'
8
+ __version__ = '1.67.dev18'