civics-cdf-validator 1.67.dev4__tar.gz → 1.67.dev5__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 (28) hide show
  1. {civics_cdf_validator-1.67.dev4/civics_cdf_validator.egg-info → civics_cdf_validator-1.67.dev5}/PKG-INFO +1 -1
  2. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5/civics_cdf_validator.egg-info}/PKG-INFO +1 -1
  3. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/civics_cdf_validator.egg-info/SOURCES.txt +1 -0
  4. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rules.py +2 -17
  5. civics_cdf_validator-1.67.dev5/rulesets/election_dates_rules.py +40 -0
  6. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/version.py +1 -1
  7. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/CONTRIBUTING.md +0 -0
  8. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/LICENSE-2.0.txt +0 -0
  9. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/MANIFEST.in +0 -0
  10. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/README.md +0 -0
  11. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/__init__.py +0 -0
  12. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/base.py +0 -0
  13. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/civics_cdf_validator.egg-info/dependency_links.txt +0 -0
  14. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/civics_cdf_validator.egg-info/entry_points.txt +0 -0
  15. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/civics_cdf_validator.egg-info/requires.txt +0 -0
  16. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/civics_cdf_validator.egg-info/top_level.txt +0 -0
  17. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/gpunit_rules.py +0 -0
  18. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/loggers.py +0 -0
  19. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/office_utils.py +0 -0
  20. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rulesets/__init__.py +0 -0
  21. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rulesets/common_rules.py +0 -0
  22. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rulesets/election_rules.py +0 -0
  23. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rulesets/officeholder_rules.py +0 -0
  24. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/rulesets/rule_util.py +0 -0
  25. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/setup.cfg +0 -0
  26. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/setup.py +0 -0
  27. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/stats.py +0 -0
  28. {civics_cdf_validator-1.67.dev4 → civics_cdf_validator-1.67.dev5}/validator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: civics_cdf_validator
3
- Version: 1.67.dev4
3
+ Version: 1.67.dev5
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.dev4
3
+ Version: 1.67.dev5
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
@@ -17,6 +17,7 @@ setup.py
17
17
  ./version.py
18
18
  ./rulesets/__init__.py
19
19
  ./rulesets/common_rules.py
20
+ ./rulesets/election_dates_rules.py
20
21
  ./rulesets/election_rules.py
21
22
  ./rulesets/officeholder_rules.py
22
23
  ./rulesets/rule_util.py
@@ -23,6 +23,7 @@ from botocore import utils as botocore_utils
23
23
  from civics_cdf_validator import base
24
24
  from civics_cdf_validator import loggers
25
25
  from civics_cdf_validator.rulesets import common_rules
26
+ from civics_cdf_validator.rulesets import election_dates_rules
26
27
  from civics_cdf_validator.rulesets import election_rules
27
28
  from civics_cdf_validator.rulesets import officeholder_rules
28
29
  from civics_cdf_validator.rulesets import rule_util
@@ -489,22 +490,6 @@ class FeedInactiveDateSetForNonEvergreenFeed(base.BaseRule):
489
490
  )
490
491
 
491
492
 
492
- class UnreferencedEntitiesElectionDates(common_rules.UnreferencedEntitiesBase):
493
- """CDF elections and contests are top-level in election dates feeds.
494
-
495
- All other entity types must be referenced.
496
- """
497
-
498
- def __init__(self, election_tree, schema_tree, **kwargs):
499
- super(UnreferencedEntitiesElectionDates, self).__init__(
500
- election_tree,
501
- schema_tree,
502
- frozenset(["Election", "Contest"]),
503
- frozenset([]),
504
- **kwargs,
505
- )
506
-
507
-
508
493
  class ElectoralCommissionCollectionExists(base.BaseRule):
509
494
  """ElectoralCommissionCollection should exist."""
510
495
 
@@ -673,6 +658,7 @@ class RuleSet(enum.Enum):
673
658
  COMMON_RULES = common_rules.COMMON_RULES
674
659
  OFFICEHOLDER_RULES = officeholder_rules.OFFICEHOLDER_RULES
675
660
  ELECTION_RULES = election_rules.ELECTION_RULES
661
+ ELECTION_DATES_RULES = election_dates_rules.ELECTION_DATES_RULES
676
662
 
677
663
 
678
664
  COMMITTEE_RULES = COMMON_RULES + (
@@ -685,7 +671,6 @@ COMMITTEE_RULES = COMMON_RULES + (
685
671
  # go/keep-sorted end
686
672
  )
687
673
 
688
- ELECTION_DATES_RULES = ELECTION_RULES + (UnreferencedEntitiesElectionDates,)
689
674
 
690
675
  METADATA_RULES = (
691
676
  # go/keep-sorted start
@@ -0,0 +1,40 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # https://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """Validation rules for election dates feeds of the CDF XML validator."""
15
+
16
+ from __future__ import print_function
17
+
18
+ from civics_cdf_validator.rulesets import common_rules
19
+ from civics_cdf_validator.rulesets import election_rules
20
+
21
+
22
+ class UnreferencedEntitiesElectionDates(common_rules.UnreferencedEntitiesBase):
23
+ """CDF elections and contests are top-level in election dates feeds.
24
+
25
+ All other entity types must be referenced.
26
+ """
27
+
28
+ def __init__(self, election_tree, schema_tree, **kwargs):
29
+ super(UnreferencedEntitiesElectionDates, self).__init__(
30
+ election_tree,
31
+ schema_tree,
32
+ frozenset(["Election", "Contest"]),
33
+ frozenset([]),
34
+ **kwargs,
35
+ )
36
+
37
+
38
+ ELECTION_DATES_RULES = election_rules.ELECTION_RULES + (
39
+ UnreferencedEntitiesElectionDates,
40
+ )
@@ -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.dev4'
8
+ __version__ = '1.67.dev5'