setup.py to pyproject.toml plus upgraded actions

This commit is contained in:
Simon Willison 2026-02-23 16:50:33 -08:00
commit a157065c31
5 changed files with 58 additions and 61 deletions

View file

@ -12,18 +12,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install '.[test]'
pip install . --group dev
- name: Run tests
run: |
pytest
@ -34,16 +34,16 @@ jobs:
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.12"
python-version: "3.13"
cache: pip
cache-dependency-path: setup.py
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install setuptools wheel build
pip install build
- name: Build
run: |
python -m build

View file

@ -10,18 +10,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: |
pip install -e '.[test]'
pip install . --group dev
- name: Run tests
run: |
pytest

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
.venv
uv.lock
__pycache__/
*.py[cod]
*$py.class

42
pyproject.toml Normal file
View file

@ -0,0 +1,42 @@
[project]
name = "dclient"
version = "0.4"
description = "A client CLI utility for Datasette instances"
readme = "README.md"
authors = [{name = "Simon Willison"}]
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = [
"click",
"httpx",
"sqlite-utils",
]
[project.urls]
Homepage = "https://github.com/simonw/dclient"
Issues = "https://github.com/simonw/dclient/issues"
CI = "https://github.com/simonw/dclient/actions"
Changelog = "https://github.com/simonw/dclient/releases"
[project.scripts]
dclient = "dclient.cli:cli"
[project.entry-points.datasette]
client = "dclient.plugin"
[dependency-groups]
dev = [
"pytest",
"pytest-asyncio",
"pytest-httpx",
"cogapp",
"pytest-mock",
"datasette>=1.0a2",
]
[tool.uv.build-backend]
module-root = ""
[build-system]
requires = ["uv_build>=0.9.18,<0.10.0"]
build-backend = "uv_build"

View file

@ -1,46 +0,0 @@
from setuptools import setup
import os
VERSION = "0.4"
def get_long_description():
with open(
os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"),
encoding="utf8",
) as fp:
return fp.read()
setup(
name="dclient",
description="A client CLI utility for Datasette instances",
long_description=get_long_description(),
long_description_content_type="text/markdown",
author="Simon Willison",
url="https://github.com/simonw/dclient",
project_urls={
"Issues": "https://github.com/simonw/dclient/issues",
"CI": "https://github.com/simonw/dclient/actions",
"Changelog": "https://github.com/simonw/dclient/releases",
},
license="Apache License, Version 2.0",
version=VERSION,
packages=["dclient"],
entry_points={
"datasette": ["client = dclient.plugin"],
"console_scripts": ["dclient = dclient.cli:cli"],
},
install_requires=["click", "httpx", "sqlite-utils"],
extras_require={
"test": [
"pytest",
"pytest-asyncio",
"pytest-httpx",
"cogapp",
"pytest-mock",
"datasette>=1.0a2",
]
},
python_requires=">=3.8",
)