Skip to content

chore(build): migrate from setuptools to hatchling#94

Merged
ternaus merged 2 commits intomainfrom
chore/migrate-to-hatchling
Apr 7, 2026
Merged

chore(build): migrate from setuptools to hatchling#94
ternaus merged 2 commits intomainfrom
chore/migrate-to-hatchling

Conversation

@ternaus
Copy link
Copy Markdown
Contributor

@ternaus ternaus commented Apr 7, 2026

Replace setuptools/wheel build backend with hatchling. Simplifies package discovery config — hatchling automatically includes py.typed and all package data without explicit declarations.

Made-with: Cursor

Replace setuptools/wheel build backend with hatchling. Simplifies package
discovery config — hatchling automatically includes py.typed and all package
data without explicit declarations.

Made-with: Cursor
Copilot AI review requested due to automatic review settings April 7, 2026 12:07
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the project’s Python build backend from setuptools/wheel to hatchling, aiming to simplify package discovery and packaging configuration.

Changes:

  • Switch [build-system] backend from setuptools.build_meta to hatchling.build.
  • Replace tool.setuptools package discovery/package-data configuration with tool.hatch.build wheel/sdist target configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


package-data = { albucore = [ "py.typed" ] }
[tool.hatch.build.targets.wheel]
packages = ["albucore"]
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

With hatchling, non-.py package data is not always included unless explicitly selected by the wheel file selection rules. To avoid accidentally dropping PEP 561 typing support, explicitly include albucore/py.typed in the wheel build configuration (or configure wheel include/artifacts/shared-data accordingly) so the marker file is guaranteed to be present in the built wheel.

Suggested change
packages = ["albucore"]
packages = ["albucore"]
include = ["albucore/py.typed"]

Copilot uses AI. Check for mistakes.
pyproject.toml Outdated
[tool.setuptools.exclude-package-data]
"*" = [ "tests*", "benchmarks*", "benchmark*", "conda.recipe*" ]
[tool.hatch.build.targets.sdist]
exclude = ["tests", "benchmarks", "benchmark", "conda.recipe"]
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

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

[tool.hatch.build.targets.sdist].exclude entries look like plain directory names; hatchling expects glob patterns, so this may not exclude the directory contents from the sdist. Consider switching these to directory globs (e.g., tests/**, benchmarks/**, etc.) so unwanted sources are reliably excluded from the sdist artifact.

Suggested change
exclude = ["tests", "benchmarks", "benchmark", "conda.recipe"]
exclude = ["tests/**", "benchmarks/**", "benchmark/**", "conda.recipe/**"]

Copilot uses AI. Check for mistakes.
Explicitly include albucore/py.typed in wheel target and use glob patterns
for sdist excludes so hatchling reliably strips test/benchmark dirs.

Made-with: Cursor
@ternaus ternaus merged commit ee10298 into main Apr 7, 2026
5 checks passed
@ternaus ternaus deleted the chore/migrate-to-hatchling branch April 7, 2026 12:21
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