From 95462c36ae2d56fc9f9398c579763e0096c1be0e Mon Sep 17 00:00:00 2001 From: Miel Vander Sande Date: Fri, 5 Dec 2025 10:43:56 +0100 Subject: [PATCH 1/3] Bring back normalization and explain submodules in README --- .github/workflows/main.yaml | 1 + .gitmodules | 3 +++ README.rst | 22 ++++++++++++++++++++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 0a0289f..8dd09ba 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -67,6 +67,7 @@ jobs: run: | python tests/runtests.py ./specifications/json-ld-api/tests -l ${{ matrix.loader }} python tests/runtests.py ./specifications/json-ld-framing/tests -l ${{ matrix.loader }} + python tests/runtests.py ./specifications/normalization/tests -l ${{ matrix.loader }} env: LOADER: ${{ matrix.loader }} #coverage: diff --git a/.gitmodules b/.gitmodules index 29eae86..f4e5432 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "specifications/json-ld-framing"] path = specifications/json-ld-framing url = https://github.com/w3c/json-ld-framing.git +[submodule "specifications/normalization"] + path = specifications/normalization + url = https://github.com/json-ld/normalization.git diff --git a/README.rst b/README.rst index 6c387a3..92f856a 100644 --- a/README.rst +++ b/README.rst @@ -190,7 +190,23 @@ Tests This library includes a sample testing utility which may be used to verify that changes to the processor maintain the correct output. -To run the sample tests you will need to get the test suite files by cloning +To run the sample tests you will need to get the test suite files, which by default, are stored in the `specifications/` folder. +The test suites can be obtained by either using git submodules or by cloning them manually. + +## Using git submodules + +The test suites are included as git submodules to ensure versions are in sync. When cloning the repository, use the ``--recurse-submodules`` flag to +automatically clone the submodules. +If you have cloned the repository without the submodules, you can initialize them with the following commands: + +.. code-block:: bash + + git submodule init + git submodule update + +## Cloning manually + +You can also avoid using git submodules by manually cloning the ``json-ld-api``, ``json-ld-framing``, and ``normalization`` repositories hosted on GitHub: @@ -198,7 +214,9 @@ hosted on GitHub: - https://github.com/w3c/json-ld-framing - https://github.com/json-ld/normalization -If the suites repositories are available as sibling directories of the PyLD +## Running the tests + +If the suites repositories are available in the `specifications/` folder of the PyLD source directory, then all the tests can be run with the following: .. code-block:: bash From 373a9044b21cddf0dd5be68f9e3d23b81e36357d Mon Sep 17 00:00:00 2001 From: Miel Vander Sande Date: Fri, 5 Dec 2025 10:53:22 +0100 Subject: [PATCH 2/3] Make ./specifications/ the default test suite path --- README.rst | 17 ++++++++++++----- tests/runtests.py | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 92f856a..c0f36fb 100644 --- a/README.rst +++ b/README.rst @@ -208,11 +208,17 @@ If you have cloned the repository without the submodules, you can initialize the You can also avoid using git submodules by manually cloning the ``json-ld-api``, ``json-ld-framing``, and ``normalization`` repositories -hosted on GitHub: +hosted on GitHub using the following commands: -- https://github.com/w3c/json-ld-api -- https://github.com/w3c/json-ld-framing -- https://github.com/json-ld/normalization +.. code-block:: bash + + git clone https://github.com/w3c/json-ld-api ./specifications/json-ld-api + git clone https://github.com/w3c/json-ld-framing ./specifications/json-ld-framing + git clone https://github.com/json-ld/normalization ./specifications/normalization + +Note that you can clone these repositories into any location you wish; however, +if you do not clone them into the default ``specifications/`` folder, you will +need to provide the paths to the test runner as arguments when running the tests, as explained below ## Running the tests @@ -223,7 +229,8 @@ source directory, then all the tests can be run with the following: python tests/runtests.py -If you want to test individual manifest ``.jsonld`` files or directories +If you wish to store the test suites in a different location than the default +``specifications/`` folder, or you want to test individual manifest ``.jsonld`` files or directories containing a ``manifest.jsonld``, then you can supply these files or directories as arguments: diff --git a/tests/runtests.py b/tests/runtests.py index 9d2567e..5e4b943 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -97,9 +97,9 @@ def main(self): # default to find known sibling test dirs test_targets = [] sibling_dirs = [ - '../json-ld-api/tests/', - '../json-ld-framing/tests/', - '../normalization/tests/', + './specifications/json-ld-api/tests/', + './specifications/json-ld-framing/tests/', + './specifications/normalization/tests/', ] for dir in sibling_dirs: if os.path.exists(dir): From 52c41ad0ba52a7638c43da91b669a0abe2bb4afa Mon Sep 17 00:00:00 2001 From: Miel Vander Sande Date: Fri, 5 Dec 2025 11:01:07 +0100 Subject: [PATCH 3/3] Also add submodule itself --- specifications/normalization | 1 + 1 file changed, 1 insertion(+) create mode 160000 specifications/normalization diff --git a/specifications/normalization b/specifications/normalization new file mode 160000 index 0000000..fbcfce5 --- /dev/null +++ b/specifications/normalization @@ -0,0 +1 @@ +Subproject commit fbcfce5730bf2726c131a84d06ffb686a190a969