Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
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
3 changes: 2 additions & 1 deletion docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Documentation for the python generator
| generator stability | STABLE | |
| generator type | CLIENT | |
| generator language | Python | |
| generator language version | >=3.7 | |
| generator language version | >=3.8 | |
| generator default templating engine | handlebars | |
| helpTxt | Generates a Python client library<br /><br />Features in this generator:<br />- type hints on endpoints and model creation<br />- model parameter names use the spec defined keys and cases<br />- robust composition (oneOf/anyOf/allOf/not) where payload data is stored in one instance only<br />- endpoint parameter names use the spec defined keys and cases<br />- inline schemas are supported at any location including composition<br />- multiple content types supported in request body and response bodies<br />- run time type checking<br />- Sending/receiving decimals as strings supported with type:string format: number -> DecimalSchema<br />- Sending/receiving uuids as strings supported with type:string format: uuid -> UUIDSchema<br />- quicker load time for python modules (a single endpoint can be imported and used without loading others)<br />- all instances of schemas dynamically inherit from all matching schemas so one can use isinstance to check if validation passed<br />- composed schemas with type constraints supported (type:object + oneOf/anyOf/allOf)<br />- schemas are not coerced/cast. For example string + date are both stored as string, and there is a date accessor<br /> - Exceptions: int/float is stored as Decimal, When receiving data from headers it will start as str and may need to be cast for example to int | |

Expand All @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|packageVersion|python package version.| |1.0.0|
|projectName|python project name in setup.py (e.g. petstore-api).| |null|
|recursionLimit|Set the recursion limit. If not set, use the system default value.| |null|
|templatingEngine|template engine|<dl><dt>**handlebars**</dt><dd>handlebars templating engine</dd></dl>|handlebars|
|useNose|use the nose test framework| |false|

## INSTANTIATION TYPES
Expand Down
9 changes: 0 additions & 9 deletions samples/openapi3/client/3_0_3_unit_test/python/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ stages:
- pip install -r test-requirements.txt
- pytest --cov=unit_test_api

test-3.5:
extends: .tests
image: python:3.5-alpine
test-3.6:
extends: .tests
image: python:3.6-alpine
test-3.7:
extends: .tests
image: python:3.7-alpine
test-3.8:
extends: .tests
image: python:3.8-alpine
4 changes: 1 addition & 3 deletions samples/openapi3/client/3_0_3_unit_test/python/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# command to install dependencies
install:
- "pip install -r requirements.txt"
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/3_0_3_unit_test/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener

## Requirements

Python &gt;&#x3D;3.7
Python &gt;&#x3D;3.8

## Migration Guides
- [2.0.0 Migration Guide](migration_2_0_0.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [
]
description = "openapi 3.0.3 sample spec"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"certifi >= 14.5.14",
"immutabledict ~= 2.2.4",
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/3_0_3_unit_test/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37
envlist = py38
isolated_build = True

[testenv]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ stages:
- pip install -r test-requirements.txt
- pytest --cov=this_package

test-3.5:
extends: .tests
image: python:3.5-alpine
test-3.6:
extends: .tests
image: python:3.6-alpine
test-3.7:
extends: .tests
image: python:3.7-alpine
test-3.8:
extends: .tests
image: python:3.8-alpine
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# command to install dependencies
install:
- "pip install -r requirements.txt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener

## Requirements

Python &gt;&#x3D;3.7
Python &gt;&#x3D;3.8

## Migration Guides
- [2.0.0 Migration Guide](migration_2_0_0.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [
]
description = "discriminator-test"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"certifi >= 14.5.14",
"immutabledict ~= 2.2.4",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37
envlist = py38
isolated_build = True

[testenv]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ stages:
- pip install -r test-requirements.txt
- pytest --cov=this_package

test-3.5:
extends: .tests
image: python:3.5-alpine
test-3.6:
extends: .tests
image: python:3.6-alpine
test-3.7:
extends: .tests
image: python:3.7-alpine
test-3.8:
extends: .tests
image: python:3.8-alpine
4 changes: 1 addition & 3 deletions samples/openapi3/client/features/security/python/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# command to install dependencies
install:
- "pip install -r requirements.txt"
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/features/security/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener

## Requirements

Python &gt;&#x3D;3.7
Python &gt;&#x3D;3.8

## Migration Guides
- [2.0.0 Migration Guide](migration_2_0_0.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [
]
description = "security-test"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"certifi >= 14.5.14",
"immutabledict ~= 2.2.4",
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/features/security/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37
envlist = py38
isolated_build = True

[testenv]
Expand Down
9 changes: 0 additions & 9 deletions samples/openapi3/client/petstore/python/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ stages:
- pip install -r test-requirements.txt
- pytest --cov=petstore_api

test-3.5:
extends: .tests
image: python:3.5-alpine
test-3.6:
extends: .tests
image: python:3.6-alpine
test-3.7:
extends: .tests
image: python:3.7-alpine
test-3.8:
extends: .tests
image: python:3.8-alpine
4 changes: 1 addition & 3 deletions samples/openapi3/client/petstore/python/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# command to install dependencies
install:
- "pip install -r requirements.txt"
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener

## Requirements

Python &gt;&#x3D;3.7
Python &gt;&#x3D;3.8

## Migration Guides
- [2.0.0 Migration Guide](migration_2_0_0.md)
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ authors = [
]
description = "OpenAPI Petstore"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"certifi >= 14.5.14",
"immutabledict ~= 2.2.4",
Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37
envlist = py38
isolated_build = True

[testenv]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1817,7 +1817,7 @@ public String defaultTemplatingEngine() {
}

@Override
public String generatorLanguageVersion() { return ">=3.7"; }
public String generatorLanguageVersion() { return ">=3.8"; }

@Override
public void preprocessOpenAPI(OpenAPI openAPI) {
Expand Down
9 changes: 0 additions & 9 deletions src/main/resources/python/gitlab-ci.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ stages:
- pytest --cov={{{packageName}}}
{{/unless}}

test-3.5:
extends: .tests
image: python:3.5-alpine
test-3.6:
extends: .tests
image: python:3.6-alpine
test-3.7:
extends: .tests
image: python:3.7-alpine
test-3.8:
extends: .tests
image: python:3.8-alpine
2 changes: 1 addition & 1 deletion src/main/resources/python/tox.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py37
envlist = py38
isolated_build = True

[testenv]
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/python/travis.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.5"
- "3.6"
- "3.7"
- "3.8"
- "3.9"
# command to install dependencies
install:
- "pip install -r requirements.txt"
Expand Down