pymsbuild-rust


Namepymsbuild-rust JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://github.com/zooba/pymsbuild-rust
SummaryA pymsbuild extension for compiling native modules written in Rust.
upload_time2024-01-03 20:37:46
maintainer
docs_urlNone
authorSteve Dower
requires_python
license
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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "build,pep-517,msbuild,packaging,rust",
    "author": "Steve Dower",
    "author_email": "steve.dower@python.org",
    "download_url": "https://files.pythonhosted.org/packages/37/1c/51eada5cbf9abd190944d208d250d3db719895e48157b166fbdfb7db7e57/pymsbuild_rust-0.1.6.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": "",
    "summary": "A pymsbuild extension for compiling native modules written in Rust.",
    "version": "0.1.6",
    "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": "57f7f5ee17b46ac57cec8b56ea3aba262eb9fb378770e0fa34d2f70c026e9ade",
                "md5": "15942a0180a84c75e447e08024e9d483",
                "sha256": "48c7cb9dba008eb5279cc1718d81bc0e1b7496ad72b4645d334c5af31179f88d"
            },
            "downloads": -1,
            "filename": "pymsbuild_rust-0.1.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "15942a0180a84c75e447e08024e9d483",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10318,
            "upload_time": "2024-01-03T20:37:45",
            "upload_time_iso_8601": "2024-01-03T20:37:45.179512Z",
            "url": "https://files.pythonhosted.org/packages/57/f7/f5ee17b46ac57cec8b56ea3aba262eb9fb378770e0fa34d2f70c026e9ade/pymsbuild_rust-0.1.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "371c51eada5cbf9abd190944d208d250d3db719895e48157b166fbdfb7db7e57",
                "md5": "ffe7aa29112af83a4508286183afb3ff",
                "sha256": "88a8617fdff447764edcabb5d78d283b620e9db9ed62dec830ad419c033aab9a"
            },
            "downloads": -1,
            "filename": "pymsbuild_rust-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "ffe7aa29112af83a4508286183afb3ff",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4554,
            "upload_time": "2024-01-03T20:37:46",
            "upload_time_iso_8601": "2024-01-03T20:37:46.726677Z",
            "url": "https://files.pythonhosted.org/packages/37/1c/51eada5cbf9abd190944d208d250d3db719895e48157b166fbdfb7db7e57/pymsbuild_rust-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-03 20:37:46",
    "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.15546s