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 35e88c9 commit e8cd58a
Show file tree
Hide file tree
Showing 6 changed files with 6 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
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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 @@ -92,7 +93,7 @@ ignore = [
]

[tool.ruff.per-file-ignores]
"unblob_native/__init__.py" = [
"python/unblob_native/__init__.py" = [
"F403",
"A001",
"F405",
Expand All @@ -103,6 +104,9 @@ ignore = [
"S101", # assert: Enable usage of asserts
]

[tool.ruff.isort]
known-first-party = ["unblob_native"]

[tool.ruff.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit e8cd58a

Please sign in to comment.