--dockerfile-inputs --deps: the stop message names only `npm i` or `bundle`, not the command on the line

Open Beginner friendly
#726 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
86/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, python
Domain
cli, tooling

Research direction

In src/wheelgap/dockerfile.py, find the if dependencies and install.scripts: branch by searching for runs the project's own code, which may install Python packages; it builds the message from report.scripts[0], whose third element (shown_command) is the full command the warning already quotes. Reword the message to quote that command and match the phrasing given in the issue, leaving the stop conditions and the warnings untouched. Then update test_dockerfile_requirements_warns_about_project_code_before_an_install in tests/test_dockerfile.py to expect shown for every row of _PROJECT_SCRIPTS + _PROJECT_BUILDS, run that test, and add one CHANGELOG.md bullet under ## Unreleased. Done when the test passes offline and no other test still asserts the old wording.

Written by the indexing model from the issue text.

Description

bug good first issue

With --deps, --dockerfile-inputs stops when a command that runs the project's own code comes before an install it reads. The stop message names only the first word or two of that command, so the reader can't tell which part of the line was meant, and some messages don't read as English:

Reproduced with the released uvx wheelgap==0.14.0 (same code on main):

$ cat Dockerfile
FROM python:3.13-slim
WORKDIR /app
COPY requirements.txt .
RUN npm i -g ./tools/x
RUN pip install -r requirements.txt
$ uvx wheelgap==0.14.0 --dockerfile Dockerfile --dockerfile-inputs --deps
wheelgap: error: Dockerfile:4: npm i runs the project's own code, which may install Python packages before the install on line 5, and with --deps they change what that install fetches

Other lines give bundle runs the project's own code (for bundle exec rake setup) and npm run runs the project's own code (for npm run build). Without --deps, the warning for the same line quotes the whole command, which is clearer: this line runs `npm install left-pad --no-save`, which runs scripts wheelgap can't see into.

Where

src/wheelgap/dockerfile.py: the if dependencies and install.scripts: branch (search for runs the project's own code, which may install Python packages). It takes spelling from report.scripts[0]; the same tuple already holds the full command (shown_command, the third item), which the warnings use.

What to do

  • Quote the command in that message the way the warning does: line 4: this line runs `npm i -g ./tools/x`, which runs the project's own code and may install Python packages before the install on line 5; with --deps they change what that install fetches.
  • Don't change which lines stop, or the warnings.

Done when

  • test_dockerfile_requirements_warns_about_project_code_before_an_install in tests/test_dockerfile.py matches the quoted command (it builds shown for the warning already) instead of spelling, for every row of _PROJECT_SCRIPTS + _PROJECT_BUILDS. It fails on main.
  • Any other test that matches the old wording is updated.
  • No network in the tests.
  • One CHANGELOG.md bullet under ## Unreleased.
Dominant language
Python
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from patrickballard/wheelgap

All issues in patrickballard/wheelgap

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.