Skip to content
Open

v2 #56

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions .flake8

This file was deleted.

140 changes: 66 additions & 74 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,78 +6,70 @@ on: [push]
# pull_request:
# branches: [ master ]


jobs:
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version:
["3.10", "3.11", "3.12", "3.13", "pypy3.11"]
experimental: [false]
include:
- python-version: "3.13"
os: ubuntu-24.04-arm
experimental: false
- python-version: "3.13"
os: windows-11-arm
experimental: false
- python-version: "3.14"
os: ubuntu-latest
experimental: true
- python-version: "3.14"
os: ubuntu-24.04-arm
experimental: true
- python-version: "3.14"
os: windows-latest
experimental: true
- python-version: "3.14"
os: windows-11-arm
experimental: true
- python-version: "3.14"
os: macos-latest
experimental: true
- python-version: "3.14t"
os: ubuntu-latest
experimental: true
- python-version: "3.14t"
os: ubuntu-24.04-arm
experimental: true
- python-version: "3.14t"
os: windows-latest
experimental: true
- python-version: "3.14t"
os: windows-11-arm
experimental: true
- python-version: "3.14t"
os: macos-latest
experimental: true
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
- name: tox-gh workaround for freethreaded(!windows)
if: ${{ runner.os != 'Windows' && matrix.python-version == '3.14t' }}
run: echo "TOX_GH_MAJOR_MINOR=3.14t" >> $GITHUB_ENV
- name: tox-gh workaround for freethreaded(windows)
if: ${{ runner.os == 'Windows' && matrix.python-version == '3.14t' }}
run: echo "TOX_GH_MAJOR_MINOR=3.14t" >> $env:GITHUB_ENV
- name: Install dependencies
run: |
python3 -m pip install 'tox' 'tox-gh'
tox --version
- name: Install native deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y mecab libmecab-dev mecab-ipadic-utf8
- name: Test with tox
run: |
tox
build:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
python-version:
[
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
"3.14t",
"pypy3.11",
]
experimental: [false]
include:
- python-version: "3.14"
os: windows-11-arm
experimental: false
- python-version: "3.14t"
os: windows-11-arm
experimental: false
- python-version: "3.15-dev"
os: ubuntu-latest
experimental: true
- python-version: "3.15-dev"
os: macos-latest
experimental: true
- python-version: "3.15-dev"
os: windows-latest
experimental: true
- python-version: "3.15-dev"
os: ubuntu-24.04-arm
experimental: true

steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
- name: tox-gh workaround for freethreaded(!windows)
if: ${{ runner.os != 'Windows' && endsWith(matrix.python-version, 't') }}
run: echo "TOX_GH_MAJOR_MINOR=${{ matrix.python-version }}" >> $GITHUB_ENV
- name: tox-gh workaround for freethreaded(windows)
if: ${{ runner.os == 'Windows' && endsWith(matrix.python-version, 't') }}
run: echo "TOX_GH_MAJOR_MINOR=${{ matrix.python-version }}" >> $env:GITHUB_ENV
- name: Install dependencies
run: |
python3 -m pip install 'tox' 'tox-gh'
tox --version
- name: Install native deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -y mecab libmecab-dev mecab-ipadic-utf8
- name: Test with tox
run: |
tox
62 changes: 32 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
name: Release

on:
push:
tags:
- test-v*
release:
types:
- "published"
push:
tags:
- test-v*
release:
types:
- "published"

