Skip to main content

funkycache: initial commit with a basic Python framework

ID
1ff707a
date
2026-11-04 06:06:16+00:00
author
Alex Chan <alex@alexwlchan.net>
message
funkycache: initial commit with a basic Python framework
changed files
10 files, 160 additions

Changed files

.gitignore (0 → 21)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3ba8bb9
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+.coverage
+*.egg-info

LICENSE (0 → 1053)

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..e732212
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2026 Alex Chan
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

README.md (0 → 90)

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5b54869
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# funkycache
+
+funkycache is a SQLite-backed function cache that tracks file dependencies.

dev_requirements.in (0 → 35)

diff --git a/dev_requirements.in b/dev_requirements.in
new file mode 100644
index 0000000..5c89bca
--- /dev/null
+++ b/dev_requirements.in
@@ -0,0 +1,6 @@
+-e file:.
+
+coverage
+pytest
+ruff
+ty

dev_requirements.txt (0 → 568)

diff --git a/dev_requirements.txt b/dev_requirements.txt
new file mode 100644
index 0000000..86749b0
--- /dev/null
+++ b/dev_requirements.txt
@@ -0,0 +1,20 @@
+# This file was autogenerated by uv via the following command:
+#    uv pip compile dev_requirements.in --output-file=dev_requirements.txt --exclude-newer=P7D --exclude-newer-package alexwlchan-chives=false
+-e file:.
+    # via -r dev_requirements.in
+coverage==7.17.0
+    # via -r dev_requirements.in
+iniconfig==2.3.1
+    # via pytest
+packaging==26.3
+    # via pytest
+pluggy==1.7.0
+    # via pytest
+pygments==2.21.0
+    # via pytest
+pytest==9.2.0
+    # via -r dev_requirements.in
+ruff==0.17.3
+    # via -r dev_requirements.in
+ty==0.0.93
+    # via -r dev_requirements.in

pyproject.toml (0 → 1363)

diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..a182912
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,59 @@
+[build-system]
+requires = [
+    "setuptools >= 65",
+]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "funkycache"
+description = "A SQLite-backed function cache that tracks file dependencies"
+readme = "README.md"
+authors = [
+  {name = "Alex Chan", email = "alex@alexwlchan.net"},
+]
+maintainers = [
+  {name = "Alex Chan", email="alex@alexwlchan.net"},
+]
+classifiers = [
+  "Development Status :: 5 - Production/Stable",
+  "Programming Language :: Python :: 3.14",
+]
+requires-python = ">=3.14"
+dependencies = []
+dynamic = ["version"]
+license = "MIT"
+
+[project.urls]
+"Homepage" = "https://alexwlchan.net/projects/funkycache/"
+"Changelog" = "https://alexwlchan.net/projects/funkycache/releases/"
+
+[tool.setuptools.dynamic]
+version = {attr = "funkycache.__version__"}
+
+[tool.setuptools.packages.find]
+where = ["src"]
+
+[tool.setuptools.package-data]
+nitrate = ["py.typed"]
+
+[tool.coverage.run]
+branch = true
+source = ["funkycache", "tests"]
+
+[tool.coverage.report]
+show_missing = true
+skip_covered = true
+fail_under = 100
+
+[tool.pytest.ini_options]
+filterwarnings = ["error"]
+
+[tool.ruff.lint]
+select = ["D", "E", "F"]
+ignore = [
+    "D200",  # unnecessary-multiline-docstring
+    "D203",  # incorrect-blank-line-before-class
+    "D205",  # missing-blank-line-after-summary
+    "D211",  # blank-line-before-class
+    "D212",  # multi-line-summary-first-line
+]

scripts/run_funkycache_tests.sh (0 → 671)

diff --git a/scripts/run_funkycache_tests.sh b/scripts/run_funkycache_tests.sh
new file mode 100755
index 0000000..65fb396
--- /dev/null
+++ b/scripts/run_funkycache_tests.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+
+# Print a command in blue, then run the command
+run_command() {
+    echo ""
+    echo -e "\033[34m-> $@\033[0m"
+    bash -c "$@"
+}
+
+report_coverage() {
+    echo ""
+    echo -e "\033[34m-> python3 -m coverage report --format=total\033[0m"
+    if [[ $(python3 -m coverage report --format=total) = "100" ]]
+    then
+        echo "100% coverage!"
+    else
+        python3 -m coverage report
+    fi
+}
+
+run_command 'ruff format'
+
+if [[ "${CI:-}" == "true" ]]
+then
+  run_command 'git diff --exit-code'
+fi
+
+run_command 'ruff check'
+run_command 'ty check'
+run_command "python3 -m coverage run -m pytest -q tests"
+report_coverage

src/funkycache/__init__.py (0 → 107)

diff --git a/src/funkycache/__init__.py b/src/funkycache/__init__.py
new file mode 100644
index 0000000..1268d3d
--- /dev/null
+++ b/src/funkycache/__init__.py
@@ -0,0 +1,5 @@
+"""
+funkycache is a SQLite-backed function cache that tracks file dependencies.
+"""
+
+__version__ = "0.0.1"

src/funkycache/py.typed (0 → 0)

diff --git a/src/funkycache/py.typed b/src/funkycache/py.typed
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/funkycache/py.typed

tests/test_funkycache.py (0 → 204)

diff --git a/tests/test_funkycache.py b/tests/test_funkycache.py
new file mode 100644
index 0000000..10cc76d
--- /dev/null
+++ b/tests/test_funkycache.py
@@ -0,0 +1,12 @@
+"""
+Tests for funkycache.
+"""
+
+from funkycache import __version__
+
+
+def test_version() -> None:
+    """
+    Test the version as a way to exercise the test suite.
+    """
+    assert __version__ == "0.0.1"