Skip to content

Commit fb7840e

Browse files
committed
Port setup.py to pyproject.toml, upgrade GitHub CI
1 parent e77d5b3 commit fb7840e

File tree

4 files changed

+59
-89
lines changed

4 files changed

+59
-89
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,48 @@ on:
44
release:
55
types: [created]
66

7+
permissions:
8+
contents: read
9+
710
jobs:
811
test:
912
runs-on: ubuntu-latest
1013
strategy:
1114
matrix:
12-
python-version: ["3.7", "3.8", "3.9", "3.10"]
15+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1316
steps:
14-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
1518
- name: Set up Python ${{ matrix.python-version }}
16-
uses: actions/setup-python@v2
19+
uses: actions/setup-python@v5
1720
with:
1821
python-version: ${{ matrix.python-version }}
19-
- uses: actions/cache@v2
20-
name: Configure pip caching
21-
with:
22-
path: ~/.cache/pip
23-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
24-
restore-keys: |
25-
${{ runner.os }}-pip-
22+
cache: pip
23+
cache-dependency-path: pyproject.toml
2624
- name: Install dependencies
2725
run: |
2826
pip install -e '.[test]'
2927
- name: Run tests
3028
run: |
31-
pytest
29+
python -m pytest
3230
deploy:
3331
runs-on: ubuntu-latest
3432
needs: [test]
33+
environment: release
34+
permissions:
35+
id-token: write
3536
steps:
36-
- uses: actions/checkout@v2
37+
- uses: actions/checkout@v4
3738
- name: Set up Python
38-
uses: actions/setup-python@v2
39-
with:
40-
python-version: "3.10"
41-
- uses: actions/cache@v2
42-
name: Configure pip caching
39+
uses: actions/setup-python@v5
4340
with:
44-
path: ~/.cache/pip
45-
key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }}
46-
restore-keys: |
47-
${{ runner.os }}-publish-pip-
41+
python-version: "3.13"
42+
cache: pip
43+
cache-dependency-path: pyproject.toml
4844
- name: Install dependencies
4945
run: |
50-
pip install setuptools wheel twine build
51-
- name: Publish
52-
env:
53-
TWINE_USERNAME: __token__
54-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
46+
pip install setuptools wheel build
47+
- name: Build
5548
run: |
5649
python -m build
57-
twine upload dist/*
58-
50+
- name: Publish
51+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
name: Test
22

3-
on: [push]
3+
on: [push, pull_request]
4+
5+
permissions:
6+
contents: read
47

58
jobs:
69
test:
710
runs-on: ubuntu-latest
811
strategy:
912
matrix:
10-
python-version: ["3.7", "3.8", "3.9", "3.10"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1114
steps:
12-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1316
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v5
1518
with:
1619
python-version: ${{ matrix.python-version }}
17-
- uses: actions/cache@v2
18-
name: Configure pip caching
19-
with:
20-
path: ~/.cache/pip
21-
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
22-
restore-keys: |
23-
${{ runner.os }}-pip-
20+
cache: pip
21+
cache-dependency-path: pyproject.toml
2422
- name: Install dependencies
2523
run: |
2624
pip install -e '.[test]'
2725
- name: Run tests
2826
run: |
29-
pytest
30-
27+
python -m pytest

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[project]
2+
name = "sqlite-diffable"
3+
version = "0.5"
4+
description = "Tools for dumping/loading a SQLite database to diffable directory structure"
5+
readme = "README.md"
6+
authors = [{name = "Simon Willison"}]
7+
license = "Apache-2.0"
8+
requires-python = ">=3.9"
9+
dependencies = [
10+
"click",
11+
"sqlite-utils"
12+
]
13+
14+
[build-system]
15+
requires = ["setuptools"]
16+
build-backend = "setuptools.build_meta"
17+
18+
[project.urls]
19+
Homepage = "https://github.com/simonw/sqlite-diffable"
20+
Changelog = "https://github.com/simonw/sqlite-diffable/releases"
21+
Issues = "https://github.com/simonw/sqlite-diffable/issues"
22+
CI = "https://github.com/simonw/sqlite-diffable/actions"
23+
24+
[project.scripts]
25+
sqlite-diffable = "sqlite_diffable.cli:cli"
26+
27+
[project.optional-dependencies]
28+
test = ["pytest", "black"]

setup.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)