aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-09-18 23:38:15 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-09-18 23:38:26 -0700
commitbf9ec36fd482940a5bbe63cb13d2d6518b93a27d (patch)
treef7eddd2dfa4deb798a3ddd5c148aa0cb083bec5f
parent4125dceb4183542d7e58d6fd2b0964f072922eec (diff)
downloadfatcat-bf9ec36fd482940a5bbe63cb13d2d6518b93a27d.tar.gz
fatcat-bf9ec36fd482940a5bbe63cb13d2d6518b93a27d.zip
update python codegen script with new generator
-rwxr-xr-xpython_openapi_client/codegen_python_client.sh64
1 files changed, 6 insertions, 58 deletions
diff --git a/python_openapi_client/codegen_python_client.sh b/python_openapi_client/codegen_python_client.sh
index aab3bddb..978ee903 100755
--- a/python_openapi_client/codegen_python_client.sh
+++ b/python_openapi_client/codegen_python_client.sh
@@ -14,38 +14,19 @@ cat ../fatcat-openapi2.yml | grep -v "TAGLINE$" | perl -0777 -pe "s/<\!-- STARTL
docker run \
-v $OUTPUT:/tmp/swagger/ \
- swaggerapi/swagger-codegen-cli:v2.3.1 \
+ openapitools/openapi-generator-cli:v4.1.2 \
generate \
- --lang python \
+ --generator-name python \
--input-spec /tmp/swagger/api.yml \
--output /tmp/swagger/ \
- -DpackageName=fatcat_openapi_client
+ --package-name=fatcat_openapi_client \
+ -p packageVersion="0.3.1"
sudo chown -R `whoami`:`whoami` $OUTPUT
mkdir -p fatcat_openapi_client
cp -r $OUTPUT/fatcat_openapi_client/* fatcat_openapi_client
cp $OUTPUT/README.md README.md
-# fix an annoying/buggy __del__() in codegen
-patch -p0 << END_PATCH
---- fatcat_openapi_client/api_client.py
-+++ fatcat_openapi_client/api_client.py
-@@ -76,8 +76,11 @@ class ApiClient(object):
- self.user_agent = 'Swagger-Codegen/1.0.0/python'
-
- def __del__(self):
-- self.pool.close()
-- self.pool.join()
-+ try:
-+ self.pool.close()
-+ self.pool.join()
-+ except:
-+ pass
-
- @property
- def user_agent(self):
-END_PATCH
-
# I don't know what they were thinking with this TypeWithDefault stuff, but it
# caused really gnarly config cross-contamination issues when running mulitple
# clients in parallel.
@@ -59,42 +40,9 @@ patch -p0 << END_PATCH
-class Configuration(six.with_metaclass(TypeWithDefault, object)):
+class Configuration(object):
- """NOTE: This class is auto generated by the swagger code generator program.
-
- Ref: https://github.com/swagger-api/swagger-codegen
-END_PATCH
-
-# fix circular import (release/file/fileset/webcapture)
-patch -p0 << END_PATCH
---- fatcat_openapi_client/models/file_entity.py
-+++ fatcat_openapi_client/models/file_entity.py
-@@ -17,7 +17,6 @@ import re # noqa: F401
- import six
-
- from fatcat_openapi_client.models.file_url import FileUrl # noqa: F401,E501
--from fatcat_openapi_client.models.release_entity import ReleaseEntity # noqa: F401,E501
-
-
- class FileEntity(object):
---- fatcat_openapi_client/models/fileset_entity.py
-+++ fatcat_openapi_client/models/fileset_entity.py
-@@ -18,7 +18,6 @@ import six
-
- from fatcat_openapi_client.models.fileset_file import FilesetFile # noqa: F401,E501
- from fatcat_openapi_client.models.fileset_url import FilesetUrl # noqa: F401,E501
--from fatcat_openapi_client.models.release_entity import ReleaseEntity # noqa: F401,E501
-
-
- class FilesetEntity(object):
---- fatcat_openapi_client/models/webcapture_entity.py
-+++ fatcat_openapi_client/models/webcapture_entity.py
-@@ -16,7 +16,6 @@ import re # noqa: F401
-
- import six
+ """NOTE: This class is auto generated by OpenAPI Generator
--from fatcat_openapi_client.models.release_entity import ReleaseEntity # noqa: F401,E501
- from fatcat_openapi_client.models.webcapture_cdx_line import WebcaptureCdxLine # noqa: F401,E501
- from fatcat_openapi_client.models.webcapture_url import WebcaptureUrl # noqa: F401,E501
+ Ref: https://openapi-generator.tech
END_PATCH
# these tests are basically no-ops