Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 compatibility #4

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions hepdata_validator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

from __future__ import print_function
from builtins import object
import abc

from .version import __version__
from future.utils import with_metaclass

__all__ = ('__version__', )

class Validator(object):
class Validator(with_metaclass(abc.ABCMeta, object)):
"""
Provides a general 'interface' for Validator in HEPdata
which validates schema files created with the
JSONschema syntax http://json-schema.org/
"""
__metaclass__ = abc.ABCMeta

messages = {}
default_schema_file = ''
Expand Down Expand Up @@ -100,7 +102,7 @@ def print_errors(self, file_name):
Prints the errors observed for a file
"""
for error in self.get_messages(file_name):
print('\t', error.__unicode__())
print(('\t', error.__unicode__()))


class ValidationMessage(object):
Expand Down
1 change: 1 addition & 0 deletions hepdata_validator/data_file_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# waive the privileges and immunities granted to it by virtue of its status
# as an Intergovernmental Organization or submit itself to any jurisdiction.

from builtins import str
import json

import os
Expand Down
1 change: 1 addition & 0 deletions hepdata_validator/submission_file_validator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from builtins import str
import json
from jsonschema import validate, ValidationError
import os
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pytest>=2.7.0
coverage
coveralls
future
pyyaml
jsonschema
pytest-cov
pytest-cov
1 change: 1 addition & 0 deletions testsuite/validation_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import print_function
import os
import unittest

Expand Down