Skip to content

Commit

Permalink
chore: moving python package to a subdirectory
Browse files Browse the repository at this point in the history
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
  • Loading branch information
vlaci committed May 14, 2023
1 parent 5163218 commit f649822
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"Cargo.toml"
"Cargo.lock"
"pyproject.toml"
"unblob_native"
"python"
"benches"
"src"
"README.md"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build-backend = "maturin"

[tool.maturin]
module-name = "unblob_native._native"
python-source = "python"

features = [
"pyo3/extension-module", # This is an extension module
Expand Down Expand Up @@ -89,7 +90,7 @@ ignore = [
]

[tool.ruff.per-file-ignores]
"unblob_native/__init__.py" = [
"python/unblob_native/__init__.py" = [
"F403",
"A001",
"F405",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit f649822

Please sign in to comment.