C-Accel-CRIPT / sdk-archive

CRIPT Python SDK
MIT License
11 stars 0 forks source link

Software source doesn't have to be a valid URL #43

Closed InnocentBug closed 1 year ago

InnocentBug commented 2 years ago

Currently, it seems that software.source needs to be a valid URL. This fails:

    python = cript.Software(proj.group, "python", "3.9", "debian 11")
    api.save(python)

with

Traceback (most recent call last):
  File "/home/ludwig/git/sim_data_model/refactor_sdk.py", line 303, in <module>
    main(sys.argv[1:])
  File "/home/ludwig/git/sim_data_model/refactor_sdk.py", line 63, in main
    api.save(python)
  File "<@beartype(cript.api.API.save) at 0x7f00ddc59940>", line 66, in save
  File "/home/ludwig/.local/lib/python3.9/site-packages/cript/api.py", line 178, in save
    raise APISaveError(display_errors(response.content))
cript.exceptions.APISaveError: {
    "source": [
        "Enter a valid URL."
    ]
}

But I think it should be fine. Giving a version and a description of the source, should be fine. A URL would be nice, but I don't think we need to require it.

This works though:

    python = cript.Software(proj.group, "python", "3.9", "https://debian.pkgs.org/11/debian-main-amd64/python3_3.9.2-3_amd64.deb.html")
    api.save(python)