Skip to content

Add pixi support #6157

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Add pixi support #6157

wants to merge 5 commits into from

Conversation

edmundmiller
Copy link
Member

Hi! Thanks for contributing to Nextflow.

When submitting a Pull Request, please sign-off the DCO [1] to certify that you are the author of the contribution and you adhere to Nextflow's open source license [2] by adding a Signed-off-by line to the contribution commit message. See [3] for more details.

  1. https://developercertificate.org/
  2. https://github.com/nextflow-io/nextflow/blob/master/COPYING
  3. https://github.com/apps/dco

- Introduced PixiConfig and PixiCache classes for managing Pixi environments.
- Updated Session class to include PixiConfig retrieval.
- Enhanced CmdRun with options to enable/disable Pixi environments.
- Modified ConfigBuilder to apply Pixi environment settings based on command-line options.
- Updated BashWrapperBuilder to include Pixi activation in the execution script.
- Added pixiEnv property to TaskBean and methods in TaskRun for Pixi environment handling.
- Updated ProcessConfig to include 'pixi' in process configuration options.

This commit integrates Pixi environment management into the Nextflow framework, allowing users to specify and control Pixi environments during execution.

Signed-off-by: Edmund Miller <[email protected]>
- Introduced PixiCacheTest and PixiConfigTest classes to validate Pixi environment functionality.
- Added tests for TOML and lock file detection, environment prefix path creation, and command execution handling.
- Implemented checks for configuration options and cache directory retrieval in PixiConfig.

This commit enhances the test coverage for Pixi environment management, ensuring robust functionality within the Nextflow framework.

Signed-off-by: Edmund Miller <[email protected]>
- Introduced PixiCacheIntegrationTest class to validate PixiCache behavior with various environment specifications.
- Implemented tests for creating environments from package specifications, TOML files, and lock files.
- Added checks for handling custom cache directories and validating TOML and lock file detection.
- Enhanced coverage for existing prefix directory handling and environment variable cache directory usage.

This commit strengthens the testing framework for PixiCache, ensuring reliable environment management within the Nextflow ecosystem.

Signed-off-by: Edmund Miller <[email protected]>
- Changed the environment specification from 'python=3.8' to 'cowpy'.
- Updated the script to utilize cowpy for output instead of a Python command.

This modification enhances the testing of Pixi environments by leveraging cowpy for greeting functionality.
@edmundmiller edmundmiller self-assigned this Jun 3, 2025
Copy link

netlify bot commented Jun 3, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit ea3d975
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6846d737b3ea840008e84995
😎 Deploy Preview https://deploy-preview-6157--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso force-pushed the master branch 3 times, most recently from b4b321e to 069653d Compare June 4, 2025 18:54
@adamrtalbot adamrtalbot linked an issue Jun 16, 2025 that may be closed by this pull request
Comment on lines +565 to +578
if( pixiFile.exists() ) {
// Read the project directory path
final projectDir = pixiFile.text.trim()
result += "cd ${Escape.path(projectDir as String)} && "
result += "eval \"\$(pixi shell-hook --shell bash)\" && "
result += "cd \"\$OLDPWD\"\n"
}
else {
// Direct activation from environment directory
result += "cd ${Escape.path(pixiEnv)} && "
result += "eval \"\$(pixi shell-hook --shell bash)\" && "
result += "cd \"\$OLDPWD\"\n"
}
return result
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is OLDPWD defined? Doesn't this change to the projectDir? Should we overwrite projectDir with the pixiFile contents?

While it's uncessary duplication, I prefer copying the pixi lock file into the working dir and using it at source, so we have a record. This has the additional advantage of making the code more simple and supporting a .pixi or pixi.lock file (psuedocode):

Suggested change
if( pixiFile.exists() ) {
// Read the project directory path
final projectDir = pixiFile.text.trim()
result += "cd ${Escape.path(projectDir as String)} && "
result += "eval \"\$(pixi shell-hook --shell bash)\" && "
result += "cd \"\$OLDPWD\"\n"
}
else {
// Direct activation from environment directory
result += "cd ${Escape.path(pixiEnv)} && "
result += "eval \"\$(pixi shell-hook --shell bash)\" && "
result += "cd \"\$OLDPWD\"\n"
}
return result
// assuming you have copied the pixi file to working dir
if( pixiFile.exists() ) {
result += "[ -d .pixi ] && [ -f pixi.lock ] || pixi install"
result += "eval \"\$(pixi shell-hook --shell bash)\""
}
return result

Downside - massive duplication of text files in every work dir.

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.

Support for Pixi
3 participants