Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit b4da997

Browse files
committed
Updates python version to >= 3.8 (#193)
* Updates python version to >= 3.8 * Updates python version to 3.8 in the samples * Updates docs * Updates gitlab ci template * Runs ensure up to date * Samples regenerated
1 parent 6769c4d commit b4da997

File tree

25 files changed

+21
-75
lines changed

25 files changed

+21
-75
lines changed

docs/generators/python.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Documentation for the python generator
1010
| generator stability | STABLE | |
1111
| generator type | CLIENT | |
1212
| generator language | Python | |
13-
| generator language version | >=3.7 | |
13+
| generator language version | >=3.8 | |
1414
| generator default templating engine | handlebars | |
1515
| 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 | |
1616

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

3334
## INSTANTIATION TYPES

samples/openapi3/client/3_0_3_unit_test/python/.gitlab-ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ stages:
1010
- pip install -r test-requirements.txt
1111
- pytest --cov=unit_test_api
1212

13-
test-3.5:
14-
extends: .tests
15-
image: python:3.5-alpine
16-
test-3.6:
17-
extends: .tests
18-
image: python:3.6-alpine
19-
test-3.7:
20-
extends: .tests
21-
image: python:3.7-alpine
2213
test-3.8:
2314
extends: .tests
2415
image: python:3.8-alpine

samples/openapi3/client/3_0_3_unit_test/python/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.5"
5-
- "3.6"
6-
- "3.7"
74
- "3.8"
5+
- "3.9"
86
# command to install dependencies
97
install:
108
- "pip install -r requirements.txt"

samples/openapi3/client/3_0_3_unit_test/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener
99

1010
## Requirements
1111

12-
Python &gt;&#x3D;3.7
12+
Python &gt;&#x3D;3.8
1313

1414
## Migration Guides
1515
- [2.0.0 Migration Guide](migration_2_0_0.md)

samples/openapi3/client/3_0_3_unit_test/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authors = [
1818
]
1919
description = "openapi 3.0.3 sample spec"
2020
readme = "README.md"
21-
requires-python = ">=3.7"
21+
requires-python = ">=3.8"
2222
dependencies = [
2323
"certifi >= 14.5.14",
2424
"immutabledict ~= 2.2.4",

samples/openapi3/client/3_0_3_unit_test/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38
33
isolated_build = True
44

55
[testenv]

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.gitlab-ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ stages:
1010
- pip install -r test-requirements.txt
1111
- pytest --cov=this_package
1212

13-
test-3.5:
14-
extends: .tests
15-
image: python:3.5-alpine
16-
test-3.6:
17-
extends: .tests
18-
image: python:3.6-alpine
19-
test-3.7:
20-
extends: .tests
21-
image: python:3.7-alpine
2213
test-3.8:
2314
extends: .tests
2415
image: python:3.8-alpine

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.5"
5-
- "3.6"
6-
- "3.7"
74
- "3.8"
5+
- "3.9"
86
# command to install dependencies
97
install:
108
- "pip install -r requirements.txt"

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener
99

1010
## Requirements
1111

12-
Python &gt;&#x3D;3.7
12+
Python &gt;&#x3D;3.8
1313

1414
## Migration Guides
1515
- [2.0.0 Migration Guide](migration_2_0_0.md)

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authors = [
1818
]
1919
description = "discriminator-test"
2020
readme = "README.md"
21-
requires-python = ">=3.7"
21+
requires-python = ">=3.8"
2222
dependencies = [
2323
"certifi >= 14.5.14",
2424
"immutabledict ~= 2.2.4",

samples/openapi3/client/features/nonCompliantUseDiscriminatorIfCompositionFails/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38
33
isolated_build = True
44

55
[testenv]

samples/openapi3/client/features/security/python/.gitlab-ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ stages:
1010
- pip install -r test-requirements.txt
1111
- pytest --cov=this_package
1212

13-
test-3.5:
14-
extends: .tests
15-
image: python:3.5-alpine
16-
test-3.6:
17-
extends: .tests
18-
image: python:3.6-alpine
19-
test-3.7:
20-
extends: .tests
21-
image: python:3.7-alpine
2213
test-3.8:
2314
extends: .tests
2415
image: python:3.8-alpine

samples/openapi3/client/features/security/python/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.5"
5-
- "3.6"
6-
- "3.7"
74
- "3.8"
5+
- "3.9"
86
# command to install dependencies
97
install:
108
- "pip install -r requirements.txt"

samples/openapi3/client/features/security/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener
99

1010
## Requirements
1111

12-
Python &gt;&#x3D;3.7
12+
Python &gt;&#x3D;3.8
1313

1414
## Migration Guides
1515
- [2.0.0 Migration Guide](migration_2_0_0.md)

samples/openapi3/client/features/security/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authors = [
1818
]
1919
description = "security-test"
2020
readme = "README.md"
21-
requires-python = ">=3.7"
21+
requires-python = ">=3.8"
2222
dependencies = [
2323
"certifi >= 14.5.14",
2424
"immutabledict ~= 2.2.4",

samples/openapi3/client/features/security/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38
33
isolated_build = True
44

55
[testenv]

samples/openapi3/client/petstore/python/.gitlab-ci.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ stages:
1010
- pip install -r test-requirements.txt
1111
- pytest --cov=petstore_api
1212

13-
test-3.5:
14-
extends: .tests
15-
image: python:3.5-alpine
16-
test-3.6:
17-
extends: .tests
18-
image: python:3.6-alpine
19-
test-3.7:
20-
extends: .tests
21-
image: python:3.7-alpine
2213
test-3.8:
2314
extends: .tests
2415
image: python:3.8-alpine

samples/openapi3/client/petstore/python/.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.5"
5-
- "3.6"
6-
- "3.7"
74
- "3.8"
5+
- "3.9"
86
# command to install dependencies
97
install:
108
- "pip install -r requirements.txt"

samples/openapi3/client/petstore/python/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This Python package is automatically generated by the [OpenAPI JSON Schema Gener
99

1010
## Requirements
1111

12-
Python &gt;&#x3D;3.7
12+
Python &gt;&#x3D;3.8
1313

1414
## Migration Guides
1515
- [2.0.0 Migration Guide](migration_2_0_0.md)

samples/openapi3/client/petstore/python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authors = [
1818
]
1919
description = "OpenAPI Petstore"
2020
readme = "README.md"
21-
requires-python = ">=3.7"
21+
requires-python = ">=3.8"
2222
dependencies = [
2323
"certifi >= 14.5.14",
2424
"immutabledict ~= 2.2.4",

samples/openapi3/client/petstore/python/tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38
33
isolated_build = True
44

55
[testenv]

src/main/java/org/openapijsonschematools/codegen/generators/PythonClientGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,7 +1817,7 @@ public String defaultTemplatingEngine() {
18171817
}
18181818

18191819
@Override
1820-
public String generatorLanguageVersion() { return ">=3.7"; }
1820+
public String generatorLanguageVersion() { return ">=3.8"; }
18211821

18221822
@Override
18231823
public void preprocessOpenAPI(OpenAPI openAPI) {

src/main/resources/python/gitlab-ci.hbs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ stages:
1515
- pytest --cov={{{packageName}}}
1616
{{/unless}}
1717

18-
test-3.5:
19-
extends: .tests
20-
image: python:3.5-alpine
21-
test-3.6:
22-
extends: .tests
23-
image: python:3.6-alpine
24-
test-3.7:
25-
extends: .tests
26-
image: python:3.7-alpine
2718
test-3.8:
2819
extends: .tests
2920
image: python:3.8-alpine

src/main/resources/python/tox.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37
2+
envlist = py38
33
isolated_build = True
44

55
[testenv]

src/main/resources/python/travis.hbs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "3.5"
5-
- "3.6"
6-
- "3.7"
74
- "3.8"
5+
- "3.9"
86
# command to install dependencies
97
install:
108
- "pip install -r requirements.txt"

0 commit comments

Comments
 (0)