Skip to content

Commit 4f12c7a

Browse files
committed
Port from setup.py to pyproject.toml
Refs #676, closes #675
1 parent 1587fec commit 4f12c7a

File tree

11 files changed

+91
-99
lines changed

11 files changed

+91
-99
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
python-version: ${{ matrix.python-version }}
2020
cache: pip
21-
cache-dependency-path: setup.py
21+
cache-dependency-path: pyproject.toml
2222
- name: Install dependencies
2323
run: |
2424
pip install -e '.[test]'
@@ -35,14 +35,14 @@ jobs:
3535
with:
3636
python-version: '3.13'
3737
cache: pip
38-
cache-dependency-path: setup.py
38+
cache-dependency-path: pyproject.toml
3939
- name: Install dependencies
4040
run: |
41-
pip install setuptools wheel twine
41+
pip install build twine
4242
- name: Publish
4343
env:
4444
TWINE_USERNAME: __token__
4545
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
4646
run: |
47-
python setup.py sdist bdist_wheel
47+
python -m build
4848
twine upload dist/*

.github/workflows/spellcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
with:
1313
python-version: "3.12"
1414
cache: pip
15-
cache-dependency-path: setup.py
15+
cache-dependency-path: pyproject.toml
1616
- name: Install dependencies
1717
run: |
1818
pip install -e '.[docs]'

.github/workflows/test-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
python-version: "3.11"
2020
cache: pip
21-
cache-dependency-path: setup.py
21+
cache-dependency-path: pyproject.toml
2222
- name: Install SpatiaLite
2323
run: sudo apt-get install libsqlite3-mod-spatialite
2424
- name: Install Python dependencies

.github/workflows/test-sqlite-support.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ jobs:
2525
python-version: ${{ matrix.python-version }}
2626
allow-prereleases: true
2727
cache: pip
28-
cache-dependency-path: setup.py
29-
cache-dependency-path: setup.py
28+
cache-dependency-path: pyproject.toml
3029
- name: Set up SQLite ${{ matrix.sqlite-version }}
3130
uses: asg017/sqlite-versions@71ea0de37ae739c33e447af91ba71dda8fcf22e6
3231
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
python-version: ${{ matrix.python-version }}
2222
allow-prereleases: true
2323
cache: pip
24-
cache-dependency-path: setup.py
24+
cache-dependency-path: pyproject.toml
2525
- name: Install dependencies
2626
run: |
2727
pip install -e '.[test,mypy,flake8]'

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ venv
1616
.hypothesis
1717
Pipfile
1818
Pipfile.lock
19-
pyproject.toml
2019
tests/*.dylib
2120
tests/*.so
2221
tests/*.dll

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ We increment ``minor`` for new features.
144144

145145
We increment ``patch`` for bugfix releass.
146146

147-
To release a new version, first create a commit that updates the version number in ``setup.py`` and the :ref:`the changelog <changelog>` with highlights of the new version. An example `commit can be seen here <https://github.com/simonw/sqlite-utils/commit/b491f22d817836829965516983a3f4c3c72c05fc>`__::
147+
To release a new version, first create a commit that updates the version number in ``pyproject.toml`` and the :ref:`the changelog <changelog>` with highlights of the new version. An example `commit can be seen here <https://github.com/simonw/sqlite-utils/commit/b491f22d817836829965516983a3f4c3c72c05fc>`__::
148148

149149
# Update changelog
150150
git commit -m " Release 3.29

pyproject.toml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[project]
2+
name = "sqlite-utils"
3+
version = "4.0a0"
4+
description = "CLI tool and Python library for manipulating SQLite databases"
5+
readme = { file = "README.md", content-type = "text/markdown" }
6+
authors = [
7+
{ name = "Simon Willison" },
8+
]
9+
license = "Apache-2.0"
10+
requires-python = ">=3.10"
11+
classifiers = [
12+
"Development Status :: 5 - Production/Stable",
13+
"Intended Audience :: Developers",
14+
"Intended Audience :: End Users/Desktop",
15+
"Intended Audience :: Science/Research",
16+
"Programming Language :: Python :: 3.10",
17+
"Programming Language :: Python :: 3.11",
18+
"Programming Language :: Python :: 3.12",
19+
"Programming Language :: Python :: 3.13",
20+
"Programming Language :: Python :: 3.14",
21+
"Topic :: Database",
22+
]
23+
24+
dependencies = [
25+
"click",
26+
"click-default-group>=1.2.3",
27+
"pluggy",
28+
"python-dateutil",
29+
"sqlite-fts4",
30+
"tabulate",
31+
]
32+
33+
[project.urls]
34+
Homepage = "https://github.com/simonw/sqlite-utils"
35+
Documentation = "https://sqlite-utils.datasette.io/en/stable/"
36+
Changelog = "https://sqlite-utils.datasette.io/en/stable/changelog.html"
37+
Issues = "https://github.com/simonw/sqlite-utils/issues"
38+
CI = "https://github.com/simonw/sqlite-utils/actions"
39+
40+
[project.scripts]
41+
sqlite-utils = "sqlite_utils.cli:cli"
42+
43+
[project.optional-dependencies]
44+
test = [
45+
"black>=24.1.1",
46+
"cogapp",
47+
"hypothesis",
48+
"pytest",
49+
]
50+
docs = [
51+
"beanbag-docutils>=2.0",
52+
"codespell",
53+
"furo",
54+
"pygments-csv-lexer",
55+
"sphinx-autobuild",
56+
"sphinx-copybutton",
57+
]
58+
mypy = [
59+
"data-science-types",
60+
"mypy",
61+
"types-click",
62+
"types-pluggy",
63+
"types-python-dateutil",
64+
"types-tabulate",
65+
]
66+
flake8 = [
67+
"flake8",
68+
"flake8-pyproject",
69+
]
70+
71+
[build-system]
72+
requires = ["setuptools"]
73+
build-backend = "setuptools.build_meta"
74+
75+
[tool.flake8]
76+
max-line-length = 160
77+
# Black compatibility, E203 whitespace before ':':
78+
extend-ignore = ["E203"]
79+
80+
[tool.setuptools.package-data]
81+
sqlite_utils = ["py.typed"]

setup.cfg

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

setup.py

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

0 commit comments

Comments
 (0)