Skip to content

Commit

Permalink
global: backport schemas to py2
Browse files Browse the repository at this point in the history
  • Loading branch information
drjova committed Dec 11, 2024
1 parent 86580e2 commit f636cc6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@

import os

from jsonschema2rst.parser_runner import run_parser

from inspire_schemas import __version__
from jsonschema2rst.parser_runner import run_parser


def _generate_schemas_doc():
Expand Down
2 changes: 1 addition & 1 deletion inspire_schemas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

"""Schemas and utilities used in inspirehep."""

__version__ = "61.6.6"
__version__ = "61.6.2"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def _generate_json_schemas():
'check-manifest',
'coverage',
'isort~=4.0,>=4.3.0',
'pytest',
'pytest-cache',
'pytest-cov==2.6.1',
'pytest~=6.0,>=6.2.5',
Expand Down
1 change: 1 addition & 0 deletions tests/integration/test_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def expected_data_hep():
def input_data_hep():
return load_file('input_data_hep.yaml')


@pytest.fixture(scope='module')
def conference_data():
return load_json_file('conferences_example.json')
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_data_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,15 @@ def test_add_title():
]
assert result == expected


def test_add_creation_date():
builder = DataBuilder()
creation_date = "2020-01-01"
builder.add_creation_date(creation_date)
result = builder.record.get("creation_date")
assert result == creation_date


def test_add_doi():
builder = DataBuilder()
doi = "10.1234/example.doi"
Expand Down
6 changes: 4 additions & 2 deletions tests/unit/test_parsers_arxiv.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ def test_latex_to_unicode_preserves_comments():
expected = (u"A 4% measurement of $H_0$ using the cumulative"
u"distribution of strong-lensing time delays in doubly-imaged quasars")
result = ArxivParser.latex_to_unicode(
(u"A 4% measurement of $H_0$ using the cumulative"
u"distribution of strong-lensing time delays in doubly-imaged quasars")
(
u"A 4% measurement of $H_0$ using the cumulative"
u"distribution of strong-lensing time delays in doubly-imaged quasars"
)
)

assert result == expected
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_signature_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def test_add_raw_affiliation(subschema):
assert_field_valid(expected, builder.obj, 'raw_affiliations', subschema)


@pytest.mark.skipif(sys.version_info < (3,3), reason="`inspect.signature` requires python 3")
@pytest.mark.skipif(sys.version_info < (3, 3), reason="`inspect.signature` requires python 3")
@pytest.mark.parametrize('field_name', dir(SignatureBuilder))
def test_public_method_ignores_none_params(field_name):
builder = SignatureBuilder()
Expand Down

0 comments on commit f636cc6

Please sign in to comment.