From 5eb75c71bfe13cb98d9dc5d08df3c11e5de0e89e Mon Sep 17 00:00:00 2001 From: David Lord Date: Sun, 16 Jun 2024 08:54:46 -0700 Subject: [PATCH] drop support for python 3.8 --- .github/workflows/tests.yaml | 2 +- CHANGES.md | 1 + pyproject.toml | 6 +++--- requirements/tests-3.8.in | 2 -- requirements/tests-3.8.txt | 36 ------------------------------------ tests/conftest.py | 4 ++-- tests/test_fsa_lite.py | 6 +----- tox.ini | 5 +---- 8 files changed, 9 insertions(+), 53 deletions(-) delete mode 100644 requirements/tests-3.8.in delete mode 100644 requirements/tests-3.8.txt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 3e4216d..b5caeb6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - python: ['3.12', '3.11', '3.10', '3.9', '3.8'] + python: ['3.12', '3.11', '3.10', '3.9'] steps: - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 - uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 diff --git a/CHANGES.md b/CHANGES.md index 6b02047..f930d46 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,7 @@ Unreleased +- Drop support for Python 3.8. - Support Flask-SQLAlchemy-Lite and plain SQLAlchemy, in addition to Flask-SQLAlchemy. {pr}`26` - Support multiple databases, and multiple metadata per database. {pr}`26` diff --git a/pyproject.toml b/pyproject.toml index 04c565f..a28f96a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ classifiers = [ "Topic :: Database", "Typing :: Typed", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "alembic>=1.13", "flask>=3.0", @@ -47,14 +47,14 @@ source = ["flask_alembic", "tests"] source = ["src", "*/site-packages"] [tool.mypy] -python_version = "3.8" +python_version = "3.9" files = ["src/flask_alembic", "tests"] show_error_codes = true pretty = true strict = true [tool.pyright] -pythonVersion = "3.8" +pythonVersion = "3.9" include = ["src/flask_alembic", "tests"] [tool.ruff] diff --git a/requirements/tests-3.8.in b/requirements/tests-3.8.in deleted file mode 100644 index 1c30f89..0000000 --- a/requirements/tests-3.8.in +++ /dev/null @@ -1,2 +0,0 @@ -flask-sqlalchemy -pytest diff --git a/requirements/tests-3.8.txt b/requirements/tests-3.8.txt deleted file mode 100644 index 1592dbb..0000000 --- a/requirements/tests-3.8.txt +++ /dev/null @@ -1,36 +0,0 @@ -# -# This file is autogenerated by pip-compile with Python 3.12 -# by the following command: -# -# pip-compile tests-3.8.in -# -blinker==1.8.2 - # via flask -click==8.1.7 - # via flask -flask==3.0.3 - # via flask-sqlalchemy -flask-sqlalchemy==3.1.1 - # via -r tests-3.8.in -iniconfig==2.0.0 - # via pytest -itsdangerous==2.2.0 - # via flask -jinja2==3.1.4 - # via flask -markupsafe==2.1.5 - # via - # jinja2 - # werkzeug -packaging==24.1 - # via pytest -pluggy==1.5.0 - # via pytest -pytest==8.2.2 - # via -r tests-3.8.in -sqlalchemy==2.0.30 - # via flask-sqlalchemy -typing-extensions==4.12.2 - # via sqlalchemy -werkzeug==3.0.3 - # via flask diff --git a/tests/conftest.py b/tests/conftest.py index 4ac36a9..bfb0d01 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -7,7 +7,7 @@ import pytest from flask import Flask from flask.ctx import AppContext -from flask_sqlalchemy import SQLAlchemy +from flask_sqlalchemy_lite import SQLAlchemy from flask_alembic import Alembic @@ -15,7 +15,7 @@ @pytest.fixture def app(request: pytest.FixtureRequest, tmp_path: Path) -> Flask: app = Flask(request.module.__name__, root_path=os.fspath(tmp_path)) - app.config["SQLALCHEMY_BINDS"] = { + app.config["SQLALCHEMY_ENGINES"] = { "default": "sqlite://", "other": "sqlite://", } diff --git a/tests/test_fsa_lite.py b/tests/test_fsa_lite.py index f1d18f7..9b0ba9f 100644 --- a/tests/test_fsa_lite.py +++ b/tests/test_fsa_lite.py @@ -5,16 +5,12 @@ import pytest from flask import Flask +from flask_sqlalchemy_lite import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy.orm import DeclarativeBase from flask_alembic import Alembic -try: - from flask_sqlalchemy_lite import SQLAlchemy -except ImportError: - pytest.skip("flask_sqlalchemy_lite not available", allow_module_level=True) - @pytest.fixture def app(app: Flask) -> Flask: diff --git a/tox.ini b/tox.ini index 2d00dcd..842570a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] envlist = - py3{12,11,10,9,8} + py3{12,11,10,9} style typing docs @@ -14,9 +14,6 @@ use_frozen_constraints = true deps = -r requirements/tests.txt commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs} -[testenv:py38,py3.8] -deps = -r requirements/tests-3.8.txt - [testenv:style] deps = pre-commit skip_install = true