-
Notifications
You must be signed in to change notification settings - Fork 77
implement step 3 of #1434 #1435
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
Open
PierreEtienneJ
wants to merge
12
commits into
useblocks:master
Choose a base branch
from
PierreEtienneJ:fix-#1434-need-ref-with-dots
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
implement step 3 of #1434 #1435
PierreEtienneJ
wants to merge
12
commits into
useblocks:master
from
PierreEtienneJ:fix-#1434-need-ref-with-dots
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
773b662
to
ff4264e
Compare
for more information, see https://pre-commit.ci
Python 3.9 reaches its end of life on [2025-10](https://devguide.python.org/versions/).
The `need_part`/`np` role is not a reference and should not use an `XRefRole` subclass (see useblocks#1437). In addition, the processing now correctly handles and warns on need parts that are not part of a need and `need` roles that reference an unknown part.
This fixes the docs build warnings emitted by RST highlighting: ``` <unknown>:1: SyntaxWarning: invalid escape sequence '\.' <string>:1: SyntaxWarning: invalid escape sequence '\.' <unknown>:1: SyntaxWarning: invalid escape sequence '\w' <string>:1: SyntaxWarning: invalid escape sequence '\w' ```
This is the implementation of the discussion useblocks#1451 and a follow-up on useblocks#1441. The PR adds schema validation to Sphinx-Needs that supports local validation and network validation. The Sphinx-Needs internal data type representation is not changed yet, all types are still strings. This will come shortly after merge. Users can already try out the new interface and provide feedback. Differences to PR 1441: - Aligning with standards in JSON schema for re-using subschemas via `$defs` and `$ref` - Fully typed implementation including runtime checks of valid schema user input - Auto inject the default string type if not given - Replace `trigger_schema` with `select` which aligns with query language terminology - Replace `trigger_schema_id` with the mentioned `$ref` mechanism - New schemas root key `validate` with sub-keys `local` and `network` for the 2 validation types - Network validation items does not allow the `select` key anymore as the selection happens by linking target needs. This cleans up an ambiguity in the other PR. - Network validation errors now bubble up to the root json schema and are displayed to see exactly why the chain fails - More network rule types for better control over debug schema output - Rewrite test cases to use a declarative definition as yaml, so all pieces can be given in one place: - conf.py - ubproject.toml - index.rst - schemas.json - expected ontology warnings - Simplified the code logic - String patterns (regex) are constrained to a basic subset that works across engines - Added docs - Examples and explanations - Comparison with `needs_warnings` and `needs_constraints` and migration path - Many more test cases - `items` with `minItems` and `maxItems` and `contains` with `minContains` and `maxContains` are now semantically equivalent to JSON schema spec --------- Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #1434, firstly only hot fix with step 3: update functions which used
split_need_id
to check need_id_main and need_id_full.