{"id":21840412,"url":"https://github.com/virtuald/hatch-meson","last_synced_at":"2025-10-08T08:31:26.684Z","repository":{"id":262034822,"uuid":"886038998","full_name":"virtuald/hatch-meson","owner":"virtuald","description":"Hatchling plugins that allow you to build native extensions using Meson","archived":false,"fork":false,"pushed_at":"2024-11-11T04:07:32.000Z","size":48,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T08:33:47.728Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/virtuald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-10T02:53:34.000Z","updated_at":"2024-11-14T19:53:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"940944ea-3f06-47da-b993-6eaf31d3817b","html_url":"https://github.com/virtuald/hatch-meson","commit_stats":null,"previous_names":["virtuald/hatch-meson"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fhatch-meson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fhatch-meson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fhatch-meson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/virtuald%2Fhatch-meson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/virtuald","download_url":"https://codeload.github.com/virtuald/hatch-meson/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235694193,"owners_count":19030772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T21:25:57.135Z","updated_at":"2025-10-08T08:31:21.395Z","avatar_url":"https://github.com/virtuald.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"hatch-meson\n===========\n\nHatchling plugins that allow building native extensions using Meson and bundling\nthem into your python projects that use Hatchling.\n\nShould I use this?\n------------------\n\nIf you want to build python wheels that contain native extensions built using\nMeson... you probably should use [meson-python](https://github.com/mesonbuild/meson-python)\nand not use this project.\n\n### Why does this exist then?\n\nMeson is great for building native libraries due to its simple, straightforward\nbuild syntax. This simplicity is one of its most compelling features, but\nat the same time can make it impossible to accomplish something that the Meson\ndesigners did not intend to make possible.\n\nAs a Hatchling build plugin, this project allows you to leverage Meson to handle\nwhat it does best, and use other Hatchling plugins for tasks Meson doesn’t support.\n\nWhen using hatch-meson, it is intended that you only use meson for things that\nrequire a build system, and that you use Hatchling features for other aspects\nof packaging a python project.\n\n### How is this different from meson-python\n\nThe initial version of hatch-meson contains a lot of code that is copied directly\nfrom `meson-python`, as are the initial set of tests, so it's not that different.\nHowever, there are some differences.\n\n* Creating a source distribution only uses Hatchling, so scripts added via\n  `meson.add_dist_script` are not ran\n* Currently this does not bundle libraries into your wheel\n* Editable installs are supported, but with key differences\n  * Built artifacts are copied into the source tree\n  * Importing your project will not automatically trigger a rebuild\n* It is not required to use `py.install_sources` to specify all of your python\n  files. You can if you want, but it is recommended to use Hatchling's\n  standard mechanisms for doing this instead\n* Will not create wheels that contain both purelib and platlib packages\n\nWhile hatch-meson will try to support many of the same things that meson-python\nsupports, it is not a goal to have the exact same behavior.\n\nDocumentation\n-------------\n\nTODO, but much of the meson-python documentation applies. Except the parts that don't.\n\nAll of the options supported in `pyproject.toml` can be found in the dataclasses\nat [src/hatch_meson/config.py](src/hatch_meson/config.py)\n\nUsage\n-----\n\nUse this `pyproject.toml` to retrieve the name/version from your `meson.build`:\n\n```toml\n[build-system]\nbuild-backend = \"hatchling.build\"\nrequires = [\"hatch-meson\"]\n\n[project]\ndynamic = [\"name\", \"version\"]\n\n[tool.hatch.version]\nsource = \"meson\"\n\n[tool.hatch.build.hooks.meson]\n[tool.hatch.metadata.hooks.meson]\n```\n\nIf you prefer to use the standard Hatchling project settings, you can omit\nthe version and metadata hooks.\n\n```toml\n[build-system]\nbuild-backend = \"hatchling.build\"\nrequires = [\"hatch-meson\"]\n\n[project]\nname = \"myproject\"\n# version needs to be either specified here or you can use a different hatch\n# plugin to set the version\n\n\n[tool.hatch.build.hooks.meson]\n[tool.hatch.metadata.hooks.meson]\n```\n\nBuilding an sdist and wheel can be done using standard python build tooling. Refer\nto the hatch documentation for more details.\n\nCredit\n------\n\nThe meson-python project drove a lot of changes in meson to make it possible to\nbuild wheels using meson. Much of the code and tests for this package are directly\ncopied from the meson-python project, and this would have been way more work if\nit didn't exist.\n\nAll bugs in hatch-meson are probably my fault.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fhatch-meson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvirtuald%2Fhatch-meson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvirtuald%2Fhatch-meson/lists"}