-
Notifications
You must be signed in to change notification settings - Fork 1
build: add pyproject.toml and Python packaging infrastructure (closes #45) #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+114
−6
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f7af02d
feat: add pyproject.toml and comments on requiremnts.txt
bradjin8 51f7206
fix: add assets directories to project toml file.
bradjin8 72d63ec
fix: made pywebview for legacy install as optional.
bradjin8 d9aa73a
fix: add an explicit constraint on Pillow to block known-vulnerable v…
bradjin8 cebefce
fix: review comments
bradjin8 84366c4
fix: Add an explicit Pillow constraint to exclude known-vulnerable ve…
bradjin8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| [build-system] | ||
| requires = ["hatchling>=1.21"] | ||
| build-backend = "hatchling.build" | ||
|
|
||
| [project] | ||
| name = "cppa-cursor-browser" | ||
| version = "0.1.0" | ||
| description = "Flask web application for browsing and exporting Cursor AI chat histories" | ||
| readme = "README.md" | ||
| license = { file = "LICENSE" } | ||
| authors = [{ name = "C++ Alliance", email = "admin@cppalliance.org" }] | ||
| requires-python = ">=3.10" | ||
|
|
||
| # Runtime dependencies — bounded on both sides so CI resolves deterministically | ||
| # and breaking major releases are caught at install time rather than at runtime. | ||
| # Upper bounds are conservative: pin to current known-compatible major version. | ||
| # See also: requirements.txt (backward-compat alias; pyproject.toml is canonical). | ||
| dependencies = [ | ||
| "flask>=3.0,<4", | ||
| "fpdf2>=2.7,<3", | ||
| # Security floor: fpdf2 allows Pillow>=8.3.2, so 9.x can still be resolved. | ||
| # CVE-2024-28219 (buffer overflow) fixed in Pillow 10.3.0 — https://nvd.nist.gov/vuln/detail/CVE-2024-28219 | ||
| "pillow>=10.3.0", | ||
| ] | ||
|
|
||
| [project.optional-dependencies] | ||
| # Desktop launcher (pywebview pulls in heavy system libs — GTK/Qt on Linux — | ||
| # so it is intentionally excluded from the web-server and CI installs). | ||
| desktop = ["pywebview>=5.0,<6"] | ||
|
|
||
| # Development tooling: testing + type checking. | ||
| dev = [ | ||
| "pytest>=8,<9", | ||
| "mypy>=1.10,<2", | ||
| ] | ||
|
|
||
| [project.scripts] | ||
| # Primary CLI: export Cursor chat histories to Markdown / zip. | ||
| # Usage: cursor-chat-export [--since all|last] [--out DIR] [--no-zip] [--help] | ||
| cursor-chat-export = "scripts.export:main" | ||
|
|
||
| # Desktop launcher (requires the [desktop] extra to be installed). | ||
| cursor-chat-browser = "launcher:main" | ||
|
bradjin8 marked this conversation as resolved.
|
||
|
|
||
| [project.urls] | ||
| Repository = "https://github.com/cppalliance/cppa-cursor-browser" | ||
| Issues = "https://github.com/cppalliance/cppa-cursor-browser/issues" | ||
|
|
||
| # ── Build configuration ──────────────────────────────────────────────────────── | ||
| # Flat layout (no src/ directory): enumerate every importable package and the | ||
| # two top-level application modules so the installed wheel has the same import | ||
| # surface as the repo checkout. | ||
| [tool.hatch.build.targets.wheel] | ||
| include = [ | ||
| "api/", | ||
| "models/", | ||
| "scripts/", | ||
| "services/", | ||
| "utils/", | ||
| "templates/", | ||
| "static/", | ||
| "app.py", | ||
| "launcher.py", | ||
| ] | ||
|
coderabbitai[bot] marked this conversation as resolved.
bradjin8 marked this conversation as resolved.
|
||
|
|
||
| # sdist includes tests + ancillary files; wheel is runtime-only. | ||
| [tool.hatch.build.targets.sdist] | ||
| include = [ | ||
| "api/", | ||
| "models/", | ||
| "scripts/", | ||
| "services/", | ||
| "utils/", | ||
| "tests/", | ||
| "templates/", | ||
| "static/", | ||
| "app.py", | ||
| "launcher.py", | ||
| "requirements.txt", | ||
| "README.md", | ||
| "LICENSE", | ||
| "cursor-browser.spec", | ||
| ] | ||
|
|
||
| # ── Mypy ────────────────────────────────────────────────────────────────────── | ||
| # Mirrors the flags used in .github/workflows/tests.yml so local `mypy .` | ||
| # and CI produce identical results. | ||
| [tool.mypy] | ||
| ignore_missing_imports = true | ||
| no_strict_optional = true | ||
| pretty = true | ||
| # Exclude virtual-env and build artefact directories so that `mypy .` from the | ||
| # repo root matches CI behaviour (CI runs in a clean runner without a local venv). | ||
| # Anchored regexes — unanchored `venv/` would match any path segment containing "venv/". | ||
| exclude = ["^venv/", "^\\.venv/", "^build/", "^dist/"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| flask>=3.0 | ||
| fpdf2>=2.7 | ||
| pywebview>=5.0 | ||
| # Backward-compatibility shim — mirrors [project.dependencies] in pyproject.toml. | ||
| # Keep version specifiers in sync when runtime deps change. | ||
| # | ||
| # Prefer: pip install -e . (installs the package + runtime deps) | ||
| # pip install -e ".[dev]" (+ pytest and mypy) | ||
| # pip install -e ".[desktop]" (+ pywebview for the GUI launcher) | ||
| flask>=3.0,<4 | ||
| fpdf2>=2.7,<3 | ||
| pillow>=10.3.0 | ||
| # pywebview is desktop-only — install with: pip install -e ".[desktop]" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.