Skip to content

Commit

Permalink
Merge pull request #38 from HEPData/fix-file-check-schema
Browse files Browse the repository at this point in the history
Check schema version before checking whether all files are included
  • Loading branch information
GraemeWatt authored Oct 7, 2021
2 parents 87b3119 + 621a207 commit 9c38835
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hepdata_validator/full_submission_validator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from enum import Enum
import gzip
import os.path
from packaging import version as packaging_version
import shutil
import tempfile
from urllib.parse import urlparse, urlunsplit
Expand Down Expand Up @@ -203,7 +204,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:
if not self.single_yaml_file and self.schema_version >= packaging_version.parse("1.1.0"):
for f in os.listdir(self.directory):
file_path = os.path.join(self.directory, f)
if file_path not in self.included_files:
Expand Down
2 changes: 1 addition & 1 deletion hepdata_validator/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@

from __future__ import absolute_import, print_function

__version__ = "0.3.0"
__version__ = "0.3.1"

0 comments on commit 9c38835

Please sign in to comment.