Drop support for Python 3.7

* Drop support for Python 3.7, closes #616
* Bumped versions on a whole lot of GitHub Actions
This commit is contained in:
Simon Willison 2024-01-30 18:37:38 -08:00
commit dbda76d6ed
6 changed files with 24 additions and 29 deletions

View file

@ -9,15 +9,15 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3 - uses: actions/cache@v4
name: Configure pip caching name: Configure pip caching
with: with:
path: ~/.cache/pip path: ~/.cache/pip
@ -34,12 +34,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [test] needs: [test]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
- uses: actions/cache@v3 - uses: actions/cache@v4
name: Configure pip caching name: Configure pip caching
with: with:
path: ~/.cache/pip path: ~/.cache/pip

View file

@ -6,12 +6,12 @@ jobs:
spellcheck: spellcheck:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: 3.9 python-version: "3.12"
- uses: actions/cache@v2 - uses: actions/cache@v4
name: Configure pip caching name: Configure pip caching
with: with:
path: ~/.cache/pip path: ~/.cache/pip

View file

@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repo - name: Check out repo
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v5
with: with:
python-version: 3.9 python-version: "3.11"
- uses: actions/cache@v2 - uses: actions/cache@v4
name: Configure pip caching name: Configure pip caching
with: with:
path: ~/.cache/pip path: ~/.cache/pip

View file

@ -10,16 +10,16 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
numpy: [0, 1] numpy: [0, 1]
os: [ubuntu-latest, macos-latest, windows-latest, macos-14] os: [ubuntu-latest, macos-latest, windows-latest, macos-14]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3 - uses: actions/cache@v4
name: Configure pip caching name: Configure pip caching
with: with:
path: ~/.cache/pip path: ~/.cache/pip
@ -29,8 +29,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: | run: |
pip install -e '.[test,mypy,flake8]' pip install -e '.[test,mypy,flake8]'
- name: Optionally install tui dependencies (not 3.7) - name: Optionally install tui dependencies
if: matrix.python-version != '3.7'
run: pip install -e '.[tui]' run: pip install -e '.[tui]'
- name: Optionally install numpy - name: Optionally install numpy
if: matrix.numpy == 1 if: matrix.numpy == 1
@ -50,12 +49,10 @@ jobs:
pytest -v pytest -v
- name: run mypy - name: run mypy
run: mypy sqlite_utils tests run: mypy sqlite_utils tests
- name: run flake8 if Python 3.8 or higher - name: run flake8
if: matrix.python-version >= 3.8
run: flake8 run: flake8
- name: Check formatting - name: Check formatting
run: black . --check run: black . --check
- name: Check if cog needs to be run - name: Check if cog needs to be run
if: matrix.python-version != '3.7'
run: | run: |
cog --check README.md docs/*.rst cog --check README.md docs/*.rst

View file

@ -64,7 +64,7 @@ setup(
"Issues": "https://github.com/simonw/sqlite-utils/issues", "Issues": "https://github.com/simonw/sqlite-utils/issues",
"CI": "https://github.com/simonw/sqlite-utils/actions", "CI": "https://github.com/simonw/sqlite-utils/actions",
}, },
python_requires=">=3.7", python_requires=">=3.8",
classifiers=[ classifiers=[
"Development Status :: 5 - Production/Stable", "Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers", "Intended Audience :: Developers",
@ -72,7 +72,6 @@ setup(
"Intended Audience :: End Users/Desktop", "Intended Audience :: End Users/Desktop",
"Topic :: Database", "Topic :: Database",
"License :: OSI Approved :: Apache Software License", "License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",

View file

@ -457,8 +457,7 @@ class Database:
fn_name, arity, fn, **dict(kwargs, deterministic=True) fn_name, arity, fn, **dict(kwargs, deterministic=True)
) )
registered = True registered = True
except (sqlite3.NotSupportedError, TypeError): except sqlite3.NotSupportedError:
# TypeError is Python 3.7 "function takes at most 3 arguments"
pass pass
if not registered: if not registered:
self.conn.create_function(fn_name, arity, fn, **kwargs) self.conn.create_function(fn_name, arity, fn, **kwargs)