aboutsummaryrefslogtreecommitdiffstats
path: root/python-packages/sra_client/generate.sh
diff options
context:
space:
mode:
authorF. Eugene Aumson <feuGeneA@users.noreply.github.com>2018-12-12 08:57:53 +0800
committerGitHub <noreply@github.com>2018-12-12 08:57:53 +0800
commit318e7d5b575419aecacdea97d822606c75e6853b (patch)
tree28ee57e62e445e43d44885db115b993b4d798ed1 /python-packages/sra_client/generate.sh
parenta939433bd25e26f3ba285f543999ee3a63e018a5 (diff)
downloaddexon-0x-contracts-318e7d5b575419aecacdea97d822606c75e6853b.tar.gz
dexon-0x-contracts-318e7d5b575419aecacdea97d822606c75e6853b.tar.zst
dexon-0x-contracts-318e7d5b575419aecacdea97d822606c75e6853b.zip
feat(sra_client.py)
* Code generation scripts * Generated code * Change test config to hit 0x-launch-kit * Ran prettier on generated code * First test case, of get_asset_pairs() * Use launch kit docker image to faciliate CI tests * Fix markdown rendering for GitHub and PyPI * Add URL for PyPI to link back to GitHub * Add one-line package description to README.md * Remove git_push.sh * Remove unimplemented tests * Add sra_client to top-level README package list * Remove repeated-everywhere long description * Add shorcuts for publishing * Remove TypeScript examples
Diffstat (limited to 'python-packages/sra_client/generate.sh')
-rwxr-xr-xpython-packages/sra_client/generate.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/python-packages/sra_client/generate.sh b/python-packages/sra_client/generate.sh
new file mode 100755
index 000000000..91967dee3
--- /dev/null
+++ b/python-packages/sra_client/generate.sh
@@ -0,0 +1,26 @@
+# This file provided not so much to be run but rather more for posterity, as a
+# record of how this generated code was produced.
+
+GENERATOR_JAR=http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.3.4/openapi-generator-cli-3.3.4.jar
+GENERATOR_JAR_BASENAME=$(basename $GENERATOR_JAR)
+
+if [ -f $GENERATOR_JAR_BASENAME ]; then
+ if [ "$(openssl dgst -sha256 $GENERATOR_JAR_BASENAME)" \
+ != "SHA256($GENERATOR_JAR_BASENAME)= 24cb04939110cffcdd7062d2f50c6f61159dc3e0ca3b8aecbae6ade53ad3dc8c" \
+ ]; then
+ rm $GENERATOR_JAR_BASENAME
+ fi
+fi
+
+if [ ! -f $GENERATOR_JAR_BASENAME ]; then
+ wget $GENERATOR_JAR
+fi
+
+PYTHON_POST_PROCESS_FILE="black --line-length 79" \
+ java -jar openapi-generator-cli-3.3.4.jar \
+ generate \
+ --input-spec http://unpkg.com/@0x/sra-spec@1.0.11/lib/api.json \
+ --output . \
+ --generator-name python \
+ --config openapi-generator-cli-config.json \
+ --enable-post-process-file