-
Notifications
You must be signed in to change notification settings - Fork 136
Implement git submodules for specs
#182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 17 commits
ca21290
a8db2af
b9d25d6
9ee13f0
b7086a5
342e7a2
5732daf
1fc8668
d984f26
592168c
e3de074
c195dcd
4a813dd
05df321
60654ae
d2f7920
0435f6a
8b4e912
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Main CI | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| strategy: | ||
| matrix: | ||
| python-version: | ||
| - '3.12' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| - name: Install testing dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements-test.txt | ||
| - name: Lint | ||
| # FIXME | ||
| continue-on-error: true | ||
| run: | | ||
| flake8 lib/pyld tests --count --show-source --statistics | ||
| env: | ||
| LOADER: ${{ matrix.loader }} | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| needs: [lint] | ||
| timeout-minutes: 10 | ||
| strategy: | ||
| matrix: | ||
| python-version: | ||
| - '3.8' | ||
| - '3.9' | ||
| - '3.10' | ||
| - '3.11' | ||
| - '3.12' | ||
| - 'pypy3.10' | ||
| loader: [requests, aiohttp] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Use Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| cache: 'pip' | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r requirements.txt | ||
| - name: Install testing dependencies | ||
| run: | | ||
| pip install -r requirements-test.txt | ||
| - name: Fetch test suites | ||
| run: | | ||
| git clone --depth 1 https://github.com/w3c/json-ld-api.git _json-ld-api | ||
| git clone --depth 1 https://github.com/w3c/json-ld-framing.git _json-ld-framing | ||
| git clone --depth 1 https://github.com/json-ld/normalization.git _normalization | ||
| - name: Test with Python=${{ matrix.python-version }} Loader=${{ matrix.loader }} | ||
| run: | | ||
| python tests/runtests.py ./_json-ld-api/tests -l ${{ matrix.loader }} | ||
| python tests/runtests.py ./_json-ld-framing/tests -l ${{ matrix.loader }} | ||
| python tests/runtests.py ./_normalization/tests -l ${{ matrix.loader }} | ||
| env: | ||
| LOADER: ${{ matrix.loader }} | ||
| #coverage: | ||
| # needs: [test] | ||
| # FIXME |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [submodule "specifications/json-ld-api"] | ||
| path = specifications/json-ld-api | ||
| url = git@github.com:w3c/json-ld-api.git | ||
|
|
||
| [submodule "specifications/json-ld-framing"] | ||
| path = specifications/json-ld-framing | ||
| url = git@github.com:w3c/json-ld-framing.git | ||
|
|
||
| [submodule "specifications/rdf-dataset-canonicalization"] | ||
| path = specifications/rdf-dataset-canonicalization | ||
| url = git@github.com:w3c-ccg/rdf-dataset-canonicalization.git | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| upgrade-submodules: | ||
| git submodule update --remote --init --recursive | ||
anatoly-scherbakov marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you remove all the checked out dirs without leaving git thinking there are unstaged changes? Put another way, how do you undo this command?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you want to undo the version upgrade of the submodules, you can do: If you've modified the submodules locally, after having them upgraded (for debugging purposes perhaps) then you do:
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we add those to the makefile for convenience?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| test: | ||
anatoly-scherbakov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| python tests/runtests.py | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| flake8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are the specs, but since their sole purpose here is for testing, could this be named
test-suites/? That's what the scripts in jsonld.js use.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing!
I can rename those. A few things concern me a bit though:
testsdirectory which will not be using the specifications, and the existence of bothtestsandtest-suiteswill be confusing;What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the
specifications/folder name, as I do hope/expect we'll get more unit tests added totests/at some point, andtest-suites/would certainly be confusing.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree keeping
specifications/, but should we not place it undertests/?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mielvds this will mean there will be a path like
tests/specifications/json-ld-api/tests/, lots of nesting. Also... what if we want to reuse specifications for different purposes other than tests?For instance, they could be extremely useful for LLM-assisted work on the library because specs are authoritatitve.