Skip to content

Make ck self-contained via PEP 723 inline script dependencies - #14

Open
rex1fernando wants to merge 3 commits into
alinush:masterfrom
rex1fernando:pep723-inline-deps
Open

Make ck self-contained via PEP 723 inline script dependencies#14
rex1fernando wants to merge 3 commits into
alinush:masterfrom
rex1fernando:pep723-inline-deps

Conversation

@rex1fernando

@rex1fernando rex1fernando commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • Adds a PEP 723 inline script metadata block to ck declaring its runtime dependencies, and changes the shebang to #!/usr/bin/env -S uv run --script, so a plain ./ck works with no venv or pip install step — uv resolves and caches the dependencies on first run. pipx run ./ck works as well (pipx parses PEP 723 natively).
  • Updates the README: setup is now “install uv, put ck on your PATH” instead of the venv wrapper shell function, and the testing commands use uv run --with-requirements requirements.txt so they work without a venv.
  • Pins bibtexparser<2 in both the inline block and requirements.txt: the code uses the v1 API (bibtexparser.bwriter, .customization, .latexenc), which was removed in bibtexparser 2.x, so an unpinned install can break.

Notes:

  • The explicit --script flag in the shebang is required because the file has no .py extension, so uv doesn't auto-detect the inline metadata (uv run ./ck alone would skip it).
  • weasyprint (in requirements.txt) is not in the inline block because it isn't imported anywhere in the code; pytest is test-only.
  • The old venv + requirements.txt workflow keeps working — for that path, invoke the script as python3 ck.
  • Running through a symlink from PATH still resolves the local citationkeys package (Python resolves the symlink when setting sys.path[0]).

Test plan

  • ./ck --help runs from a clean environment (verified: uv installs the 9 deps into a cached env, CLI works)
  • Same through a symlink from another directory
  • pipx run ./ck --help (verified)
  • Full pytest suite unaffected: 108 passed, 2 xfailed

🤖 Generated with Claude Code

rex1fernando and others added 3 commits July 31, 2026 13:55
The script now declares its own dependencies via PEP 723 inline script
metadata, and the shebang runs it through 'uv run --script', so a plain
'./ck' works with no venv or manual 'pip install' step (uv resolves and
caches the dependencies on first run). 'pipx run ./ck' works too.

Also pin bibtexparser<2 (here and in requirements.txt): the code uses
the v1 API (bibtexparser.bwriter, .customization, .latexenc), which was
removed in bibtexparser 2.x, so an unpinned install would break.

Note: the 'uv run --script' flag is required because the file has no
.py extension, so uv does not auto-detect the inline metadata.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The venv wrapper shell function is no longer needed: install uv, put
the script on PATH (symlink or alias), and it manages its own
dependencies. Also switch the testing commands to 'uv run
--with-requirements requirements.txt' so they work without a venv.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant