Make ck self-contained via PEP 723 inline script dependencies - #14
Open
rex1fernando wants to merge 3 commits into
Open
Make ck self-contained via PEP 723 inline script dependencies#14rex1fernando wants to merge 3 commits into
rex1fernando wants to merge 3 commits into
Conversation
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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
ckdeclaring its runtime dependencies, and changes the shebang to#!/usr/bin/env -S uv run --script, so a plain./ckworks with no venv orpip installstep — uv resolves and caches the dependencies on first run.pipx run ./ckworks as well (pipx parses PEP 723 natively).ckon your PATH” instead of the venv wrapper shell function, and the testing commands useuv run --with-requirements requirements.txtso they work without a venv.bibtexparser<2in both the inline block andrequirements.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:
--scriptflag in the shebang is required because the file has no.pyextension, so uv doesn't auto-detect the inline metadata (uv run ./ckalone would skip it).weasyprint(inrequirements.txt) is not in the inline block because it isn't imported anywhere in the code;pytestis test-only.requirements.txtworkflow keeps working — for that path, invoke the script aspython3 ck.PATHstill resolves the localcitationkeyspackage (Python resolves the symlink when settingsys.path[0]).Test plan
./ck --helpruns from a clean environment (verified: uv installs the 9 deps into a cached env, CLI works)pipx run ./ck --help(verified)🤖 Generated with Claude Code