diff --git a/.github/workflows/samples-python-client-echo-api.yaml b/.github/workflows/samples-python-client-echo-api.yaml index 8b1622881ffa..4c59ff6aa336 100644 --- a/.github/workflows/samples-python-client-echo-api.yaml +++ b/.github/workflows/samples-python-client-echo-api.yaml @@ -23,6 +23,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 @@ -34,7 +35,7 @@ jobs: run: | git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server (cd http-echo-server && npm install && npm start &) - - name: Install + - name: Install working-directory: ${{ matrix.sample }} run: | pip install -r requirements.txt diff --git a/.github/workflows/samples-python-client-legacy-model-dictionaries.yaml b/.github/workflows/samples-python-client-legacy-model-dictionaries.yaml index e9c6acc8888a..064026f90d58 100644 --- a/.github/workflows/samples-python-client-legacy-model-dictionaries.yaml +++ b/.github/workflows/samples-python-client-legacy-model-dictionaries.yaml @@ -19,6 +19,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 diff --git a/.github/workflows/samples-python-petstore.yaml b/.github/workflows/samples-python-petstore.yaml index 6f2678efd6e9..73dc30d75366 100644 --- a/.github/workflows/samples-python-petstore.yaml +++ b/.github/workflows/samples-python-petstore.yaml @@ -37,6 +37,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" sample: - samples/openapi3/client/petstore/python-aiohttp - samples/openapi3/client/petstore/python-httpx2 diff --git a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml index fcdfab673f79..96cc763f99ad 100644 --- a/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml +++ b/.github/workflows/samples-python-pydantic-v1-client-echo-api.yaml @@ -22,6 +22,7 @@ jobs: - "3.12" - "3.13" #- "3.14" + #- "3.15" steps: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 @@ -33,7 +34,7 @@ jobs: run: | git clone https://github.com/wing328/http-echo-server -b openapi-generator-test-server (cd http-echo-server && npm install && npm start &) - - name: Install + - name: Install working-directory: ${{ matrix.sample }} run: | pip install -r requirements.txt diff --git a/.github/workflows/samples-python-pydantic-v1-petstore.yaml b/.github/workflows/samples-python-pydantic-v1-petstore.yaml index 2980de678d92..1d74a46b1f93 100644 --- a/.github/workflows/samples-python-pydantic-v1-petstore.yaml +++ b/.github/workflows/samples-python-pydantic-v1-petstore.yaml @@ -20,6 +20,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" sample: - samples/openapi3/client/petstore/python-pydantic-v1-aiohttp - samples/openapi3/client/petstore/python-pydantic-v1 diff --git a/modules/openapi-generator/src/main/resources/python/github-workflow.mustache b/modules/openapi-generator/src/main/resources/python/github-workflow.mustache index f6f72ae69958..f99648fe6eec 100644 --- a/modules/openapi-generator/src/main/resources/python/github-workflow.mustache +++ b/modules/openapi-generator/src/main/resources/python/github-workflow.mustache @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache b/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache index 701ffbfd7e8a..45c976bd791e 100644 --- a/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache +++ b/modules/openapi-generator/src/main/resources/python/gitlab-ci.mustache @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/modules/openapi-generator/src/main/resources/python/travis.mustache b/modules/openapi-generator/src/main/resources/python/travis.mustache index 983251a4640b..c236d322bf22 100644 --- a/modules/openapi-generator/src/main/resources/python/travis.mustache +++ b/modules/openapi-generator/src/main/resources/python/travis.mustache @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.github/workflows/python.yml b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.github/workflows/python.yml index b17065bfa1d4..a0cf208ec8b5 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.github/workflows/python.yml +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml index 4c036842aee1..564d7416bbbb 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.travis.yml b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.travis.yml index a58e1c9adaf6..ef719723eb0d 100644 --- a/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.travis.yml +++ b/samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/client/echo_api/python/.github/workflows/python.yml b/samples/client/echo_api/python/.github/workflows/python.yml index b17065bfa1d4..a0cf208ec8b5 100644 --- a/samples/client/echo_api/python/.github/workflows/python.yml +++ b/samples/client/echo_api/python/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/client/echo_api/python/.gitlab-ci.yml b/samples/client/echo_api/python/.gitlab-ci.yml index 4c036842aee1..564d7416bbbb 100644 --- a/samples/client/echo_api/python/.gitlab-ci.yml +++ b/samples/client/echo_api/python/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/client/echo_api/python/.travis.yml b/samples/client/echo_api/python/.travis.yml index a58e1c9adaf6..ef719723eb0d 100644 --- a/samples/client/echo_api/python/.travis.yml +++ b/samples/client/echo_api/python/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/client/others/python-legacy-model-dictionaries/.github/workflows/python.yml b/samples/client/others/python-legacy-model-dictionaries/.github/workflows/python.yml index b4a39b34607b..5bfcc9d802df 100644 --- a/samples/client/others/python-legacy-model-dictionaries/.github/workflows/python.yml +++ b/samples/client/others/python-legacy-model-dictionaries/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/client/others/python-legacy-model-dictionaries/.gitlab-ci.yml b/samples/client/others/python-legacy-model-dictionaries/.gitlab-ci.yml index 547b0fd99b87..84413b5e8b91 100644 --- a/samples/client/others/python-legacy-model-dictionaries/.gitlab-ci.yml +++ b/samples/client/others/python-legacy-model-dictionaries/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/client/others/python-legacy-model-dictionaries/.travis.yml b/samples/client/others/python-legacy-model-dictionaries/.travis.yml index 1e3bffd3b917..12309a614799 100644 --- a/samples/client/others/python-legacy-model-dictionaries/.travis.yml +++ b/samples/client/others/python-legacy-model-dictionaries/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-aiohttp/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-aiohttp/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-aiohttp/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-aiohttp/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-aiohttp/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-aiohttp/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-aiohttp/.travis.yml b/samples/openapi3/client/petstore/python-aiohttp/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-aiohttp/.travis.yml +++ b/samples/openapi3/client/petstore/python-aiohttp/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-httpx-sync/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-httpx-sync/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-httpx-sync/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-httpx-sync/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-httpx-sync/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-httpx-sync/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-httpx-sync/.travis.yml b/samples/openapi3/client/petstore/python-httpx-sync/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-httpx-sync/.travis.yml +++ b/samples/openapi3/client/petstore/python-httpx-sync/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-httpx/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-httpx/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-httpx/.travis.yml b/samples/openapi3/client/petstore/python-httpx/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-httpx/.travis.yml +++ b/samples/openapi3/client/petstore/python-httpx/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-httpx2-sync/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-httpx2-sync/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-httpx2-sync/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-httpx2-sync/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-httpx2-sync/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-httpx2-sync/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-httpx2-sync/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-httpx2-sync/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-httpx2-sync/.travis.yml b/samples/openapi3/client/petstore/python-httpx2-sync/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-httpx2-sync/.travis.yml +++ b/samples/openapi3/client/petstore/python-httpx2-sync/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-httpx2/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-httpx2/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-httpx2/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-httpx2/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-httpx2/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-httpx2/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-httpx2/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-httpx2/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-httpx2/.travis.yml b/samples/openapi3/client/petstore/python-httpx2/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-httpx2/.travis.yml +++ b/samples/openapi3/client/petstore/python-httpx2/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml b/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python-lazyImports/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml b/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python-lazyImports/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python-lazyImports/.travis.yml b/samples/openapi3/client/petstore/python-lazyImports/.travis.yml index 1197382a3ed8..58b0a87885b9 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/.travis.yml +++ b/samples/openapi3/client/petstore/python-lazyImports/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py index 1d5f05abb462..3fa65ada8d23 100644 --- a/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-lazyImports/tests/test_http_signature.py @@ -254,8 +254,9 @@ def setUpFiles(cls): if not os.path.exists(cls.rsa4096_key_path): key = RSA.generate(4096) private_key = key.export_key( + format='PEM', passphrase=cls.private_key_passphrase, - protection='PEM' + pkcs=1 ) with open(cls.rsa4096_key_path, "wb") as f: f.write(private_key) @@ -481,14 +482,16 @@ def test_invalid_configuration(self): 'Exception message: {0}'.format(str(cm.exception))) # Private key passphrase is missing but key is encrypted. - with self.assertRaises(Exception) as cm: + with self.assertRaisesRegex( + ValueError, + r'Not a valid clear PKCS#8 structure|' + r'The private key is encrypted: a passphrase is required' + ): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, ) - self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) # File containing private key must exist. with self.assertRaises(Exception) as cm: diff --git a/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_http_signature.py b/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_http_signature.py index 569ae0ce4973..ec8d000df551 100644 --- a/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python-pydantic-v1/tests/test_http_signature.py @@ -228,8 +228,9 @@ def setUpFiles(cls): if not os.path.exists(cls.rsa4096_key_path): key = RSA.generate(4096) private_key = key.export_key( + format='PEM', passphrase=cls.private_key_passphrase, - protection='PEM' + pkcs=1 ) with open(cls.rsa4096_key_path, "wb") as f: f.write(private_key) @@ -451,14 +452,16 @@ def test_invalid_configuration(self): 'Exception message: {0}'.format(str(cm.exception))) # Private key passphrase is missing but key is encrypted. - with self.assertRaises(Exception) as cm: + with self.assertRaisesRegex( + ValueError, + r'Not a valid clear PKCS#8 structure|' + r'The private key is encrypted: a passphrase is required' + ): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, ) - self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) # File containing private key must exist. with self.assertRaises(Exception) as cm: diff --git a/samples/openapi3/client/petstore/python/.github/workflows/python.yml b/samples/openapi3/client/petstore/python/.github/workflows/python.yml index da1eaf6fe1d7..20c4eae353fb 100644 --- a/samples/openapi3/client/petstore/python/.github/workflows/python.yml +++ b/samples/openapi3/client/petstore/python/.github/workflows/python.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] steps: - uses: actions/checkout@v4 diff --git a/samples/openapi3/client/petstore/python/.gitlab-ci.yml b/samples/openapi3/client/petstore/python/.gitlab-ci.yml index 89cc724c729c..ed57a8f29294 100755 --- a/samples/openapi3/client/petstore/python/.gitlab-ci.yml +++ b/samples/openapi3/client/petstore/python/.gitlab-ci.yml @@ -29,3 +29,6 @@ pytest-3.13: pytest-3.14: extends: .pytest image: python:3.14-alpine +pytest-3.15: + extends: .pytest + image: python:3.15-alpine diff --git a/samples/openapi3/client/petstore/python/.travis.yml b/samples/openapi3/client/petstore/python/.travis.yml index 1197382a3ed8..58b0a87885b9 100755 --- a/samples/openapi3/client/petstore/python/.travis.yml +++ b/samples/openapi3/client/petstore/python/.travis.yml @@ -6,6 +6,7 @@ python: - "3.12" - "3.13" - "3.14" + - "3.15" # uncomment the following if needed #- "3.14-dev" # 3.14 development branch #- "nightly" # nightly build diff --git a/samples/openapi3/client/petstore/python/tests/test_http_signature.py b/samples/openapi3/client/petstore/python/tests/test_http_signature.py index 1d5f05abb462..3fa65ada8d23 100644 --- a/samples/openapi3/client/petstore/python/tests/test_http_signature.py +++ b/samples/openapi3/client/petstore/python/tests/test_http_signature.py @@ -254,8 +254,9 @@ def setUpFiles(cls): if not os.path.exists(cls.rsa4096_key_path): key = RSA.generate(4096) private_key = key.export_key( + format='PEM', passphrase=cls.private_key_passphrase, - protection='PEM' + pkcs=1 ) with open(cls.rsa4096_key_path, "wb") as f: f.write(private_key) @@ -481,14 +482,16 @@ def test_invalid_configuration(self): 'Exception message: {0}'.format(str(cm.exception))) # Private key passphrase is missing but key is encrypted. - with self.assertRaises(Exception) as cm: + with self.assertRaisesRegex( + ValueError, + r'Not a valid clear PKCS#8 structure|' + r'The private key is encrypted: a passphrase is required' + ): signing_cfg = signing.HttpSigningConfiguration( key_id="my-key-id", signing_scheme=signing.SCHEME_HS2019, private_key_path=self.ec_p521_key_path, ) - self.assertTrue(re.match('Not a valid clear PKCS#8 structure', str(cm.exception)), - 'Exception message: {0}'.format(str(cm.exception))) # File containing private key must exist. with self.assertRaises(Exception) as cm: