hatch-meson


Namehatch-meson JSON
Version 0.1.0b1 PyPI version JSON
download
home_pageNone
SummaryHatchling plugin for building extensions via meson
upload_time2024-11-11 04:20:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords hatch meson
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            hatch-meson
===========

Hatchling plugins that allow building native extensions using Meson and bundling
them into your python projects that use Hatchling.

Should I use this?
------------------

If you want to build python wheels that contain native extensions built using
Meson... you probably should use [meson-python](https://github.com/mesonbuild/meson-python)
and not use this project.

### Why does this exist then?

Meson is great for building native libraries due to its simple, straightforward
build syntax. This simplicity is one of its most compelling features, but
at the same time can make it impossible to accomplish something that the Meson
designers did not intend to make possible.

As a Hatchling build plugin, this project allows you to leverage Meson to handle
what it does best, and use other Hatchling plugins for tasks Meson doesn’t support.

When using hatch-meson, it is intended that you only use meson for things that
require a build system, and that you use Hatchling features for other aspects
of packaging a python project.

### How is this different from meson-python

The initial version of hatch-meson contains a lot of code that is copied directly
from `meson-python`, as are the initial set of tests, so it's not that different.
However, there are some differences.

* Creating a source distribution only uses Hatchling, so scripts added via
  `meson.add_dist_script` are not ran
* Currently this does not bundle libraries into your wheel
* Editable installs are supported, but with key differences
  * Built artifacts are copied into the source tree
  * Importing your project will not automatically trigger a rebuild
* It is not required to use `py.install_sources` to specify all of your python
  files. You can if you want, but it is recommended to use Hatchling's
  standard mechanisms for doing this instead
* Will not create wheels that contain both purelib and platlib packages

While hatch-meson will try to support many of the same things that meson-python
supports, it is not a goal to have the exact same behavior.

Documentation
-------------

TODO, but much of the meson-python documentation applies. Except the parts that don't.

All of the options supported in `pyproject.toml` can be found in the dataclasses
at [src/hatch_meson/config.py](src/hatch_meson/config.py)

Usage
-----

Use this `pyproject.toml` to retrieve the name/version from your `meson.build`:

```toml
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-meson"]

[project]
dynamic = ["name", "version"]

[tool.hatch.version]
source = "meson"

[tool.hatch.build.hooks.meson]
[tool.hatch.metadata.hooks.meson]
```

If you prefer to use the standard Hatchling project settings, you can omit
the version and metadata hooks.

```toml
[build-system]
build-backend = "hatchling.build"
requires = ["hatch-meson"]

[project]
name = "myproject"
# version needs to be either specified here or you can use a different hatch
# plugin to set the version


[tool.hatch.build.hooks.meson]
[tool.hatch.metadata.hooks.meson]
```

Building an sdist and wheel can be done using standard python build tooling. Refer
to the hatch documentation for more details.

Credit
------

The meson-python project drove a lot of changes in meson to make it possible to
build wheels using meson. Much of the code and tests for this package are directly
copied from the meson-python project, and this would have been way more work if
it didn't exist.

All bugs in hatch-meson are probably my fault.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "hatch-meson",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "hatch, meson",
    "author": null,
    "author_email": "Dustin Spicuzza <dustin@virtualroadside.com>",
    "download_url": "https://files.pythonhosted.org/packages/78/da/3bb33d758bd9306c7157cf06e495dc548810643c3f6287dd5e3f8a1c92c0/hatch_meson-0.1.0b1.tar.gz",
    "platform": null,
    "description": "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\u2019t 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",
    "bugtrack_url": null,
    "license": null,
    "summary": "Hatchling plugin for building extensions via meson",
    "version": "0.1.0b1",
    "project_urls": {
        "Source": "https://github.com/virtuald/hatch-meson",
        "Tracker": "https://github.com/virtuald/hatch-meson/issues"
    },
    "split_keywords": [
        "hatch",
        " meson"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ab6548595d6b1a2acc84e4b9dbf29f74b733ff5d1fe22976fe50a4a408dbd822",
                "md5": "2045b1926289c81d27ce539d7bb45d16",
                "sha256": "693c28f490f336cb7bef768abfceaaa17ff7401237c62ef587ec6f99784769d7"
            },
            "downloads": -1,
            "filename": "hatch_meson-0.1.0b1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2045b1926289c81d27ce539d7bb45d16",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 16387,
            "upload_time": "2024-11-11T04:20:35",
            "upload_time_iso_8601": "2024-11-11T04:20:35.794882Z",
            "url": "https://files.pythonhosted.org/packages/ab/65/48595d6b1a2acc84e4b9dbf29f74b733ff5d1fe22976fe50a4a408dbd822/hatch_meson-0.1.0b1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "78da3bb33d758bd9306c7157cf06e495dc548810643c3f6287dd5e3f8a1c92c0",
                "md5": "31a58873efc88df74bda758047e0bf7e",
                "sha256": "e95fef3ab3d530c46ad6970c72da20cd5b7165dd790d5bc5037e2bf147667743"
            },
            "downloads": -1,
            "filename": "hatch_meson-0.1.0b1.tar.gz",
            "has_sig": false,
            "md5_digest": "31a58873efc88df74bda758047e0bf7e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 32554,
            "upload_time": "2024-11-11T04:20:37",
            "upload_time_iso_8601": "2024-11-11T04:20:37.576056Z",
            "url": "https://files.pythonhosted.org/packages/78/da/3bb33d758bd9306c7157cf06e495dc548810643c3f6287dd5e3f8a1c92c0/hatch_meson-0.1.0b1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-11 04:20:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "virtuald",
    "github_project": "hatch-meson",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "hatch-meson"
}
        
Elapsed time: 0.67311s