mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-26 02:44:33 +02:00
parent
1587feca6f
commit
4f12c7a452
11 changed files with 91 additions and 99 deletions
8
.github/workflows/publish.yml
vendored
8
.github/workflows/publish.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
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]'
|
||||
|
|
@ -35,14 +35,14 @@ jobs:
|
|||
with:
|
||||
python-version: '3.13'
|
||||
cache: pip
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: pyproject.toml
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install setuptools wheel twine
|
||||
pip install build twine
|
||||
- name: Publish
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
python -m build
|
||||
twine upload dist/*
|
||||
|
|
|
|||
2
.github/workflows/spellcheck.yml
vendored
2
.github/workflows/spellcheck.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
with:
|
||||
python-version: "3.12"
|
||||
cache: pip
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: pyproject.toml
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -e '.[docs]'
|
||||
|
|
|
|||
2
.github/workflows/test-coverage.yml
vendored
2
.github/workflows/test-coverage.yml
vendored
|
|
@ -18,7 +18,7 @@ jobs:
|
|||
with:
|
||||
python-version: "3.11"
|
||||
cache: pip
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: pyproject.toml
|
||||
- name: Install SpatiaLite
|
||||
run: sudo apt-get install libsqlite3-mod-spatialite
|
||||
- name: Install Python dependencies
|
||||
|
|
|
|||
3
.github/workflows/test-sqlite-support.yml
vendored
3
.github/workflows/test-sqlite-support.yml
vendored
|
|
@ -25,8 +25,7 @@ jobs:
|
|||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
cache: pip
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: pyproject.toml
|
||||
- name: Set up SQLite ${{ matrix.sqlite-version }}
|
||||
uses: asg017/sqlite-versions@71ea0de37ae739c33e447af91ba71dda8fcf22e6
|
||||
with:
|
||||
|
|
|
|||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
|
@ -21,7 +21,7 @@ jobs:
|
|||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
cache: pip
|
||||
cache-dependency-path: setup.py
|
||||
cache-dependency-path: pyproject.toml
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -e '.[test,mypy,flake8]'
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -16,7 +16,6 @@ venv
|
|||
.hypothesis
|
||||
Pipfile
|
||||
Pipfile.lock
|
||||
pyproject.toml
|
||||
tests/*.dylib
|
||||
tests/*.so
|
||||
tests/*.dll
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ We increment ``minor`` for new features.
|
|||
|
||||
We increment ``patch`` for bugfix releass.
|
||||
|
||||
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>`__::
|
||||
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>`__::
|
||||
|
||||
# Update changelog
|
||||
git commit -m " Release 3.29
|
||||
|
|
|
|||
81
pyproject.toml
Normal file
81
pyproject.toml
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
[project]
|
||||
name = "sqlite-utils"
|
||||
version = "4.0a0"
|
||||
description = "CLI tool and Python library for manipulating SQLite databases"
|
||||
readme = { file = "README.md", content-type = "text/markdown" }
|
||||
authors = [
|
||||
{ name = "Simon Willison" },
|
||||
]
|
||||
license = "Apache-2.0"
|
||||
requires-python = ">=3.10"
|
||||
classifiers = [
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"Intended Audience :: End Users/Desktop",
|
||||
"Intended Audience :: Science/Research",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Programming Language :: Python :: 3.14",
|
||||
"Topic :: Database",
|
||||
]
|
||||
|
||||
dependencies = [
|
||||
"click",
|
||||
"click-default-group>=1.2.3",
|
||||
"pluggy",
|
||||
"python-dateutil",
|
||||
"sqlite-fts4",
|
||||
"tabulate",
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
Homepage = "https://github.com/simonw/sqlite-utils"
|
||||
Documentation = "https://sqlite-utils.datasette.io/en/stable/"
|
||||
Changelog = "https://sqlite-utils.datasette.io/en/stable/changelog.html"
|
||||
Issues = "https://github.com/simonw/sqlite-utils/issues"
|
||||
CI = "https://github.com/simonw/sqlite-utils/actions"
|
||||
|
||||
[project.scripts]
|
||||
sqlite-utils = "sqlite_utils.cli:cli"
|
||||
|
||||
[project.optional-dependencies]
|
||||
test = [
|
||||
"black>=24.1.1",
|
||||
"cogapp",
|
||||
"hypothesis",
|
||||
"pytest",
|
||||
]
|
||||
docs = [
|
||||
"beanbag-docutils>=2.0",
|
||||
"codespell",
|
||||
"furo",
|
||||
"pygments-csv-lexer",
|
||||
"sphinx-autobuild",
|
||||
"sphinx-copybutton",
|
||||
]
|
||||
mypy = [
|
||||
"data-science-types",
|
||||
"mypy",
|
||||
"types-click",
|
||||
"types-pluggy",
|
||||
"types-python-dateutil",
|
||||
"types-tabulate",
|
||||
]
|
||||
flake8 = [
|
||||
"flake8",
|
||||
"flake8-pyproject",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.flake8]
|
||||
max-line-length = 160
|
||||
# Black compatibility, E203 whitespace before ':':
|
||||
extend-ignore = ["E203"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
sqlite_utils = ["py.typed"]
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
[flake8]
|
||||
max-line-length = 160
|
||||
# Black compatibility, E203 whitespace before ':':
|
||||
extend-ignore = E203
|
||||
83
setup.py
83
setup.py
|
|
@ -1,83 +0,0 @@
|
|||
from setuptools import setup, find_packages
|
||||
import io
|
||||
import os
|
||||
|
||||
VERSION = "4.0a0"
|
||||
|
||||
|
||||
def get_long_description():
|
||||
with io.open(
|
||||
os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.md"),
|
||||
encoding="utf8",
|
||||
) as fp:
|
||||
return fp.read()
|
||||
|
||||
|
||||
setup(
|
||||
name="sqlite-utils",
|
||||
description="CLI tool and Python library for manipulating SQLite databases",
|
||||
long_description=get_long_description(),
|
||||
long_description_content_type="text/markdown",
|
||||
author="Simon Willison",
|
||||
version=VERSION,
|
||||
license="Apache-2.0",
|
||||
license_files=[
|
||||
"LICENSE",
|
||||
],
|
||||
packages=find_packages(exclude=["tests", "tests.*"]),
|
||||
package_data={"sqlite_utils": ["py.typed"]},
|
||||
install_requires=[
|
||||
"sqlite-fts4",
|
||||
"click",
|
||||
"click-default-group>=1.2.3",
|
||||
"tabulate",
|
||||
"python-dateutil",
|
||||
"pluggy",
|
||||
],
|
||||
extras_require={
|
||||
"test": ["pytest", "black>=24.1.1", "hypothesis", "cogapp"],
|
||||
"docs": [
|
||||
"furo",
|
||||
"sphinx-autobuild",
|
||||
"codespell",
|
||||
"sphinx-copybutton",
|
||||
"beanbag-docutils>=2.0",
|
||||
"pygments-csv-lexer",
|
||||
],
|
||||
"mypy": [
|
||||
"mypy",
|
||||
"types-click",
|
||||
"types-tabulate",
|
||||
"types-python-dateutil",
|
||||
"types-pluggy",
|
||||
"data-science-types",
|
||||
],
|
||||
"flake8": ["flake8"],
|
||||
},
|
||||
entry_points="""
|
||||
[console_scripts]
|
||||
sqlite-utils=sqlite_utils.cli:cli
|
||||
""",
|
||||
url="https://github.com/simonw/sqlite-utils",
|
||||
project_urls={
|
||||
"Documentation": "https://sqlite-utils.datasette.io/en/stable/",
|
||||
"Changelog": "https://sqlite-utils.datasette.io/en/stable/changelog.html",
|
||||
"Source code": "https://github.com/simonw/sqlite-utils",
|
||||
"Issues": "https://github.com/simonw/sqlite-utils/issues",
|
||||
"CI": "https://github.com/simonw/sqlite-utils/actions",
|
||||
},
|
||||
python_requires=">=3.10",
|
||||
classifiers=[
|
||||
"Development Status :: 5 - Production/Stable",
|
||||
"Intended Audience :: Developers",
|
||||
"Intended Audience :: Science/Research",
|
||||
"Intended Audience :: End Users/Desktop",
|
||||
"Topic :: Database",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: 3.12",
|
||||
"Programming Language :: Python :: 3.13",
|
||||
],
|
||||
# Needed to bundle py.typed so mypy can see it:
|
||||
zip_safe=False,
|
||||
)
|
||||
|
|
@ -25,7 +25,7 @@ def test_extracts(fresh_db, kwargs, expected_table, use_table_factory):
|
|||
{"id": 2, "species_id": "Oak"},
|
||||
{"id": 3, "species_id": "Palm"},
|
||||
],
|
||||
**insert_kwargs
|
||||
**insert_kwargs,
|
||||
)
|
||||
# Should now have two tables: Trees and Species
|
||||
assert {expected_table, "Trees"} == set(fresh_db.table_names())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue