diff --git a/install b/install index 3564c48e..97036f17 100755 --- a/install +++ b/install @@ -17,6 +17,7 @@ if ! command -v uv &> /dev/null; then fi uv venv --python 3.11 --seed +uv pip install "maturin>=1.7,<2" uv pip install -e . uv pip install -r requirements.testing.txt diff --git a/pyproject.toml b/pyproject.toml index 4250f035..6d4b4d98 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,10 @@ [build-system] -requires = ["setuptools>=65.5.1", "setuptools-scm", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["maturin>=1.7,<2"] +build-backend = "maturin" [project] name = "fastled" +version = "2.0.6" readme = "README.md" description = "FastLED Wasm Compiler" requires-python = ">=3.10" @@ -27,13 +28,11 @@ dependencies = [ "zccache>=1.1.20", ] -dynamic = ["version"] - -[tool.setuptools] -package-dir = {"" = "src"} - -[tool.setuptools.dynamic] -version = { attr = "fastled.__version__" } +[tool.maturin] +manifest-path = "crates/fastled-py/Cargo.toml" +module-name = "fastled._native" +python-source = "src" +features = ["pyo3/extension-module", "pyo3/abi3-py310"] [tool.ruff] line-length = 200 diff --git a/setup.py b/setup.py deleted file mode 100644 index 46c191d1..00000000 --- a/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -""" -Setup file. -""" - -import os - -from setuptools import setup - -URL = "https://github.com/zackees/fastled-wasm" -KEYWORDS = "FastLED Wasm Compiler Toolchain" -HERE = os.path.dirname(os.path.abspath(__file__)) - - - -if __name__ == "__main__": - setup( - maintainer="Zachary Vorhies", - keywords=KEYWORDS, - url=URL, - package_data={ - "": [ - "assets/example.txt", - "assets/localhost.pem", - "assets/localhost-key.pem", - "frontend/*", - "frontend/**/*", - ] - }, - include_package_data=True) - diff --git a/src/fastled/__init__.py b/src/fastled/__init__.py index 73864828..268b551d 100644 --- a/src/fastled/__init__.py +++ b/src/fastled/__init__.py @@ -4,6 +4,11 @@ from pathlib import Path from .__version__ import __version__ + +try: + from fastled._native import version as _native_version +except ImportError: + _native_version = None from .build_service import BuildService from .build_types import BuildRequest, BuildResult from .site.build import build