Skip to content
Commits on Source (5)
......@@ -27,7 +27,7 @@ PACKAGE=schema-salad
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
# `[[` conditional expressions.
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pep257 pytest flake8
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pep257 pytest-xdist flake8
COVBASE=coverage run --branch --append --source=${MODULE} \
--omit=schema_salad/tests/*
......@@ -109,11 +109,11 @@ format: autopep8
## pylint : run static code analysis on Python code
pylint: $(PYSOURCES)
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
$^ -j$(nproc)|| true
$^ -j0|| true
pylint_report.txt: ${PYSOURCES}
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
$^ -j$(nproc)> $@ || true
$^ -j0> $@ || true
diff_pylint_report: pylint_report.txt
diff-quality --violations=pylint pylint_report.txt
......@@ -166,7 +166,7 @@ diff-cover.html: coverage.xml
## test : run the ${MODULE} test suite
test: FORCE
python setup.py test
python setup.py test --addopts "-n auto"
sloccount.sc: ${PYSOURCES} Makefile
sloccount --duplicates --wide --details $^ > $@
......
Metadata-Version: 1.1
Name: schema-salad
Version: 3.0.20181129082112
Version: 3.0.20181206233650
Summary: Schema Annotations for Linked Avro Data (SALAD)
Home-page: https://github.com/common-workflow-language/schema_salad
Author: Common workflow language working group
......
python-schema-salad (3.0.20181206233650-1) UNRELEASED; urgency=medium
* New upstream version
* debhelper 11
-- Michael R. Crusoe <michael.crusoe@gmail.com> Mon, 24 Dec 2018 08:00:08 -0800
python-schema-salad (3.0.20181129082112-1) unstable; urgency=medium
* New upstream release
......
......@@ -4,7 +4,7 @@ Uploaders: Michael R. Crusoe <michael.crusoe@gmail.com>
Section: python
Testsuite: autopkgtest-pkg-python
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11~),
dh-python,
python3,
python3-all,
......@@ -19,7 +19,7 @@ Build-Depends: debhelper (>= 10),
python3-lockfile,
python3-typing-extensions,
help2man
Standards-Version: 4.2.1
Standards-Version: 4.3.0
Vcs-Browser: https://salsa.debian.org/med-team/python-schema-salad
Vcs-Git: https://salsa.debian.org/med-team/python-schema-salad.git
Homepage: http://www.commonwl.org
......
Metadata-Version: 1.1
Name: schema-salad
Version: 3.0.20181129082112
Version: 3.0.20181206233650
Summary: Schema Annotations for Linked Avro Data (SALAD)
Home-page: https://github.com/common-workflow-language/schema_salad
Author: Common workflow language working group
......
......@@ -64,6 +64,7 @@ schema_salad/tests/EDAM.owl
schema_salad/tests/Process.yml
schema_salad/tests/__init__.py
schema_salad/tests/bad_schema.yml
schema_salad/tests/bad_schema2.yml
schema_salad/tests/cwl-pre.yml
schema_salad/tests/frag.yml
schema_salad/tests/hello.txt
......
setuptools
requests>=1.0
ruamel.yaml<0.16,>=0.12.4
rdflib<4.3.0,>=4.2.2
rdflib-jsonld<0.5.0,>=0.3.0
mistune<0.9,>=0.8.1
CacheControl<0.12,>=0.11.7
lockfile>=0.9
mistune<0.9,>=0.8.1
rdflib-jsonld<0.5.0,>=0.3.0
rdflib<4.3.0,>=4.2.2
requests>=1.0
ruamel.yaml<0.16,>=0.12.4
setuptools
six>=1.8.0
typing-extensions
......
......@@ -122,10 +122,6 @@ class Schema(object):
# creates JSON properties directly from this dict.
props = property(lambda self: self._props)
# Read-only property dict. Non-reserved properties
other_props = property(lambda self: get_other_props(self._props, SCHEMA_RESERVED_PROPS),
doc="dictionary of non-reserved properties")
# utility functions to manipulate properties dict
def get_prop(self, key):
return self._props.get(key)
......@@ -272,8 +268,6 @@ class NamedSchema(Schema):
# read-only properties
name = property(lambda self: self.get_prop('name'))
namespace = property(lambda self: self.get_prop('namespace'))
fullname = property(lambda self: self._fullname)
class Field(object):
def __init__(self,
......@@ -326,14 +320,6 @@ class Field(object):
# read-only properties
default = property(lambda self: self.get_prop('default'))
has_default = property(lambda self: self._has_default)
order = property(lambda self: self.get_prop('order'))
doc = property(lambda self: self.get_prop('doc'))
props = property(lambda self: self._props)
# Read-only property dict. Non-reserved properties
other_props = property(lambda self: get_other_props(self._props, FIELD_RESERVED_PROPS),
doc="dictionary of non-reserved properties")
# utility functions to manipulate properties dict
def get_prop(self, key):
......@@ -386,7 +372,6 @@ class EnumSchema(NamedSchema):
# read-only properties
symbols = property(lambda self: self.get_prop('symbols'))
doc = property(lambda self: self.get_prop('doc'))
#
# Complex Types (recursive)
......@@ -523,7 +508,6 @@ class RecordSchema(NamedSchema):
# read-only properties
fields = property(lambda self: self.get_prop('fields'))
doc = property(lambda self: self.get_prop('doc'))
#
# Module Methods
......
......@@ -231,11 +231,10 @@ def main(argsl=None): # type: (List[str]) -> int
# Validate the schema document against the metaschema
try:
schema.validate_doc(metaschema_names, schema_doc,
metaschema_loader, args.strict,
source=schema_metadata.get("name"))
metaschema_loader, args.strict)
except validate.ValidationException as e:
_logger.error("While validating schema `%s`:\n%s" %
(args.schema, str(e)))
_logger.error("While validating schema `%s`:\n%s",
args.schema, str(e))
return 1
# Get the json-ld context and RDFS representation from the schema
......
......@@ -36,6 +36,8 @@ class PythonCodeGen(CodeGenBase):
self.out.write("""#
# This file was autogenerated using schema-salad-tool --codegen=python
# The code itself is released under the Apache 2.0 license and the help text is
# subject to the license of the original schema.
#
""")
......
......@@ -654,8 +654,9 @@ class Loader(object):
v.lc.filename = document.lc.filename
else:
raise validate.ValidationException(
"mapSubject '%s' value '%s' is not a dict"
"and does not have a mapPredicate", k, v)
"mapSubject '{}' value '{}' is not a dict "
"and does not have a mapPredicate.".format(
k, v))
else:
v = val
......
This diff is collapsed.
[
{
"name": "test",
"type": "enum",
},
]
......@@ -57,3 +57,7 @@ class TestErrors(unittest.TestCase):
argsl=[get_data("tests/bad_schema.yml")]))
self.assertEqual(1, schema_salad.main.main(
argsl=["--print-avro", get_data("tests/bad_schema.yml")]))
def test_bad_schema2(self):
self.assertEqual(1, schema_salad.main.main(
argsl=[get_data("tests/bad_schema2.yml")]))
......@@ -11,6 +11,6 @@ test = pytest
addopts = --pyarg schema_salad
[egg_info]
tag_build = .20181129082112
tag_build = .20181206233650
tag_date = 0