diff --git a/DEVELOP.md b/DEVELOP.md index de97c03..cdab40d 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -28,6 +28,18 @@ uv run maturin develop -m obstore/Cargo.toml --release to compile `obstore` with release optimizations turned on. +### Maturin import hook + +Run +``` +uv run python -m maturin_import_hook site install +``` + +to ensure that obstore is automatically recompiled if changed whenever you +import `obstore` in Python. + +See [import hook docs](https://www.maturin.rs/import_hook) for more information. + ### Tests All obstore tests should go into the top-level `tests` directory. diff --git a/pyproject.toml b/pyproject.toml index ace72b4..791361c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ dev-dependencies = [ "griffe-inherited-docstrings>=1.0.1", "griffe>=1.6.0", "ipykernel>=6.29.5", + "maturin-import-hook>=0.2.0", "maturin>=1.7.4", "mike>=2.1.3", "mkdocs-material[imaging]>=9.6.3", diff --git a/uv.lock b/uv.lock index c2434d3..2e7806c 100644 --- a/uv.lock +++ b/uv.lock @@ -799,6 +799,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/50/b3/b51f09c2ba432a576fe63758bddc81f78f0c6309d9e5c10d194313bf021e/fastapi-0.115.12-py3-none-any.whl", hash = "sha256:e94613d6c05e27be7ffebdd6ea5f388112e5e430c8f7d6494a9d1d88d43e814d", size = 95164 }, ] +[[package]] +name = "filelock" +version = "3.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0a/10/c23352565a6544bdc5353e0b15fc1c563352101f30e24bf500207a54df9a/filelock-3.18.0.tar.gz", hash = "sha256:adbc88eabb99d2fec8c9c1b229b171f18afa655400173ddc653d5d01501fb9f2", size = 18075 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4d/36/2a115987e2d8c300a974597416d9de88f2444426de9571f4b59b2cca3acc/filelock-3.18.0-py3-none-any.whl", hash = "sha256:c401f4f8377c4464e6db25fff06205fd89bdd83b65eb0488ed1b160f780e21de", size = 16215 }, +] + [[package]] name = "flask" version = "3.1.0" @@ -1414,6 +1423,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/a4/f5/051413e04f6da25069db5e76759ecdb8cd2a8ab4a94045b5a3bf548c66fa/maturin-1.8.1-py3-none-win_arm64.whl", hash = "sha256:e95f077fd2ddd2f048182880eed458c308571a534be3eb2add4d3dac55bf57f4", size = 6552131 }, ] +[[package]] +name = "maturin-import-hook" +version = "0.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "filelock" }, + { name = "tomli", marker = "python_full_version < '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/93/5f/9d426545c49926f4212fbe6244bc397508a29f65e35fe307835c07c0be7b/maturin_import_hook-0.2.0.tar.gz", hash = "sha256:e8a81333179faf7b5f413e44c2a1c89604fefff433679275f724950b0a632adf", size = 31071 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/44/48/1e88f90750a66825a5ea8fd2e26908e4e4acade0fe5a378c36d14bc0138d/maturin_import_hook-0.2.0-py3-none-any.whl", hash = "sha256:742d882213d6aa24bacf6775ce26ab96bd4ee26ceafbbbad69d60fdc98d95ec8", size = 31134 }, +] + [[package]] name = "mergedeep" version = "1.3.4" @@ -3275,6 +3297,7 @@ dev = [ { name = "griffe-inherited-docstrings" }, { name = "ipykernel" }, { name = "maturin" }, + { name = "maturin-import-hook" }, { name = "mike" }, { name = "mkdocs" }, { name = "mkdocs-material", extra = ["imaging"] }, @@ -3314,6 +3337,7 @@ dev = [ { name = "griffe-inherited-docstrings", specifier = ">=1.0.1" }, { name = "ipykernel", specifier = ">=6.29.5" }, { name = "maturin", specifier = ">=1.7.4" }, + { name = "maturin-import-hook", specifier = ">=0.2.0" }, { name = "mike", specifier = ">=2.1.3" }, { name = "mkdocs", specifier = ">=1.6.1" }, { name = "mkdocs-material", extras = ["imaging"], specifier = ">=9.6.3" },