chore: use hatchling instead of setuptools (#4770)

This swaps out the build backend of pyodide-build for hatchling, which is
simpler and faster.

The difference in the SDists: This removes the zip directories entries,
setup.cfg, and .egg-info directory and contents. It includes the .gitignore,
since hatchling uses that to decide what to include by default.

The difference in the wheel built from the SDist: The useless top_level.txt is
gone and the license is in the licenses directory.
This commit is contained in:
Henry Schreiner 2024-05-19 05:38:17 -04:00 committed by GitHub
parent 354e7a1864
commit 1b4660d8bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 17 deletions

View File

@ -1,6 +1,6 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "pyodide-build"
@ -71,19 +71,10 @@ deploy = [
"moto",
]
[tool.setuptools]
package-dir = {"" = "."}
license-files = ["LICENSE"]
include-package-data = false
[tool.hatch]
version.path = "pyodide_build/__init__.py"
[tool.setuptools.packages.find]
where = ["."]
exclude = ["pyodide_build.tests*"]
namespaces = true
[tool.setuptools.package-data]
"pyodide_build.tools" = ["*.ini", "*.cross"]
"pyodide_build.tools.cmake.Modules.Platform" = ["*.cmake"]
[tool.setuptools.dynamic]
version = {attr = "pyodide_build.__version__"}
[tool.hatch.build.targets.sdist]
exclude = [
"/pyodide_build/tests",
]