Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions scripts/generate-sdk/.openapi-generator-ignore-python
Original file line number Diff line number Diff line change
@@ -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/*
2 changes: 1 addition & 1 deletion scripts/generate-sdk/languages/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-sdk/languages/python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
39 changes: 3 additions & 36 deletions templates/python/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion templates/python/pyproject.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = [
"{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}[email protected]{{/infoEmail}}>",
]
description = "{{{appName}}}"
#readme = "README.md"
readme = "README.md"
#license = "{{{licenseInfo}}}{{^licenseInfo}}NoLicense{{/licenseInfo}}"
classifiers = [
"Programming Language :: Python :: 3",
Expand Down
Loading