Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: editable install cover package navigation #535

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/packages/navigate_editable/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies = [
]

[tool.scikit-build]
wheel.packages = ["python/shared_pkg"]
wheel.packages = ["python/shared_pkg", "python/py_pkg"]
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ..py2_pkg import py2_method_a

__all__ = ["py2_method_a"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from ..py2_pkg import py2_method_b
from ..py2_pkg.py2_module import py2_method_c

__all__ = ["py2_method_b", "py2_method_c"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def py2_method_a():
print("py2_method_a")


def py2_method_b():
print("py2_method_b")
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def py2_method_c():
print("py2_method_c")
32 changes: 32 additions & 0 deletions tests/test_editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,35 @@ def test_navigate_editable(isolated, isolate, package):

value = isolated.execute("import shared_pkg; shared_pkg.read_c_generated_txt()")
assert value == "Some_value_C"


@pytest.mark.compile()
@pytest.mark.configure()
@pytest.mark.integration()
@pytest.mark.parametrize("isolate", [True, False], ids=["isolated", "notisolated"])
@pytest.mark.usefixtures("navigate_editable")
def test_navigate_editable2(isolated, isolate):
isolate_args = ["--no-build-isolation"] if not isolate else []
isolated.install("pip>=23")
if not isolate:
isolated.install("scikit-build-core[pyproject]")

isolated.install(
"-v", "--config-settings=build-dir=build/{wheel_tag}", *isolate_args, "-e", "."
)

# Navigate from py_package to py_package
value = isolated.execute("import py_pkg.py1_pkg; py_pkg.py1_pkg.py2_method_a()")
assert value == "py2_method_a"

# Navigate from py_package.py_module to py_package
value = isolated.execute(
"import py_pkg.py1_pkg.py1_module; py_pkg.py1_pkg.py1_module.py2_method_b()"
)
assert value == "py2_method_b"
Comment on lines +72 to +76
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dialecticDolt, I have reproduced your error here


# Navigate from py_package.py_module to py_package.py_module
value = isolated.execute(
"import py_pkg.py1_pkg.py1_module; py_pkg.py1_pkg.py1_module.py2_method_c()"
)
assert value == "py2_method_c"