diff --git a/scripts/generate-sdk/.openapi-generator-ignore b/scripts/generate-sdk/.openapi-generator-ignore-go similarity index 100% rename from scripts/generate-sdk/.openapi-generator-ignore rename to scripts/generate-sdk/.openapi-generator-ignore-go diff --git a/scripts/generate-sdk/.openapi-generator-ignore-python b/scripts/generate-sdk/.openapi-generator-ignore-python new file mode 100644 index 0000000..b30aa09 --- /dev/null +++ b/scripts/generate-sdk/.openapi-generator-ignore-python @@ -0,0 +1,12 @@ +git_push.sh +.travis.yml +.gitignore +api/openapi.yaml +.openapi-generator/* +.gitlab-ci.yml +setup.cfg +setup.py +test-requirements.txt +requirements.txt +tox.ini +*/.github/* \ No newline at end of file diff --git a/scripts/generate-sdk/languages/go.sh b/scripts/generate-sdk/languages/go.sh index c6fe8f1..cd8e08d 100644 --- a/scripts/generate-sdk/languages/go.sh +++ b/scripts/generate-sdk/languages/go.sh @@ -133,7 +133,7 @@ generate_go_sdk() { GO_POST_PROCESS_FILE="gofmt -w" \ mkdir -p ${SERVICES_FOLDER}/${service}/ - cp ${ROOT_DIR}/scripts/generate-sdk/.openapi-generator-ignore ${SERVICES_FOLDER}/${service}/ + cp ${ROOT_DIR}/scripts/generate-sdk/.openapi-generator-ignore-go ${SERVICES_FOLDER}/${service}/.openapi-generator-ignore # Run the generator for Go java -Dlog.level=${GENERATOR_LOG_LEVEL} -jar ${jar_path} generate \ diff --git a/scripts/generate-sdk/languages/python.sh b/scripts/generate-sdk/languages/python.sh index fd0bbed..c4737b4 100644 --- a/scripts/generate-sdk/languages/python.sh +++ b/scripts/generate-sdk/languages/python.sh @@ -93,7 +93,7 @@ generate_python_sdk() { cd ${ROOT_DIR} mkdir -p "${SERVICES_FOLDER}/${service}/" - cp "${ROOT_DIR}/scripts/generate-sdk/.openapi-generator-ignore" "${SERVICES_FOLDER}/${service}/" + cp "${ROOT_DIR}/scripts/generate-sdk/.openapi-generator-ignore-python" "${SERVICES_FOLDER}/${service}/.openapi-generator-ignore" # Run the generator java -Dlog.level=${GENERATOR_LOG_LEVEL} -jar ${jar_path} generate \ diff --git a/templates/python/README.mustache b/templates/python/README.mustache index bceb88f..699b70f 100644 --- a/templates/python/README.mustache +++ b/templates/python/README.mustache @@ -3,58 +3,25 @@ {{{.}}} {{/appDescriptionWithNewLines}} -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: {{appVersion}} -- Package version: {{packageVersion}} -{{^hideGenerationTimestamp}} -- Build date: {{generatedDate}} -{{/hideGenerationTimestamp}} -- Generator version: {{generatorVersion}} -- Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) {{/infoUrl}} -## Requirements. +This package is part of the STACKIT Python SDK. For additional information, please visit the [GitHub repository](https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}) of the SDK. -Python {{{generatorLanguageVersion}}} ## Installation & Usage ### pip install -If the python package is hosted on a repository, you can install directly using: - -```sh -pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git -``` -(you may need to run `pip` with root permission: `sudo pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git`) - -Then import the package: -```python -import {{{packageName}}} -``` - -### Setuptools - -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). - ```sh -python setup.py install --user +pip install {{{pythonPackageName}}} ``` -(or `sudo python setup.py install` to install the package for all users) Then import the package: ```python import {{{packageName}}} ``` -### Tests - -Execute `pytest` to run the tests. - ## Getting Started -Please follow the [installation procedure](#installation--usage) and then run the following: - -{{> common_README }} +[Examples](https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}/tree/main/examples) for the usage of the package can be found in the [GitHub repository](https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}) of the SDK. \ No newline at end of file diff --git a/templates/python/pyproject.mustache b/templates/python/pyproject.mustache index 511ba58..0fb1225 100644 --- a/templates/python/pyproject.mustache +++ b/templates/python/pyproject.mustache @@ -5,7 +5,7 @@ authors = [ "{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>", ] description = "{{{appName}}}" -#readme = "README.md" +readme = "README.md" #license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}" classifiers = [ "Programming Language :: Python :: 3",