Skip to content
Merged
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
20 changes: 6 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
# Copyright (C) 2021-2026 CERN.
#
# Invenio App RDM is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
# CDS-DoJSON is free software; you can redistribute it and/or modify it
# under the terms of the Revised BSD License; see LICENSE file for more details.

name: CI

Expand All @@ -21,18 +21,12 @@ on:

jobs:
Tests:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
runs-on: ubuntu-latest
Comment thread
callumlewis05 marked this conversation as resolved.
strategy:
fail-fast: false
matrix:
python-version: [3.9]
requirements-level: [pypi]
experimental: [false]
include:
- python-version: 3.12
experimental: true
python-version: ["3.9", "3.12", "3.14"]
env:
DB: ${{ matrix.db-service }}
EXTRAS: tests

steps:
Expand All @@ -50,8 +44,6 @@ jobs:
run: |
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker compose --version

- name: Run tests
run: ./run-tests.sh
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changes
=======

Version 0.14.0 (released 2026-10-13)
-----------------------------------

- chore(format): ran new black and isort formatters on code
- update(python): update python version support and tests

Version 0.13.0 (released 2024-09-30)
-----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cds_dojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@

"""The CDS DoJson."""

__version__ = "0.13.0"
__version__ = "0.14.0"
10 changes: 5 additions & 5 deletions cds_dojson/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ def cli():


@cli.command()
@click.argument('schema', type=click.Path(exists=True))
@click.argument("schema", type=click.Path(exists=True))
def compile_schema(schema):
"""Compile ``$ref`` and ``allOf`` key from the given JSON schema."""
with open(schema) as f:
schema_json = json.load(f)

base_uri = 'file://{0}/'.format(os.path.dirname(os.path.abspath(schema)))
base_uri = "file://{0}/".format(os.path.dirname(os.path.abspath(schema)))

click.echo(json.dumps(_compile_schema(schema_json, base_uri), indent=2))


@cli.command()
@click.argument('source', type=click.Path(exists=True))
@click.argument('destination', type=click.Path())
@click.argument("source", type=click.Path(exists=True))
@click.argument("destination", type=click.Path())
def convert_yaml2json(source, destination):
"""Convert files from yaml to json."""
if sys.version_info[0] <= 3 and sys.version_info[1] < 6:
click.echo('Use Python 3.6+ to deterministically generate the json.')
click.echo("Use Python 3.6+ to deterministically generate the json.")
yaml2json(source, destination)
1 change: 0 additions & 1 deletion cds_dojson/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ class ModelMissingException(Exception):

class MultipleModelsException(Exception):
"""CDSDoJSONException class."""

2 changes: 1 addition & 1 deletion cds_dojson/marc21/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@

from ..overdo import OverdoBase

marc21 = OverdoBase(entry_point_models='cds_dojson.marc21.models')
marc21 = OverdoBase(entry_point_models="cds_dojson.marc21.models")
16 changes: 7 additions & 9 deletions cds_dojson/marc21/fields/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,27 @@
from ..models.base import model


@model.over('recid', '^001')
@model.over("recid", "^001")
def recid(self, key, value):
"""Record Identifier."""
return int(value)


@model.over('agency_code', '^003')
@model.over("agency_code", "^003")
def agency_code(self, key, value):
"""Control number identifier."""
return 'SzGeCERN'
return "SzGeCERN"


@model.over('videos', '^774')
@model.over("videos", "^774")
@for_each_value
def videos(self, key, value):
"""Videos."""
return {
'$ref': value.get('u')
}
return {"$ref": value.get("u")}


@model.over('modified_by', '^937__')
@model.over("modified_by", "^937__")
@ignore_value
def modified_by(self, key, value):
"""Modified by."""
return value.get('s')
return value.get("s")
Loading
Loading