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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Min package pin needed for jsonschema #175

Open
sambles opened this issue Feb 4, 2025 · 0 comments
Open

Min package pin needed for jsonschema #175

sambles opened this issue Feb 4, 2025 · 0 comments
Assignees
Labels
bug Something isn't working LTS - 2.4

Comments

@sambles
Copy link
Contributor

sambles commented Feb 4, 2025

Python venv's with older versions jsonschema will cause the following error

Traceback (most recent call last):
  File "/home/sam/repos/venv/3py/bin/oasislmf", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/oasislmf/cli/root.py", line 54, in main
    sys.exit(RootCmd().run())
             ^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/oasislmf/cli/root.py", line 42, in run
    return super(OasisBaseCommand, self).run(args=args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/argparsetree/cmd.py", line 159, in run
    return cmd_cls(sub_command_name).run(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/argparsetree/cmd.py", line 159, in run
    return cmd_cls(sub_command_name).run(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/argparsetree/cmd.py", line 161, in run
    return self.action(args) or 0
           ^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/oasislmf/cli/command.py", line 164, in action
    _kwargs = self.get_arguments(args, manager_method)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/oasislmf/cli/command.py", line 150, in get_arguments
    new_settings = settings_info['loader'](setting_fp)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/ods_tools/oed/settings.py", line 388, in load
    self.validate(settings_data, raise_error=raise_error)
  File "/home/sam/repos/venv/3py/lib/python3.11/site-packages/ods_tools/oed/settings.py", line 419, in validate
    for err in jsonschema.Draft202012Validator(schema_info['schema']).iter_errors(json_sub_part):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'js

Working version

(NEW) ~/repos/core/OasisEvaluation/OasisPiWind$ pip freeze | grep jsonschema
jsonschema==4.23.0
jsonschema-specifications==2024.10.1

Broken version

(OLD) ~/repos/core/OasisEvaluation/OasisPiWind$ pip freeze | grep jsonschema
jsonschema==3.2.0
jsonschema-specifications==2023.12.1

Context

Stephane: It needs something that support "unevaluatedProperties":false we use to have something like this Draft3Validator

See:
https://python-jsonschema.readthedocs.io/en/latest/api/jsonschema/protocols/#jsonschema.protocols.Validator

https://github.com/OasisLMF/ODS_Tools/blob/39f4ee6ca807aa1c642060919a89b07cb367ac00/ods_tools/oed/setting_schema.py#L200#

@sambles sambles added bug Something isn't working LTS - 2.4 labels Feb 4, 2025
@benhayes21 benhayes21 moved this to In Progress in Oasis Dev Team Tasks Feb 5, 2025
@benhayes21 benhayes21 assigned sstruzik and unassigned sambles Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working LTS - 2.4
Projects
Status: In Progress
Development

No branches or pull requests

2 participants