jobs:
publish:
strategy:
matrix:
publish:
strategy:
matrix:
environment:
- pypi
- testpypi
exclude:
- environment: ${{ !startsWith(github.ref_name, 'v') && 'pypi' }}
- environment: ${{ contains(github.ref_name, 'test') && 'pypi' }}
- environment: ${{ github.event_name == 'release' && 'testpypi' }}
name: Publish to PyPI ${{ matrix.environment }} from ${{ github.ref_name }}
runs-on: ubuntu-latest
environment:
- pypi
- testpypi
exclude:
- environment: ${{ !startsWith(github.ref_name, 'v') && 'pypi' }}
- environment: ${{ contains(github.ref_name, 'test') && 'pypi' }}
- environment: ${{ github.event_name == 'release' && 'testpypi' }}
name: Publish to PyPI ${{ matrix.environment }} from ${{ github.ref_name }}
runs-on: ubuntu-latest
environment:
name: ${{ matrix.environment }}
permissions:
id-token: write
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v7
- run: uv build
- name: Smoke test (wheel)
run: uv run --isolated --no-project -p 3.13 --with dist/*.whl --with pytest pytest tests/test_base.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz --with pytest pytest tests/test_base.py
- run: uv publish --trusted-publishing always ${{ matrix.environment == 'testpypi' && '--index testpypi' || '' }}
name: ${{ matrix.environment }}
permissions:
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
- run: uv build
- name: Smoke test (wheel)
run: uv run --isolated --no-project -p 3.13 --with dist/*.whl --with pytest pytest tests/test_base.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project -p 3.13 --with dist/*.tar.gz --with pytest pytest tests/test_base.py
- run: uv publish --trusted-publishing always ${{ matrix.environment == 'testpypi' && '--index testpypi' || '' }}
6 changes: 0 additions & 6 deletions .isort.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

66 changes: 36 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[project]
name = "sqlitefts"
version = "1.0.1"
version = "2.0.dev"
description = "A Python binding for tokenizers of SQLite Full Text Search"
authors = [{ name = "Hideaki Takahashi", email = "mymelo@gmail.com" }]
dependencies = [
"cffi>=2.0.0; python_version >= '3.14'",
"cffi>=1.17.0; python_version >= '3.9'",
"cffi>=1.15.1 ; platform_python_implementation != 'PyPy'",
"cffi>=1.17.0 ; platform_python_implementation != 'PyPy'",
]
readme = "README.rst"
requires-python = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3,!=3.4,!=3.5,!=3.6,!=3.7,!=3.8"
license = { text = "MIT" }
requires-python = ">=3.10, <4"
license = "MIT"
license-files = ["LICENSE"]
keywords = [
"SQLite",
"Full-text",
Expand All @@ -24,13 +24,12 @@ keywords = [
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"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",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Database",
Expand All @@ -39,37 +38,44 @@ classifiers = [

[project.urls]
Homepage = "https://github.com/hideaki-t/sqlite-fts-python/"
Repository = "https://github.com/hideaki-t/sqlite-fts-python.git"
Repository = "https://github.com/hideaki-t/sqlite-fts-python"
Issues = "https://github.com/hideaki-t/sqlite-fts-python/issues"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["uv_build>=0.11.21,<0.12.0"]
build-backend = "uv_build"

[tool.hatch.metadata]
allow-direct-references = true
[tool.uv.build-backend]
module-name = "sqlitefts"
module-root = ""

[tool.hatch.build.targets.wheel]
packages = ["sqlitefts"]

[tool.uv]
dev-dependencies = [
"mypy>=1.11.2 ; python_version >= '3.12'",
"faker>=30.0.0 ; python_full_version >= '3.12'",
"pytest>=8.3.2 ; python_version >= '3.12'",
"types-cffi>=1.16.0.0 ; python_version >= '3.12'",
"ruff>=0.6.2 ; python_version >= '3.12'",
]

[tool.hatch.build]
include = [
"sqlitefts/*.py",
"sqlitefts/*.pyi",
"sqlitefts/py.typed",
"tests/**",
[dependency-groups]
dev = [
"mypy>=1.11.2 ; python_version >= '3.13'",
"faker>=30.0.0 ; python_full_version >= '3.13'",
"pytest>=8.3.2 ; python_version >= '3.13'",
"types-cffi>=1.16.0.0 ; python_version >= '3.13'",
"ruff>=0.6.2 ; python_version >= '3.13'",
"ty>=0.0.1a20 ; python_version >= '3.13'",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.ruff]
line-length = 120
preview = true

[tool.ruff.lint]
select = ["E", "F", "W", "C", "B", "I", "UP", "RUF"]
ignore = []
fixable = ["ALL"]

[tool.ruff.format]
line-ending = "lf"

[tool.ruff.lint.isort]
known-first-party = ["sqlitefts", "jajp_common"]
4 changes: 2 additions & 2 deletions sqlitefts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
from .fts3 import Tokenizer, make_tokenizer_module, register_tokenizer

__all__ = [
"Error",
"Tokenizer",
"make_tokenizer_module",
"ranking",
"register_tokenizer",
"tokenizer",
"ranking",
"Error",
]
Loading
Loading