Add hatchling build backend so the package installs - #4
Merged
Conversation
pyproject.toml had no [build-system], so uv treated the project as "virtual" (non-packaged): `uv sync` skipped installing entry points and neither the `domain-profiler` console script nor `python -m domain_profiler` resolved — running required a `PYTHONPATH=src` prefix. Add a hatchling build backend pointing at src/domain_profiler. uv now builds and installs the project as an editable package, so both `uv run domain-profiler ...` and `uv run python -m domain_profiler ...` (and pytest) work without PYTHONPATH. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds an explicit PEP 517 build backend so uv treats domain-profiler as an installable package (not a virtual project), enabling entry points and python -m domain_profiler to work without PYTHONPATH=src.
Changes:
- Add a
[build-system]section usinghatchlingand configure wheel packaging to includesrc/domain_profiler. - Update
uv.lockso the workspace source is resolved aseditablerather thanvirtual.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pyproject.toml | Adds hatchling build backend + wheel package mapping for the src/ layout. |
| uv.lock | Updates the project source type from virtual to editable to reflect installable packaging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses PR #4 review: with the PEP 621 metadata + hatchling build backend now driving packaging, the leftover [tool.poetry] package config is redundant and Poetry isn't used anywhere else in the repo. Remove it to avoid implying Poetry is the canonical build config. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The project uses uv (uv.lock) with a hatchling build backend; Poetry isn't used anywhere. Remove the leftover poetry.lock so there's a single source of truth for the dependency lock. Co-Authored-By: Claude Opus 4.8 (1M context) <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
pyproject.tomlhad no[build-system], so uv treated the project as virtual (non-packaged). As a resultuv syncskipped installing entry points, and neither thedomain-profilerconsole script norpython -m domain_profilerresolved — running the CLI required aPYTHONPATH=srcprefix:Fix
Add a hatchling build backend pointing at
src/domain_profiler:uv now builds and installs the project as an editable package (
uv.locksource flipsvirtual→editable), so all invocations work withoutPYTHONPATH:Testing
uv run pytest: 148 passed (noPYTHONPATHneeded).uv run domain-profiler run example.comanduv run python -m domain_profiler run example.comproduce a report.🤖 Generated with Claude Code