Skip to content

Commit

Permalink
Regenerate Slurm models for pydantic2
Browse files Browse the repository at this point in the history
Using:
    datamodel-code-generator 0.25.8
    ripgrep
    jq

And the command:

    curl    -H "X-SLURM-USER-NAME: gda2" \
            -H "X-SLURM-USER-TOKEN: $(cat /dls_sw/apps/zocalo/secrets/slurmrest-gda2.tkn)" \
            https://slurm-rest.diamond.ac.uk:8443/openapi/v3 \
        | rg --passthru -N '((?:db)?v)0.0.(\d+)_' -r '${1}00$2.' \
        | datamodel-codegen --target-python-version=3.8 \
            --use-schema-description \
            --use-field-description \
            --output-model-type=pydantic_v2.BaseModel \
            --field-constraints \
            --use-double-quotes \
            --output models \
        && cp models/v0040.py src/zocalo/util/slurm/models.py
  • Loading branch information
ndevenish committed Jul 19, 2024
1 parent 1bb91e8 commit 455af44
Showing 1 changed file with 92 additions and 92 deletions.
Loading

0 comments on commit 455af44

Please sign in to comment.