pypa / pypa/packaging.python.org
The packaging-projects tutorial does not work with hatch
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 1.7k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 4
Description
Hello,
I hope this is the right place :) after https://github.com/python/cpython/issues/111009
This tutorial
https://packaging.python.org/en/latest/tutorials/packaging-projects/
says:
"this tutorial uses Hatchling by default, but it will work identically with setuptools, Flit, PDM, and others that support the [project] table for metadata."
But it seems it was converted from a tutorial with setuptools.
Hatchling does not seem to work well when the source of the package is in a src/ folder.
My repository here
https://github.com/LLyaudet/django-monkey-patches
demonstrates the problem.
I had to switch from hatch to setuptools to have a wheel that is correct.
Otherwise code was installed in lib/python3.11/site-packages/src/django-monkey-patches instead of lib/python3.11/site-packages/django_monkey_patches.
Best regards,
Laurent Lyaudet
Contributor guide
No contributing guide indexed for this repository
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 with the packaging-projects tutorial and reproduce the issue using the linked django-monkey-patches repository. Compare the Hatchling and setuptools configurations, then verify the built wheel installs the package as django_monkey_patches rather than under src/. Done means the tutorial works correctly with Hatchling or clearly documents the supported layout and configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100