Skip to content

Commit

Permalink
Revert package version check change
Browse files Browse the repository at this point in the history
Reverts a change upping the minimum version checked before running a number of validator functions.  Was updated to match most recent version number, checks are actually needed above 1.1.0.
  • Loading branch information
ItIsJordan committed Jun 26, 2023
1 parent cd8a881 commit 95885b5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion hepdata_validator/data_file_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def validate(self, **kwargs):
try:
self.check_error_values(file_path, data)
self.check_length_values(file_path, data)
if self.schema_version >= packaging_version.parse("1.1.1"):
if self.schema_version >= packaging_version.parse("1.1.0"):
self.check_independent_variable_values(file_path, data)
except Exception:
# If the file did not validate against the schema, we
Expand Down
2 changes: 1 addition & 1 deletion hepdata_validator/full_submission_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def validate(self, directory=None, file=None, archive=None):
self.valid_files[type] = [self._remove_temp_directory(self.submission_file_path)]

# Check all files in directory are in included_files
if not self.single_yaml_file and self.schema_version >= packaging_version.parse("1.1.1"):
if not self.single_yaml_file and self.schema_version >= packaging_version.parse("1.1.0"):
# helper to check if a provided file is not meant to describe HEP data, but rather
# represents "extended attributes" (e.g.) as a result of BSD tar (default on MacOS)
# which creates these extra files when archiving files with extended attributes on
Expand Down
8 changes: 4 additions & 4 deletions hepdata_validator/submission_file_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, *args, **kwargs):
super(SubmissionFileValidator, self).__init__(*args, **kwargs)
self.default_schema_file = self._get_schema_filepath(self.submission_filename)
self.additional_info_schema = self._get_schema_filepath(self.additional_info_filename)
if self.schema_version >= packaging_version.parse("1.1.1"):
if self.schema_version >= packaging_version.parse("1.1.0"):
self.additional_resources_schema = self._get_schema_filepath(self.additional_resources_filename)

def validate(self, **kwargs):
Expand All @@ -49,7 +49,7 @@ def validate(self, **kwargs):
additional_file_section_schema = json.load(additional_schema)

resolver = None
if self.schema_version >= packaging_version.parse("1.1.1"):
if self.schema_version >= packaging_version.parse("1.1.0"):
with open(self.additional_resources_schema, 'r') as additional_schema:
additional_resources_schema = json.load(additional_schema)

Expand Down Expand Up @@ -97,7 +97,7 @@ def validate(self, **kwargs):
except ValidationError as ve:
self.add_validation_error(file_path, ve)

if not has_submission_doc and self.schema_version >= packaging_version.parse("1.1.1"):
if not has_submission_doc and self.schema_version >= packaging_version.parse("1.1.0"):
# It's possible that all data items match the additional_file_section_schema
# just by having properties that don't match any items in there. So we need
# to make sure that we have at least one valid submission doc.
Expand All @@ -109,7 +109,7 @@ def validate(self, **kwargs):
)


if self.schema_version >= packaging_version.parse("1.1.1"):
if self.schema_version >= packaging_version.parse("1.1.0"):
self.check_for_duplicates(file_path, table_names, table_data_files)

if not self.has_errors(file_path):
Expand Down

0 comments on commit 95885b5

Please sign in to comment.