Skip to content

Commit

Permalink
Fix python import error (#22)
Browse files Browse the repository at this point in the history
move python packages to dedicated python directory as per PyO3/maturin#855
  • Loading branch information
MusicalNinjaDad authored May 13, 2024
1 parent c132883 commit 5f9f284
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
// "image": "ghcr.io/musicalninjas/pyo3-devcontainer:latest", // untested with mac, expect issues due to x_64 rust installation
"build": {
"dockerfile": "Dockerfile",
"args": {
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-rust.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Deploy Rust
concurrency: ADO-Cargo

on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e .[dev]
python -m pip install -e .[test]
python -m pip install pytest-cov
- name: Test with pytest
run: |
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Issues = "https://github.com/MusicalNinjaDad/fizzbuzz/issues"
version = { file = "__pyversion__" }

[tool.setuptools.packages.find]
where = ["fizzbuzz"]
where = ["python"]

[[tool.setuptools-rust.ext-modules]]
# Private Rust extension module to be nested into the Python package
target = "fizzbuzzo3" # The last part of the name (e.g. "_lib") has to match lib.name in Cargo.toml,
target = "fizzbuzz.fizzbuzzo3" # The last part of the name (e.g. "_lib") has to match lib.name in Cargo.toml,
# but you can add a prefix to nest it inside of a Python package.
path = "fizzbuzzo3/Cargo.toml"
binding = "PyO3"
Expand Down Expand Up @@ -78,7 +78,7 @@ addopts = [

[tool.coverage.run]
branch = true
omit = ["test_*"]
omit = ["test_*", "tests/*"]
dynamic_context = "test_function"

[tool.ruff]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion tests/test_fizzbuzzo3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

from fizzbuzz.fizzbuzzo3 import fizzbuzz


Expand Down

0 comments on commit 5f9f284

Please sign in to comment.