Skip to content

Commit 5ff5538

Browse files
authored
Merge pull request #8 from addok/modernize
Modernize project structure and tooling
2 parents 20cd703 + 7aeecf7 commit 5ff5538

File tree

8 files changed

+131
-50
lines changed

8 files changed

+131
-50
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.9', '3.14']
15+
fail-fast: false
16+
services:
17+
redis:
18+
image: redis
19+
options:
20+
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s
21+
--health-retries 5
22+
ports:
23+
- 6379:6379
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -e ".[dev]"
37+
38+
- name: Run tests with pytest
39+
run: |
40+
pytest --cov=addok_sqlite_store --cov-report=term-missing

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ __pycache__
33
*.pyc
44
*.egg-info
55
.cache
6+
dist
7+
venv

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Yohan Boniface, DINSIC/Etalab
3+
Copyright (c) 2019 République Française
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

MANIFEST.in

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

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
develop:
2+
pip install -e ".[dev]"
3+
4+
test:
5+
python -m pytest
6+
7+
testcoverage:
8+
python -m pytest --cov-report lcov --cov=addok_sqlite_store tests/
9+
10+
clean:
11+
rm -rf dist/ build/
12+
13+
dist: clean test
14+
python -m build
15+
16+
upload: dist
17+
@if [ -z "$$(ls dist/*.whl dist/*.tar.gz 2>/dev/null)" ]; then \
18+
echo "Error: No distribution files found. Run 'make dist' first."; \
19+
exit 1; \
20+
fi
21+
twine upload dist/*

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1-
# Addok SQlite store plugin
1+
# addok-sqlite-store
22

3-
Store your documents into a SQlite database to save Redis RAM usage.
3+
Addok plugin to store documents in SQLite instead of Redis to reduce memory usage.
44

5+
## Features
56

6-
## Install
7+
- **SQLite storage**: Store documents in a SQLite database instead of Redis
8+
- **Memory optimization**: Reduce Redis RAM usage for large datasets
9+
- **Automatic registration**: Plugin registers itself when installed
710

8-
pip install addok-sqlite-store
11+
## Installation
912

13+
```bash
14+
pip install addok-sqlite-store
15+
```
1016

1117
## Configuration
1218

1319
The plugin will register itself when installed, by setting the correct
1420
`DOCUMENT_STORE_PYPATH`.
1521

16-
You want to define the path where the SQLite database will be created, by
17-
setting `SQLITE_DB_PATH` into your local
18-
[configuration](http://addok.readthedocs.io/en/latest/config/).
22+
Define the path where the SQLite database will be created:
23+
24+
```python
25+
SQLITE_DB_PATH = "/path/to/your/database.db"
26+
```

pyproject.toml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[build-system]
2+
requires = ["setuptools>=65.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "addok-sqlite-store"
7+
version = "1.0.1"
8+
description = "Store documents in SQLite for Addok."
9+
readme = "README.md"
10+
authors = [
11+
{name = "Yohan Boniface", email = "yohan.boniface@data.gouv.fr"}
12+
]
13+
license = "MIT"
14+
classifiers = [
15+
"Development Status :: 5 - Production/Stable",
16+
"Intended Audience :: Developers",
17+
"Topic :: Scientific/Engineering :: GIS",
18+
"Programming Language :: Python :: 3.9",
19+
"Programming Language :: Python :: 3.10",
20+
"Programming Language :: Python :: 3.11",
21+
"Programming Language :: Python :: 3.12",
22+
"Programming Language :: Python :: 3.13",
23+
"Programming Language :: Python :: 3.14",
24+
]
25+
keywords = ["addok", "geocoding", "sqlite", "plugin"]
26+
requires-python = ">=3.9"
27+
dependencies = [
28+
"addok",
29+
]
30+
31+
[project.optional-dependencies]
32+
dev = [
33+
"pytest~=8.3",
34+
"pytest-cov~=6.1",
35+
"build~=1.2",
36+
"twine==6.1.0",
37+
]
38+
39+
[project.urls]
40+
Homepage = "https://github.com/addok/addok-sqlite-store"
41+
42+
[project.entry-points."addok.ext"]
43+
sqlite-store = "addok_sqlite_store"
44+
45+
[tool.setuptools]
46+
include-package-data = true
47+
48+
[tool.setuptools.packages.find]
49+
exclude = ["tests*", "venv*", ".venv*", "build*", "dist*"]
50+
51+
[tool.pytest.ini_options]
52+
addopts = "-x"

setup.py

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

0 commit comments

Comments
 (0)