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

Support for conda #459

Merged
merged 4 commits into from
Jan 27, 2025
Merged

Support for conda #459

merged 4 commits into from
Jan 27, 2025

Conversation

Dhananjhay
Copy link
Contributor

@Dhananjhay Dhananjhay commented Nov 22, 2024

Proposed changes

This PR adds a conditional import for the ruamel_yaml dependency. This change is necessary because the conda package manager installs the package as ruamel_yaml, while pip installs it as ruamel. This discrepancy leads to import errors when working in a conda environment. The conditional import ensures we are agnostic to the installation method, preventing the import error.

Bug Fix:
This PR resolves the import error issue that occurs when the ruamel.yaml module is installed via conda. By handling both cases, it ensures the code works in both pip and conda environments.

Checklist

  • Changes have been tested to ensure that fix is effective or that a feature works.
  • Changes pass the unit tests
  • I have included necessary documentation or comments (as necessary)
  • Any dependent changes have been merged and published

Copy link
Member

@akhanf akhanf 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 to me

@Dhananjhay
Copy link
Contributor Author

It'll be nice to close this PR soon and merge the necessary changes now that snakebids v0.13.1 is available on bio-conda ecosystem (https://anaconda.org/bioconda/snakebids)

@akhanf
Copy link
Member

akhanf commented Jan 15, 2025

What would we need to do to get the unit tests passing? Looks like pyright type checking is failing.. I'm not exactly sure why changing how its imported affects this, but if we can sort that out then we can merge in.

@Dhananjhay
Copy link
Contributor Author

@akhanf This new commit skips type checking ruamel_yaml package coming from conda - reason why pyright tests were failing because ruamel_yaml is raumel.yaml in pypi. I was able to run the pyright tests locally without any errors!

@Dhananjhay Dhananjhay requested a review from akhanf January 16, 2025 21:16
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.29%. Comparing base (0f07ece) to head (4c87db2).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
snakebids/io/yaml.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #459      +/-   ##
==========================================
- Coverage   94.37%   94.29%   -0.09%     
==========================================
  Files          55       55              
  Lines        2222     2225       +3     
==========================================
+ Hits         2097     2098       +1     
- Misses        125      127       +2     

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

Copy link
Member

@akhanf akhanf 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 to me, and passing tests, so I will merge this in..

@akhanf akhanf merged commit ae03e2d into khanlab:main Jan 27, 2025
4 checks passed
@akhanf
Copy link
Member

akhanf commented Jan 27, 2025

hmm, looks like the tests didn't actually run in the checks (which I thought they did), so they seem to be failing in main now..

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.

2 participants