Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Python 3.7 in favor of 3.11 and 3.12 #1752

Merged
merged 3 commits into from
Oct 23, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 1 addition & 1 deletion connexion/apps/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _set_base_path(self, base_path: t.Optional[str] = None) -> None:
self._set_blueprint()

def _set_blueprint(self):
endpoint = flask_utils.flaskify_endpoint(self.base_path)
endpoint = flask_utils.flaskify_endpoint(self.base_path) or "/"
self.blueprint = flask.Blueprint(
endpoint,
__name__,
Expand Down
8 changes: 2 additions & 6 deletions connexion/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
starting point for developing your API with Connexion.
"""

import importlib.metadata
import logging
import sys
from os import path
Expand All @@ -13,11 +14,6 @@
import connexion
from connexion.mock import MockResolver

try:
import importlib_metadata
except ImportError:
import importlib.metadata as importlib_metadata # type: ignore

logger = logging.getLogger("connexion.cli")

FLASK_APP = "flask"
Expand All @@ -35,7 +31,7 @@
def print_version(ctx, param, value):
if not value or ctx.resilient_parsing:
return
click.echo(f"Connexion {importlib_metadata.version('connexion')}")
click.echo(f"Connexion {importlib.metadata.version('connexion')}")
ctx.exit()


Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
Expand All @@ -44,11 +44,10 @@ classifiers = [
connexion = 'connexion.cli:main'

[tool.poetry.dependencies]
python = '^3.7'
python = '^3.8'
asgiref = ">= 3.4"
clickclick = ">= 1.2"
httpx = ">= 0.23"
importlib_metadata = { version = ">=6.0.0", python = "<3.8" }
inflection = ">= 0.3.1"
jsonschema = ">= 4.0.1"
Jinja2 = ">= 3.0.0"
Expand Down
8 changes: 1 addition & 7 deletions tests/decorators/test_parameter.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import sys
from unittest.mock import MagicMock

try:
from unittest.mock import AsyncMock
except ImportError:
# Python 3.7
AsyncMock = None
from unittest.mock import AsyncMock, MagicMock

import pytest
from connexion.decorators.parameter import (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_api():

def test_api_base_path_slash():
api = FlaskApi(TEST_FOLDER / "fixtures/simple/basepath-slash.yaml")
assert api.blueprint.name == ""
assert api.blueprint.name == "/"
assert api.blueprint.url_prefix == ""


Expand Down
10 changes: 6 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ extend-ignore=E203,RST303
[tox]
isolated_build = True
envlist =
{py37,py38,py39,py310}-{min,pypi}
py38-min
{py38,py39,py310,py311,py312}-pypi
pre-commit

[gh-actions]
python =
3.7: py37-min,py37-pypi
3.8: py38-min,py38-pypi
3.9: py39-min,py39-pypi
3.10: py310-min,py310-pypi,pre-commit
3.9: py39-pypi
3.10: py310-pypi
3.11: py311-pypi,pre-commit
3.12: py312-pypi

[testenv]
setenv=PYTHONPATH = {toxinidir}:{toxinidir}
Expand Down
Loading