Delegation resolution when wagtail-cli is installed as a tool?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 5
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Problem statement
Currently - if I install the wagtail-cli as a tool via
uv tool install wagtail-cli
I think I am not able to use the wt command delegation in my project, because it will find that manage.py is a file, but it will try to execute it with the python from the tools environment, which need not have django installed.
Similarly for wt --help (which runs its own delegation detection)
Proposed solution
Could check whether django is available in the current environment before passing to manage.py or try to execute the manage.py file directly so it can use the python from the files shebang, but maybe that isn't cross-platform?
Alternative solutions
No response
Additional context
No response
Working on this
Contribute to the discussion to help this move forward. Explain your use cases, discuss possible solutions, research how to adapt existing code, or compatibility concerns.
Once others agree with the proposed changes, anyone can contribute to this. View our contributing guidelines. Add a comment to the issue to explain what approach you are taking.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the delegation logic in src/wagtail_cli/cli/main.py at lines 193-203 and 227-237, then reproduce the behavior after installing wagtail-cli with uv tool install. Compare normal delegation with wt --help and determine how the project environment should be selected when manage.py is present. Done means delegation no longer tries to run manage.py with the tool environment's Python.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100