From a5fab04f47bd356c04937827bb2fb8d6f61fbed1 Mon Sep 17 00:00:00 2001 From: Simon Clematide Date: Sat, 19 Dec 2020 00:05:24 +0100 Subject: [PATCH] add pipenv with necessary tools and improve Makefile --- Makefile | 38 ++++++++++++++++++++++++++------------ Pipfile | 12 ++++++++++++ Pipfile.lock | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock diff --git a/Makefile b/Makefile index 8b9fbeb..b019187 100644 --- a/Makefile +++ b/Makefile @@ -2,25 +2,39 @@ + tests: - jsonschema -i examples/newspaper_issue/example0.json json/newspaper/issue.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/newspaper_issue/example1.json json/newspaper/issue.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/newspaper_page/example0.json json/newspaper/page.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/newspaper_page/example1.json json/newspaper/page.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/newspaper_page/example2.json json/newspaper/page.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/topic_model_topic_description/example0.json json/topic_model/topic_description.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/newspaper_contentitem/example0.json json/newspaper/contentitem.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/language_identification/example0.json json/language_identification/language_identification.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/language_identification/example1.json json/language_identification/language_identification.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" - jsonschema -i examples/language_identification/example2.json json/language_identification/language_identification.schema.json && printf "%s\n" OK || printf "%s\n" "FAIL" + jsonschema -i examples/newspaper_issue/example0.json json/newspaper/issue.schema.json && $(print-test-ok) || $(print-test-failed) + jsonschema -i examples/newspaper_issue/example1.json json/newspaper/issue.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/newspaper_page/example0.json json/newspaper/page.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/newspaper_page/example1.json json/newspaper/page.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/newspaper_page/example2.json json/newspaper/page.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/topic_model_topic_description/example0.json json/topic_model/topic_description.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/newspaper_contentitem/example0.json json/newspaper/contentitem.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/language_identification/example0.json json/language_identification/language_identification.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/language_identification/example1.json json/language_identification/language_identification.schema.json && $(print-test-ok)|| $(print-test-failed) + jsonschema -i examples/language_identification/example2.json json/language_identification/language_identification.schema.json && $(print-test-ok)|| $(print-test-failed) -clean-docs: - rm docs/* +clean-documentation: + rm -fv docs/* documentation: + # make sure to install the correct jsonschema2md tool: + # npm install -g @adobe/jsonschema2md jsonschema2md -d json/newspaper/ -n -v 06 -o docs jsonschema2md -d json/topic_model/ -n -v 06 -o docs jsonschema2md -d json/language_identification/ -n -v 06 -o docs #jsonschema2md -d json/linguistic_annotation/ -n -v 06 -o docs + + +########################################################################################## +# Simple macros for tests +define print-test-ok + printf "\033[92m%s\033[0m\n" "✓ Success!" +endef + +define print-test-failed + printf "\033[91m%s\033[0m\n" "✗ Failed!" +endef diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..e0f9bf9 --- /dev/null +++ b/Pipfile @@ -0,0 +1,12 @@ +[[source]] +name = "pypi" +url = "https://pypi.org/simple" +verify_ssl = true + +[dev-packages] + +[packages] +jsonschema = "*" + +[requires] +python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..92287bd --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,49 @@ +{ + "_meta": { + "hash": { + "sha256": "38cfc4f5568a2a86cd1dde840d1c55666c107df00cf6c7048bf3b9a495dda497" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.8" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": { + "attrs": { + "hashes": [ + "sha256:31b2eced602aa8423c2aea9c76a724617ed67cf9513173fd3a4f03e3a929c7e6", + "sha256:832aa3cde19744e49938b91fea06d69ecb9e649c93ba974535d08ad92164f700" + ], + "version": "==20.3.0" + }, + "jsonschema": { + "hashes": [ + "sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163", + "sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a" + ], + "index": "pypi", + "version": "==3.2.0" + }, + "pyrsistent": { + "hashes": [ + "sha256:2e636185d9eb976a18a8a8e96efce62f2905fea90041958d8cc2a189756ebf3e" + ], + "version": "==0.17.3" + }, + "six": { + "hashes": [ + "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", + "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" + ], + "version": "==1.15.0" + } + }, + "develop": {} +}