Skip to content

Commit 7706b5c

Browse files
committed
mpy-cross/pyproject.toml: Add pyproject.toml.
This will generate a wheel using the WASM binary. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
1 parent 8b26f4e commit 7706b5c

File tree

3 files changed

+70
-0
lines changed

3 files changed

+70
-0
lines changed

mpy-cross/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

mpy-cross/pyproject.toml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
[build-system]
2+
requires = [
3+
"hatchling",
4+
"hatch-requirements-txt",
5+
"hatch-vcs",
6+
]
7+
build-backend = "hatchling.build"
8+
9+
[project]
10+
name = "mpy_cross"
11+
description = "MicroPython cross-compiler"
12+
readme = "README.md"
13+
authors = [
14+
{name = "Damien George", email = "damien@micropython.org"},
15+
]
16+
urls = {Homepage = "https://github.com/micropython/micropython"}
17+
keywords = [
18+
"hardware",
19+
"micropython",
20+
]
21+
license = {text = "MIT"}
22+
classifiers = [
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: MIT License",
25+
"Operating System :: OS Independent",
26+
"Programming Language :: Python :: 3",
27+
"Topic :: Software Development :: Embedded Systems",
28+
"Topic :: System :: Hardware",
29+
]
30+
requires-python = ">=3.6"
31+
dynamic = ["dependencies", "version"]
32+
33+
[project.scripts]
34+
mpy_cross = "mpy_cross.main:main"
35+
36+
[tool.hatch.metadata.hooks.requirements_txt]
37+
files = ["requirements.txt"]
38+
39+
[tool.hatch.version]
40+
source = "vcs"
41+
tag-pattern = "(?P<version>v(\\d+).(\\d+).(\\d+))"
42+
raw-options = { root = "..", version_scheme = "post-release" }
43+
44+
[tool.hatch.build]
45+
packages = ["mpy_cross"]
46+
47+
# Package the compiled wasm binary and add it to the package for both wheel and sdist.
48+
# Must have run `make -j -f Makefile.wasm` first.
49+
[tool.hatch.build.force-include]
50+
"build-wasm/mpy-cross.wasm" = "mpy_cross/mpy-cross.wasm"
51+
52+
# Workaround to allow `python -m build` to work.
53+
[tool.hatch.build.targets.sdist.force-include]
54+
"build-wasm/mpy-cross.wasm" = "mpy_cross/mpy-cross.wasm"
55+
"requirements.txt" = "requirements.txt"

mpy-cross/requirements.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# wasmtime has the best general compatibility.
2+
wasmtime==11.0.0
3+
4+
# This will work just about anywhere but needs CPython
5+
# development headers installed (e.g. apt install python-dev).
6+
# pywasm3==0.5.0
7+
8+
# wasmer provide a universal "none" package that will install
9+
# anywhere that doesn't have a supported version. So it's always
10+
# safe to have as a dependency, it just might not actually
11+
# do anything if imported.
12+
# wasmer==1.1.0
13+
# wasmer-compiler-singlepass==1.1.0
14+
# wasmer-compiler-cranelift==1.1.0

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy