Skip to content

Add hatchling build backend so the package installs - #4

Merged
MSAdministrator merged 3 commits into
mainfrom
fix/packaging-build-backend
Jul 2, 2026
Merged

Add hatchling build backend so the package installs#4
MSAdministrator merged 3 commits into
mainfrom
fix/packaging-build-backend

Conversation

@MSAdministrator

Copy link
Copy Markdown
Owner

Summary

pyproject.toml had no [build-system], so uv treated the project as virtual (non-packaged). As a result uv sync skipped installing entry points, and neither the domain-profiler console script nor python -m domain_profiler resolved — running the CLI required a PYTHONPATH=src prefix:

$ uv run domain-profiler run example.com
error: Failed to spawn: `domain-profiler`
  Caused by: No such file or directory (os error 2)

$ uv run python -m domain_profiler run example.com
No module named domain_profiler

Fix

Add a hatchling build backend pointing at src/domain_profiler:

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["src/domain_profiler"]

uv now builds and installs the project as an editable package (uv.lock source flips virtualeditable), so all invocations work without PYTHONPATH:

$ uv sync
 + domain-profiler==0.1.0 (from file:///.../domain-profiler)

$ uv run domain-profiler run example.com          # console script ✓
$ uv run python -m domain_profiler run example.com # module ✓

Testing

  • uv run pytest: 148 passed (no PYTHONPATH needed).
  • Verified both uv run domain-profiler run example.com and uv run python -m domain_profiler run example.com produce a report.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 using hatchling and configure wheel packaging to include src/domain_profiler.
  • Update uv.lock so the workspace source is resolved as editable rather than virtual.

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.

Comment thread pyproject.toml Outdated
MSAdministrator and others added 2 commits July 2, 2026 12:49
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>
@MSAdministrator
MSAdministrator merged commit 7d8aef7 into main Jul 2, 2026
7 checks passed
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.

2 participants