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/5] 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 0a0289fc..8dd09ba1 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 29eae86d..f4e5432a 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 6c387a3e..92f856a4 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/5] 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 92f856a4..c0f36fbb 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 9d2567ef..5e4b9435 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/5] 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 00000000..fbcfce57 --- /dev/null +++ b/specifications/normalization @@ -0,0 +1 @@ +Subproject commit fbcfce5730bf2726c131a84d06ffb686a190a969 From 099c4df850354930930a11fbcdf6575a9eb04aa1 Mon Sep 17 00:00:00 2001 From: Miel Vander Sande Date: Mon, 8 Dec 2025 09:30:45 +0100 Subject: [PATCH 4/5] Change sibling terminology and add mention in changelog --- CHANGELOG.md | 1 + tests/runtests.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dfee03c..a52df958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Minimize async related changes to library code in this release. - In sync environment use `asyncio.run`. - In async environment use background thread. +- The default test manifests or directories now default to the `./specifications`. ## 2.0.4 - 2024-02-16 diff --git a/tests/runtests.py b/tests/runtests.py index 5e4b9435..801ecad3 100644 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -94,14 +94,14 @@ def main(self): # tests given on command line test_targets = self.options.tests else: - # default to find known sibling test dirs + # default to find known test suite directories test_targets = [] - sibling_dirs = [ + spec_dirs = [ './specifications/json-ld-api/tests/', './specifications/json-ld-framing/tests/', './specifications/normalization/tests/', ] - for dir in sibling_dirs: + for dir in spec_dirs: if os.path.exists(dir): print('Test dir found', dir) test_targets.append(dir) From 42dfff0853f8362b48fd790f6a00a1e29e95f934 Mon Sep 17 00:00:00 2001 From: Miel Vander Sande Date: Mon, 8 Dec 2025 09:35:23 +0100 Subject: [PATCH 5/5] Word wrap at 80 --- README.rst | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index c0f36fbb..80499d37 100644 --- a/README.rst +++ b/README.rst @@ -190,14 +190,18 @@ 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, 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. +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 +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: +If you have cloned the repository without the submodules, you can initialize +them with the following commands: .. code-block:: bash @@ -218,21 +222,22 @@ hosted on GitHub using the following commands: 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 +need to provide the paths to the test runner as arguments when running the +tests, as explained below ## 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: +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 python tests/runtests.py 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: +``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: .. code-block:: bash