pymsbuild-rust


Namepymsbuild-rust JSON
Version 0.1.8 PyPI version JSON
download
home_pagehttps://github.com/zooba/pymsbuild-rust
SummaryA pymsbuild extension for compiling native modules written in Rust.
upload_time2024-09-12 20:08:17
maintainerNone
docs_urlNone
authorSteve Dower
requires_pythonNone
licenseNone
keywords build pep-517 msbuild packaging rust
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pymsbuild-rust

This is a [pymsbuild](https://pypi.org/project/pymsbuild) extension for
compiling native modules written in Rust.

# Quick Start

In your `_msbuild.py`, import `RustPydFile` and `Cargo` from `pymsbuild_rust`
(using `import *` is okay).

While Cargo is used to run the build, all files need to be specified from your
`_msbuild.py` file to be collected when building an sdist, and to handle
incremental builds correctly.

```python
from pymsbuild import *
from pymsbuild_rust import *

METADATA = {...}

PACKAGE = Package(
    'package',
    PyFile("__init__.py"),
    RustPydFile(
        "native",
        Cargo("Cargo.toml"),
        SourceFile("src/lib.rs"),
        source="native"
    ),
)
```

The `Cargo` element refers to your `Cargo.toml`, which should specify that a
`cdylib` is to be built. The name of the lib should match the name provided to
`RustPydFile`, which will also be the resulting extension module's name.

```toml
[lib]
name = "native"
crate-type = ["cdylib"]
```

Other than this, the module may build in any way it likes. Most likely, you
will use [PyO3](https://pyo3.rs/), and so should follow their documentation for
instructions on setting up the rest of your project (ignoring the parts that
refer to other build backends such as Maturin).

Other files listed in the `RustPydFile` will be included in your sdist, and will
be used to determine whether the module needs to be recompiled.

Theoretically, multiple `Cargo` elements will trigger multiple builds. However,
as they will all be directed into the same directory, this may not do what you
hope. Advanced users may find some value regardless.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/zooba/pymsbuild-rust",
    "name": "pymsbuild-rust",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "build, pep-517, msbuild, packaging, rust",
    "author": "Steve Dower",
    "author_email": "steve.dower@python.org",
    "download_url": "https://files.pythonhosted.org/packages/e8/a2/e0788745160eb2d170aba954b28fe78e340507ad40849d07c714ab6e63c3/pymsbuild_rust-0.1.8.tar.gz",
    "platform": null,
    "description": "# pymsbuild-rust\n\nThis is a [pymsbuild](https://pypi.org/project/pymsbuild) extension for\ncompiling native modules written in Rust.\n\n# Quick Start\n\nIn your `_msbuild.py`, import `RustPydFile` and `Cargo` from `pymsbuild_rust`\n(using `import *` is okay).\n\nWhile Cargo is used to run the build, all files need to be specified from your\n`_msbuild.py` file to be collected when building an sdist, and to handle\nincremental builds correctly.\n\n```python\nfrom pymsbuild import *\nfrom pymsbuild_rust import *\n\nMETADATA = {...}\n\nPACKAGE = Package(\n    'package',\n    PyFile(\"__init__.py\"),\n    RustPydFile(\n        \"native\",\n        Cargo(\"Cargo.toml\"),\n        SourceFile(\"src/lib.rs\"),\n        source=\"native\"\n    ),\n)\n```\n\nThe `Cargo` element refers to your `Cargo.toml`, which should specify that a\n`cdylib` is to be built. The name of the lib should match the name provided to\n`RustPydFile`, which will also be the resulting extension module's name.\n\n```toml\n[lib]\nname = \"native\"\ncrate-type = [\"cdylib\"]\n```\n\nOther than this, the module may build in any way it likes. Most likely, you\nwill use [PyO3](https://pyo3.rs/), and so should follow their documentation for\ninstructions on setting up the rest of your project (ignoring the parts that\nrefer to other build backends such as Maturin).\n\nOther files listed in the `RustPydFile` will be included in your sdist, and will\nbe used to determine whether the module needs to be recompiled.\n\nTheoretically, multiple `Cargo` elements will trigger multiple builds. However,\nas they will all be directed into the same directory, this may not do what you\nhope. Advanced users may find some value regardless.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A pymsbuild extension for compiling native modules written in Rust.",
    "version": "0.1.8",
    "project_urls": {
        "Bug Tracker": "https://github.com/zooba/pymsbuild-rust/issues",
        "Homepage": "https://github.com/zooba/pymsbuild-rust"
    },
    "split_keywords": [
        "build",
        " pep-517",
        " msbuild",
        " packaging",
        " rust"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70524923e7e4561e0ca7dfe4db935481403f54710aac38b1b4b351d5e1a4fc7c",
                "md5": "b2cae48a72c9b2a31eadf3af8ff500d5",
                "sha256": "3428fdb37add7256f992f7b47292706987b783c6e1fa06c761fcbb8aa830209d"
            },
            "downloads": -1,
            "filename": "pymsbuild_rust-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b2cae48a72c9b2a31eadf3af8ff500d5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10793,
            "upload_time": "2024-09-12T20:08:16",
            "upload_time_iso_8601": "2024-09-12T20:08:16.683405Z",
            "url": "https://files.pythonhosted.org/packages/70/52/4923e7e4561e0ca7dfe4db935481403f54710aac38b1b4b351d5e1a4fc7c/pymsbuild_rust-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8a2e0788745160eb2d170aba954b28fe78e340507ad40849d07c714ab6e63c3",
                "md5": "49a5582b8c6922d115bf529fa77db20f",
                "sha256": "747644c66bdf89354c3bda72b7df7533c7c2eac6012425ec444d44603f959e1e"
            },
            "downloads": -1,
            "filename": "pymsbuild_rust-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "49a5582b8c6922d115bf529fa77db20f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4686,
            "upload_time": "2024-09-12T20:08:17",
            "upload_time_iso_8601": "2024-09-12T20:08:17.544664Z",
            "url": "https://files.pythonhosted.org/packages/e8/a2/e0788745160eb2d170aba954b28fe78e340507ad40849d07c714ab6e63c3/pymsbuild_rust-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-12 20:08:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "zooba",
    "github_project": "pymsbuild-rust",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pymsbuild-rust"
}
        
Elapsed time: 0.45007s