Repository navigation
Conversation
It has proven hard to reproduce the exact contents of the (automatically
generated) models.py. There seems to be differences in flags between
what is the documented way it was run vs the contents, the SLURM version,
and the fact that datamodel-code-generator output order does not seem
to be stable.
Thus, this is now regenerated with:
datamodel-code-generator 0.25.8
ripgrep
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.BaseModel \
--field-constraints \
--use-double-quotes \
--output models \
&& cp models/v0040.py src/zocalo/util/slurm/models.py
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
Closed
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
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.
datamodel-code-generator(so that we have a baseline to compare to)datamodel-code-generatorbump-pydanticon RabbitMQ configurator modelsThe exact command/tool versions to regenerate models is included in the commit updating the models.