You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
GITEA_URL=https://try.gitea.io/swagger.v1.json
|
|
|
|
BUILDDIR=tmp
|
|
|
|
|
|
|
|
build: swagger_client clean_builddir pipenv_sync
|
|
|
|
|
|
|
|
swagger_client:
|
|
|
|
mkdir -p "${BUILDDIR}"
|
|
|
|
swagger-codegen generate -i "${GITEA_URL}" -l python -o "${BUILDDIR}/gitea_api"
|
|
|
|
mv "${BUILDDIR}/gitea_api/swagger_client" .
|
|
|
|
rm -rf "${BUILDDIR}/gitea_api"
|
|
|
|
|
|
|
|
# Protoze ten generator psali nejaci dementi, neumi to cyklicke reference
|
|
|
|
# je proto potreba zakomentovat dva importy
|
|
|
|
sed -i 's/from swagger_client\.models\.gpg_key import GPGKey/#from swagger_client.models.gpg_key import GPGKey/' swagger_client/models/gpg_key.py
|
|
|
|
sed -i 's/from swagger_client\.models\.repository import Repository/#from swagger_client.models.repository import Repository/' swagger_client/models/repository.py
|
|
|
|
|
|
|
|
.PHONY: pipenv_sync
|
|
|
|
pipenv_sync:
|
|
|
|
pipenv sync
|
|
|
|
|
|
|
|
.PHONY: clean_builddir
|
|
|
|
clean_builddir:
|
|
|
|
rm -rf ${BUILDDIR}
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf swagger_client/
|
|
|
|
rm -rf click/
|
|
|
|
pipenv --rm
|
|
|
|
|
|
|
|
|