Skip to content

fix: copy README.md in Dockerfile for setup.py long_description#792

Open
vivekchand wants to merge 1 commit intomainfrom
fix/gh-594-dockerfile-readme
Open

fix: copy README.md in Dockerfile for setup.py long_description#792
vivekchand wants to merge 1 commit intomainfrom
fix/gh-594-dockerfile-readme

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Closes #594

What

Fixes Docker build failure caused by setup.py requiring README.md for the long_description field, but the file not being copied into the Docker build context.

Error

FileNotFoundError: [Errno 2] No such file or directory: 'README.md'

Fix

Add COPY README.md . to the Dockerfile before pip install -e . runs.

Verification

  • Docker build now completes successfully
  • No functional changes to the application

@vivekchand vivekchand force-pushed the fix/gh-594-dockerfile-readme branch from a094fc6 to 4119295 Compare April 27, 2026 07:09
Copy link
Copy Markdown
Owner Author

@vivekchand vivekchand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan & review notes

What changed

  • Adds COPY README.md . to the Dockerfile immediately before pip install -e ., so setup.py can open README.md for long_description without a FileNotFoundError.

Smoke commands

  • docker build -t clawmetry-test . — verify build succeeds without "README.md not found" error
  • docker run --rm clawmetry-test python -c "import clawmetry" — verify package imports cleanly

Likely failure modes

  • COPY order matters: README.md must be copied before pip install -e . runs (setup.py opens it at import time). The PR places the new line correctly — above the RUN pip install --no-cache-dir -e . step — so this is fine.
  • If README.md is ever renamed or moved, this line will need updating alongside setup.py.

Issue link

  • Closes #594 (confirmed in PR body)

Generated by Claude Code

Copy link
Copy Markdown
Owner Author

@vivekchand vivekchand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan & review notes

What changed

  • Adds COPY README.md . to Dockerfile before pip install -e . so setup.py can read it for long_description without a FileNotFoundError.

Still relevant?

  • No superseding merged PR found for this fix. The Dockerfile still has setup.py reading README.md at install time, so the build failure is still live on main without this patch. Relevant and safe to merge.

Smoke commands

  • python3 dashboard.py --port 8900
  • docker build -t clawmetry-test . && echo "BUILD OK"
  • Optionally: docker run --rm clawmetry-test python3 -c "import clawmetry; print('import OK')"

Likely failure modes

  • If README.md is ever renamed or removed from the repo root, this line will break the build again — the real fix is setup.py using open('README.md', errors='ignore') or a try/except; this PR is the minimal correct fix for now.
  • No risk of functional regression — single-line, build-only change.

Issue link


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

@vivekchand vivekchand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan & review notes

Repo: vivekchand/clawmetry

What changed

  • Dockerfile: adds COPY README.md . before pip install -e . so setup.py's long_description read no longer throws FileNotFoundError

Smoke commands

  • docker build -t clawmetry-test . 2>&1 | tail -10 — should complete without FileNotFoundError: README.md
  • docker run --rm clawmetry-test python3 -c "import dashboard; print('ok')" — sanity import check

Likely failure modes from the diff

  • If ci.yml runs pip install -e . outside Docker in a directory that also lacks README.md, CI would hit the same error — worth checking whether the CI workflow copies README.md before the install step
  • No functional regression risk; purely a build fix

Issue link


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

@vivekchand vivekchand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test plan & review notes

Repo: vivekchand/clawmetry

What changed

  • Added COPY README.md . to Dockerfile before pip install -e . so setup.py's long_description = open("README.md").read() doesn't raise FileNotFoundError during build.

Smoke commands

  • docker build -t clawmetry-test . — confirm build succeeds with README present
  • docker run --rm clawmetry-test python3 -c "import clawmetry; print('ok')" — verify package installs cleanly

Likely failure modes from the diff

  • .dockerignore excluding README.md would still cause the build to fail — worth confirming README.md isn't listed there.
  • COPY order looks fine: README.md is copied before pip install -e . (line ~25), so no layer-ordering issue.
  • Single-stage build only, so no concern about multi-stage layer bleed.

Issue link

  • Closes #594 (confirmed from PR body)

Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Test plan & review notes

Repo: vivekchand/clawmetry

What changed

  • Dockerfile: adds COPY README.md . before pip install -e . (1 file, +1 line) to fix FileNotFoundError when setup.py reads README.md for long_description

Smoke commands

  • docker build -t clawmetry-test . → should complete without FileNotFoundError
  • docker run --rm clawmetry-test python3 -c "import dashboard; print('ok')" → sanity-check import works in the built image

Likely failure modes from the diff

  • Single-line change, no logic touched. One edge case: if README.md is excluded via .dockerignore, the COPY would still fail — confirm it's not listed there.

Issue link


Generated by Claude Code

Copy link
Copy Markdown
Owner Author

Auto-rebase janitor: the COPY README.md . line this PR adds to Dockerfile is already present in main (added via a later commit that also added COPY history.py ., COPY helpers/ ./helpers/, COPY routes/ ./routes/). This PR's change has been superseded. Consider closing it.


Generated by Claude Code

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.

docker build error "FileNotFoundError: [Errno 2] No such file or directory: 'README.md'"

1 participant