Skip to content

feat(init): support optional path argument like uv init <path>#48

Open
Copilot wants to merge 7 commits into
masterfrom
copilot/add-cluv-init-path-support
Open

feat(init): support optional path argument like uv init <path>#48
Copilot wants to merge 7 commits into
masterfrom
copilot/add-cluv-init-path-support

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

cluv init only operated on the current working directory. This adds an optional <path> argument mirroring uv init <path> behavior.

Changes

  • cluv/cli/init.py: init() accepts path: Path | None = None; when given, creates the directory (including parents) if missing, then chdir into it before the normal init flow
  • cluv/__main__.py: registers optional positional <path> arg (nargs='?', type=Path) on the init subparser
  • tests/test_init.py: adds TestInitPath covering new-dir creation, existing-dir entry, and no-chdir when path is omitted

Usage

# Existing behavior unchanged
cluv init

# New: create and init a named project directory
cluv init my_project

Copilot AI linked an issue May 12, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 12, 2026 17:05
Copilot AI changed the title [WIP] Add support for cluv init at a specified path feat(init): support optional path argument like uv init <path> May 12, 2026
Copilot AI requested a review from lebrice May 12, 2026 17:07
@lebrice lebrice marked this pull request as ready for review May 13, 2026 15:58
@lebrice
Copy link
Copy Markdown
Contributor

lebrice commented May 13, 2026

@copilot fix the conflicts in tests/test_init.py and rebase the branch on master.

…it-path-support

Co-authored-by: lebrice <13387299+lebrice@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.92%. Comparing base (72228e1) to head (95287e0).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
cluv/__main__.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #48      +/-   ##
==========================================
+ Coverage   39.49%   41.92%   +2.42%     
==========================================
  Files          14       14              
  Lines        1109     1114       +5     
==========================================
+ Hits          438      467      +29     
+ Misses        671      647      -24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot fix the conflicts in tests/test_init.py and rebase the branch on master.

Done in d96d4f9. Merged master into the branch and resolved the conflicts in tests/test_init.py — master's two new TestJobScriptCheck methods are now preserved, and the TestInitPath tests have been updated to use the module-level CLUV_INIT_MODULE variable (already introduced by master) instead of sys.modules.

Comment thread tests/test_init.py Outdated
Copilot AI requested a review from lebrice May 13, 2026 17:04
Comment thread tests/test_init.py Outdated
Copilot AI requested a review from lebrice May 14, 2026 20:28
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.

Should be able to cluv init at a specified path

3 participants