Skip to content

Commit f7af02d

Browse files
committed
feat: add pyproject.toml and comments on requiremnts.txt
1 parent 91a8d6e commit f7af02d

2 files changed

Lines changed: 96 additions & 0 deletions

File tree

pyproject.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[build-system]
2+
requires = ["hatchling>=1.21"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "cppa-cursor-browser"
7+
version = "0.1.0"
8+
description = "Flask web application for browsing and exporting Cursor AI chat histories"
9+
readme = "README.md"
10+
license = { file = "LICENSE" }
11+
authors = [{ name = "C++ Alliance", email = "admin@cppalliance.org" }]
12+
requires-python = ">=3.11"
13+
14+
# Runtime dependencies — bounded on both sides so CI resolves deterministically
15+
# and breaking major releases are caught at install time rather than at runtime.
16+
# Upper bounds are conservative: pin to current known-compatible major version.
17+
# See also: requirements.txt (backward-compat alias; pyproject.toml is canonical).
18+
dependencies = [
19+
"flask>=3.0,<4",
20+
"fpdf2>=2.7,<3",
21+
]
22+
23+
[project.optional-dependencies]
24+
# Desktop launcher (pywebview pulls in heavy system libs — GTK/Qt on Linux —
25+
# so it is intentionally excluded from the web-server and CI installs).
26+
desktop = ["pywebview>=5.0,<6"]
27+
28+
# Development tooling: testing + type checking.
29+
dev = [
30+
"pytest>=8,<9",
31+
"mypy>=1.10,<2",
32+
]
33+
34+
[project.scripts]
35+
# Primary CLI: export Cursor chat histories to Markdown / zip.
36+
# Usage: cursor-chat-export [--since all|last] [--out DIR] [--no-zip] [--help]
37+
cursor-chat-export = "scripts.export:main"
38+
39+
# Desktop launcher (requires the [desktop] extra to be installed).
40+
cursor-chat-browser = "launcher:main"
41+
42+
[project.urls]
43+
Repository = "https://github.com/cppalliance/cppa-cursor-browser"
44+
Issues = "https://github.com/cppalliance/cppa-cursor-browser/issues"
45+
46+
# ── Build configuration ────────────────────────────────────────────────────────
47+
# Flat layout (no src/ directory): enumerate every importable package and the
48+
# two top-level application modules so the installed wheel has the same import
49+
# surface as the repo checkout.
50+
[tool.hatch.build.targets.wheel]
51+
include = [
52+
"api/",
53+
"models/",
54+
"scripts/",
55+
"services/",
56+
"utils/",
57+
"app.py",
58+
"launcher.py",
59+
]
60+
61+
[tool.hatch.build.targets.sdist]
62+
include = [
63+
"api/",
64+
"models/",
65+
"scripts/",
66+
"services/",
67+
"utils/",
68+
"tests/",
69+
"templates/",
70+
"static/",
71+
"app.py",
72+
"launcher.py",
73+
"requirements.txt",
74+
"README.md",
75+
"LICENSE",
76+
"cursor-browser.spec",
77+
]
78+
79+
# ── Mypy ──────────────────────────────────────────────────────────────────────
80+
# Mirrors the flags used in .github/workflows/tests.yml so local `mypy .`
81+
# and CI produce identical results.
82+
[tool.mypy]
83+
ignore_missing_imports = true
84+
no_strict_optional = true
85+
pretty = true
86+
# Exclude virtual-env and build artefact directories so that `mypy .` from the
87+
# repo root matches CI behaviour (CI runs in a clean runner without a local venv).
88+
exclude = ["venv/", "\\.venv/", "build/", "dist/"]

requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# Backward-compatibility shim — pyproject.toml is the canonical source of
2+
# truth for dependencies. This file is retained so that
3+
# legacy workflows running `pip install -r requirements.txt` keep working,
4+
# but bounded version specifiers and the lock file live in pyproject.toml.
5+
#
6+
# Prefer: pip install -e . (installs the package + runtime deps)
7+
# pip install -e ".[dev]" (+ pytest and mypy)
8+
# pip install -e ".[desktop]" (+ pywebview for the GUI launcher)
19
flask>=3.0
210
fpdf2>=2.7
311
pywebview>=5.0

0 commit comments

Comments
 (0)