Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace $ref & $dynamicRef support / RefResolver with the new referencing library #1049

Merged
merged 33 commits into from
Mar 14, 2023

Commits on Feb 21, 2023

  1. Drop support for 3.7.

    Referencing happens to not support it at the minute.
    
    It's close to EOL, so rather than adding it, I suspect
    it's droppable.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    0ce3cef View commit details
    Browse the repository at this point in the history
  2. Move to retrieving schemas from the jsonschema-specifications registry.

    Still will be tweaked as the referencing library's public API changes.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    bf94d57 View commit details
    Browse the repository at this point in the history
  3. Deprecate jsonschema.RefResolver from both places it is importable.

    Internal uses of it will be removed, replaced with referencing's
    resolution APIs, though RefResolver will continue to function during
    its deprecation period.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    238e711 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f6aa053 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2c8f643 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    52340d7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4ec24ab View commit details
    Browse the repository at this point in the history
  8. Move reference resolution to a (private) Validator method.

    This will make it easier to swap over to referencing's
    Resolver (while preserving backwards compat for anyone who
    passes a RefResolver to a Validator).
    
    At some point in the future this method may become public
    (which will make it easier for external dialects to resolve
    references) but let's keep it private for a bit until it's
    clear that the interface is stable -- a future draft might
    do crazy things like have adjacent properties to $ref affect
    the resolution behavior, which would make this method need to
    take more than just the $ref value.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    9da55df View commit details
    Browse the repository at this point in the history
  9. Deprecate Validator.resolver.

    It will imminently be replaced by referencing.Registry-based
    resolution.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    635dc13 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    69f3899 View commit details
    Browse the repository at this point in the history
  11. Make an evolve test not refer to reference resolution.

    Just avoids a deprecation warning when we switch over.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    2889feb View commit details
    Browse the repository at this point in the history
  12. Move Validator._resolver to _ref_resolver.

    Makes way for our newer resolver to live in the shorter name.
    
    (This should have no effect on the public API, where we have
    Validator.resolver returning this attribute after emitting a deprecation
    warning.)
    
    Also bumps the minimum attrs version we depend on, as we need the alias
    functionality.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    a39e5c9 View commit details
    Browse the repository at this point in the history
  13. Resolve $ref using the referencing library.

    Passes all the remaining referencing tests across all drafts, hooray!
    
    Makes Validators take a referencing.Registry argument which users should
    use to customize preloaded schemas, or to configure remote reference
    retrieval.
    
    This fully obsoletes jsonschema.RefResolver, which has already been
    deprecated in a previous commit. Users should move to instead loading
    schemas into referencing.Registry objects.
    
    See the referencing documentation at https://referencing.rtfd.io/ for
    details (with more jsonschema-specific information to be added shortly).
    
    Note that the interface for resolving references on a Validator is not
    yet public (and hidden behind _resolver and _validate_reference
    attributes). One or both of these are likely to become public after some
    period of stabilization.
    
    Feedback is of course welcome!
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    e826629 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    a93e88b View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    bdda723 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    a42bbd9 View commit details
    Browse the repository at this point in the history
  17. Update docs requirements.

    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    bd6a7d0 View commit details
    Browse the repository at this point in the history
  18. Pin to newer pyrsistent.

    <19.3 can have performance problems on 3.11 where there aren't
    wheels (and where I think it's falling back to using the pure-
    Python implementation even on CPython). Here it's ~2x slower.
    Julian committed Feb 21, 2023
    Configuration menu
    Copy the full SHA
    33e2882 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    fcea5ad View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2023

  1. Configuration menu
    Copy the full SHA
    34d19dc View commit details
    Browse the repository at this point in the history
  2. These pass now actually.

    Closes: #523
    Julian committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    8c4cd7c View commit details
    Browse the repository at this point in the history
  3. Style

    Julian committed Feb 22, 2023
    Configuration menu
    Copy the full SHA
    e922e79 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2023

  1. Configuration menu
    Copy the full SHA
    25f40e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    787dbc9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3801d9a View commit details
    Browse the repository at this point in the history
  4. Three more exception-related deprecations.

        * RefResolutionError is deprecated entirely.
          Use referencing.Registry-based APIs, and catch
          referencing.exceptions.Unresolvable if you really want to ignore
          referencing related issues.
    
        * FormatError should now be imported from jsonschema.exceptions
          only, not from the package root.
    
        * ErrorTree should now be imported from jsonschema.exceptions
          only, not from the package root.
    Julian committed Feb 23, 2023
    Configuration menu
    Copy the full SHA
    19bdf61 View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2023

  1. Configuration menu
    Copy the full SHA
    84199e9 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2023

  1. Configuration menu
    Copy the full SHA
    eb00447 View commit details
    Browse the repository at this point in the history
  2. Avoid whatever nonsense pkg_resources error.

    Just use virtue in CI.
    Julian committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    2b547c7 View commit details
    Browse the repository at this point in the history
  3. Speed up Validator.evolve by pre-computing fields.

    We're not a general class, so we know what fields we need
    ahead of time.
    
    This seems to give ~15% speedup on Validator evolution, which
    happens often as part of walking up and down schemas.
    Julian committed Mar 6, 2023
    Configuration menu
    Copy the full SHA
    94c60e4 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2023

  1. Bump requirements.

    Julian committed Mar 8, 2023
    Configuration menu
    Copy the full SHA
    1854b26 View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2023

  1. Configuration menu
    Copy the full SHA
    4d6bff9 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2023

  1. Another version bump.

    Julian committed Mar 13, 2023
    Configuration menu
    Copy the full SHA
    fcbeced View commit details
    Browse the repository at this point in the history