⏺ The trick is to add [tool.hatch.metadata] with allow-direct-references = true — actually, the
relevant trick here is to mark the package with a private classifier or set the PyPI publishing
URL to nothing. The cleanest approach with hatchling is to add:
[tool.hatch.publish.index]
disable = true
This tells hatch publish to skip the PyPI index entirely. Alternatively, if you're using a GitHub
Actions release workflow, you can also set private = true in the project metadata (not a standard
field) — but the hatch-native way is cleaner.
⏺ The trick is to add [tool.hatch.metadata] with allow-direct-references = true — actually, the
relevant trick here is to mark the package with a private classifier or set the PyPI publishing
URL to nothing. The cleanest approach with hatchling is to add:
[tool.hatch.publish.index]
disable = true
This tells hatch publish to skip the PyPI index entirely. Alternatively, if you're using a GitHub
Actions release workflow, you can also set private = true in the project metadata (not a standard
field) — but the hatch-native way is cleaner.