Skip to content

Conversation

remimimimimi
Copy link
Contributor

@Hofer-Julian
Copy link
Contributor

Sorry @remimimimimi we already changed the way this works 😇

#55

Copy link
Collaborator

@lucascolley lucascolley left a comment

Choose a reason for hiding this comment

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

thanks Valentin, LGTM!

@lucascolley
Copy link
Collaborator

can we remove the .env.ci once to sanity-check that it fails without the Pixi PR?

Copy link
Contributor

@Hofer-Julian Hofer-Julian left a comment

Choose a reason for hiding this comment

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

Looks good, I've added a few comments

version = "0.1.0"

[package.build]
source = { git = "https://github.com/prefix-dev/pixi-build-testsuite.git", rev = "ee87916a49d5e96d4f322f68c3650e8ff6b8866b", subdirectory = "tests/data/pixi_build/cpp-with-path-to-source/project" }
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be possible to point to a git directory via a path.

That way we don't have to make a network request and the test will run faster

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, let's use the much simpler tests/data/pixi_build/minimal-backend-workspaces/pixi-build-cmake/ instead

Comment on lines +28 to +31
channels = [
"https://prefix.dev/pixi-build-backends",
"https://prefix.dev/conda-forge",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

The backend will be overriden anyway so no need to specify channels for it

Suggested change
channels = [
"https://prefix.dev/pixi-build-backends",
"https://prefix.dev/conda-forge",
]

Comment on lines +507 to +531
@pytest.mark.slow
def test_git_path(pixi: Path, build_data: Path, tmp_pixi_workspace: Path) -> None:
"""
Test git path in `[package.build.source]`
"""
project = "cpp-with-git-source"
test_data = build_data.joinpath(project)

shutil.copytree(test_data, tmp_pixi_workspace, dirs_exist_ok=True, copy_function=shutil.copy)

verify_cli_command(
[
pixi,
"build",
"-v",
"--manifest-path",
tmp_pixi_workspace,
"--output-dir",
tmp_pixi_workspace,
],
)

# Ensure that exactly one conda package has been built
built_packages = list(tmp_pixi_workspace.glob("*.conda"))
assert len(built_packages) == 1
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes more sense to make the test similar to this:

def test_pixi_minimal_backend(pixi_project: Path, pixi: Path, tmp_pixi_workspace: Path) -> None:
# Remove existing .pixi folders
shutil.rmtree(pixi_project.joinpath(".pixi"), ignore_errors=True)
# Copy to workspace
shutil.copytree(pixi_project, tmp_pixi_workspace, dirs_exist_ok=True)
# Get manifest
manifest = get_manifest(tmp_pixi_workspace)
# Install the environment
verify_cli_command(
[pixi, "run", "-v", "--locked", "--manifest-path", manifest, "start"],
stdout_contains="Build backend works",
)

That way you test that the package actually works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants