Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 07ff360

Browse files
committed
chore: moving python package to a subdirectory
It is needed to prevent import errors as the repo root sometimes gets into the PYTHONPATH, e.g. when python interactive is used. In that case the native extension may not be loadable. See also PyO3/maturin#490
1 parent 5df7e64 commit 07ff360

File tree

6 files changed

+6
-2
lines changed

6 files changed

+6
-2
lines changed

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"Cargo.toml"
9292
"Cargo.lock"
9393
"pyproject.toml"
94-
"unblob_native"
94+
"python"
9595
"benches"
9696
"src"
9797
"README.md"

pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ build-backend = "maturin"
4141

4242
[tool.maturin]
4343
module-name = "unblob_native._native"
44+
python-source = "python"
4445

4546
features = [
4647
"pyo3/extension-module", # This is an extension module
@@ -92,7 +93,7 @@ ignore = [
9293
]
9394

9495
[tool.ruff.per-file-ignores]
95-
"unblob_native/__init__.py" = [
96+
"python/unblob_native/__init__.py" = [
9697
"F403",
9798
"A001",
9899
"F405",
@@ -103,6 +104,9 @@ ignore = [
103104
"S101", # assert: Enable usage of asserts
104105
]
105106

107+
[tool.ruff.isort]
108+
known-first-party = ["unblob_native"]
109+
106110
[tool.ruff.flake8-pytest-style]
107111
fixture-parentheses = false
108112
mark-parentheses = false
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)