+
Skip to content

Update conda env sorting #3591

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

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open

Update conda env sorting #3591

wants to merge 15 commits into from

Conversation

edmundmiller
Copy link
Contributor

@edmundmiller edmundmiller commented May 30, 2025

Adds extra tests. Didn't realize #3584 added the environment.yml listing so recently.

Closes #3590

Started in: nf-core/modules#7085

This fixes an issue with the Seqera containers' naming.

The Seqera containers site doesn't care about the context of what module the
image is for. It just sorts the dependencies.

This avoids having multiple containers with a bunch of different names.

PR checklist

  • This comment contains a description of changes (with reason)
  • CHANGELOG.md is updated
  • If you've fixed a bug or added code that should be tested, add tests!
  • Documentation in docs is updated

@edmundmiller edmundmiller changed the title Add Conda env sorting Update conda env sorting May 30, 2025
@edmundmiller edmundmiller self-assigned this May 30, 2025
@edmundmiller edmundmiller added this to the 3.4.0 milestone May 30, 2025
@edmundmiller edmundmiller linked an issue May 30, 2025 that may be closed by this pull request
@mashehu
Copy link
Contributor

mashehu commented May 30, 2025

Just had a quick look on the phone. for me having first pip and then immediately followed by pip dependencies made more sense. Is there a standard here?

@mashehu
Copy link
Contributor

mashehu commented May 30, 2025

@nf-core-bot fix linting

Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

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

Please use ruaml for yaml parsing so we don't lose comments.

Also the channel order has a meaning, so I think we shouldn't touch it.

@edmundmiller edmundmiller mentioned this pull request May 30, 2025
4 tasks
@edmundmiller
Copy link
Contributor Author

Please use ruaml for yaml parsing so we don't lose comments.

I was just following the previous standard 🙃 I had it originally implemented with ruaml.

@edmundmiller
Copy link
Contributor Author

@nf-core-bot fix linting

mashehu
mashehu previously approved these changes May 30, 2025
Copy link
Contributor

@mashehu mashehu left a comment

Choose a reason for hiding this comment

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

I am confused. what's the difference between the functionality in this PR vs #3584
Don't the create the same result in the end?
The additional tests are fine.

@mashehu mashehu dismissed their stale review May 30, 2025 19:22

Wanted to just comment not yet remove

@mashehu
Copy link
Contributor

mashehu commented May 30, 2025

*approve

Stupid github phone app...

@edmundmiller
Copy link
Contributor Author

No extra functionality, I just missed that you had fixed this 3 days ago 🙃 .

Copy link

codecov bot commented Jun 3, 2025

Codecov Report

Attention: Patch coverage is 98.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.90%. Comparing base (619dd6e) to head (ede037b).

Files with missing lines Patch % Lines
nf_core/modules/lint/environment_yml.py 98.00% 1 Missing ⚠️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edmundmiller edmundmiller requested a review from mashehu June 3, 2025 14:49
@edmundmiller edmundmiller enabled auto-merge June 3, 2025 14:49
@mashehu mashehu added the awaiting-changes Needs changes after a review. Remove label when ready to be reviewed again. label Jun 16, 2025
@edmundmiller edmundmiller requested a review from mirpedrol July 1, 2025 14:16
…dling

- Renamed test functions for clarity.
- Introduced DummyModule and DummyLint classes to simulate module and lint behavior.
- Enhanced tests for handling invalid, empty, and missing dependencies in environment.yml files.
- Improved assertions to validate sorting and schema compliance.
edmundmiller and others added 13 commits July 1, 2025 09:45
- Replaced yaml library with ruamel.yaml for improved YAML processing.
- Added schema validation for environment.yml files.
- Implemented sorting for dependencies and channels, ensuring proper order.
- Updated file writing to include schema lines and sorted content.
- Enhanced logging for sorting actions and validation results.
…processing

- Updated the YAML library from ruamel.yaml to PyYAML for improved compatibility.
- Changed YAML loading to use safe_load for better security.
- Enhanced YAML dumping with specific formatting options for clarity.
- Adjusted error handling to reflect the new library usage.
…ent.yml processing"

This reverts commit 34d5b00.

Co-authored-by: mashehu <mashehu@users.noreply.github.com>
…endencies

Co-authored-by: mashehu <mashehu3@gmail.com>
…l sorting

- Removed channel sorting logic from environment.yml processing.
- Updated related tests to reflect channel preservation instead of sorting.
- Adjusted logging messages to focus solely on dependency sorting.

Co-authored-by: mashehu <mashehu3@gmail.com>
- Introduced factory fixtures for creating DummyModule and DummyLint instances to streamline test setup.
- Updated tests to utilize the new setup_lint_environment fixture for improved clarity and maintainability.
- Enhanced assertions for YAML parsing results in the environment.yml sorting tests.
- Added parameterized tests for handling invalid and empty YAML files.
- Updated pytest.ini_options in pyproject.toml to include a new "integration" marker for better test categorization.
…nt_test attribute

- Changed the assertion to check for the "environment_yml_sorted" in the lint.passed list using the lint_test attribute instead of the previous tuple structure.
but it is a link to another json file
@mashehu mashehu modified the milestones: 3.4.0, 3.5.0 Jul 8, 2025
@edmundmiller edmundmiller removed the awaiting-changes Needs changes after a review. Remove label when ready to be reviewed again. label Jul 11, 2025
@mashehu
Copy link
Contributor

mashehu commented Jul 14, 2025

because we already have a working and tested sorting, how difficult would it be to revert the changes to it in this PR and only keep the tests? or is there a bigger difference between the two implementations i don't see?

@edmundmiller
Copy link
Contributor Author

because we already have a working and tested sorting, how difficult would it be to revert the changes to it in this PR and only keep the tests? or is there a bigger difference between the two implementations i don't see?

It uses ruaml which was a request you had

Please use ruaml for yaml parsing so we don't lose comments.

If you'd feel more comfortable, we can break the tests into a PR and then the changes into a second PR.

@mashehu
Copy link
Contributor

mashehu commented Jul 15, 2025

It uses ruaml which was a request you had

That was before I understood that it re-implements the sorting functionality 🙂

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

Successfully merging this pull request may close these issues.

Sort modules conda environment files
3 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载