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 plugins for alternative FsAccess #233

Merged
merged 28 commits into from
Nov 22, 2024
Merged

support plugins for alternative FsAccess #233

merged 28 commits into from
Nov 22, 2024

Conversation

tetron
Copy link
Member

@tetron tetron commented Nov 18, 2024

This adds a slimmed down version of StdFsAccess class from cwltool, which is used to abstract the output file checks.

Adds Arvados as an optional dependency. Adjust cwltest to use ArvadosFsAccess if the arvados module is importable.

I copied StdFsAccess and CollectionFsAccess into this project to avoid
adding a dependency on cwltool.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <[email protected]>
Added partial arvados type stubs.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <[email protected]>
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 82.69231% with 9 lines in your changes missing coverage. Please review.

Project coverage is 81.31%. Comparing base (feeb0da) to head (a0409c0).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cwltest/utils.py 61.53% 5 Missing ⚠️
cwltest/stdfsaccess.py 84.61% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
- Coverage   81.52%   81.31%   -0.22%     
==========================================
  Files           8        9       +1     
  Lines         785      824      +39     
  Branches      190      195       +5     
==========================================
+ Hits          640      670      +30     
- Misses        111      118       +7     
- Partials       34       36       +2     

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


🚨 Try these New Features:

@tetron
Copy link
Member Author

tetron commented Nov 18, 2024

I did all the annotations to make mypy happy as well as linting and running format but codecov is going to block merging, because writing unit tests to cover the Arvados-specific code would only work if I stubbed out everything to the point that they would be useless as tests.

@tetron tetron requested a review from mr-c November 20, 2024 13:54
Copy link
Member

@mr-c mr-c left a comment

Choose a reason for hiding this comment

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

Hey Peter,

How are you all running cwltest, using the cwltest pytest plugin or directly through the cwltest CLI?

Seems like you want your own plugin to cwltest to use a custom StdFsAccess class. Perhaps that would be better than duplicating the arvados code here?

@tetron
Copy link
Member Author

tetron commented Nov 20, 2024

Hi Michael,

The thing I need is for the file checks to go through a abstracted interface, so I copied in a slimmed down version of StdFsAccess from cwltool.

If I revise the PR so it just adds that hook, I could remove the Arvados stuff from this PR and instead make my own arv-cwltest which hooks in my custom FsAccess object and then wraps cwltest, similar to how arvados-cwl-runner works. Is that what you are proposing?

@mr-c
Copy link
Member

mr-c commented Nov 20, 2024

If I revise the PR so it just adds that hook, I could remove the Arvados stuff from this PR and instead make my own arv-cwltest which hooks in my custom FsAccess object and then wraps cwltest, similar to how arvados-cwl-runner works. Is that what you are proposing?

Almost, if arvados-python-client (or another python package from Arvados) registered a module under the cwltest.fsaccess entry point, then this PR could automatically load that module and use its FsAccess member class instead of the StdFsAccess default.

https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/#using-package-metadata

@tetron
Copy link
Member Author

tetron commented Nov 21, 2024

@mr-c let me know if you're happy with this and we can hit the big green merge button.

@tetron
Copy link
Member Author

tetron commented Nov 21, 2024

Given the long battle with mypy and the linting tools, it'll probably make sense to squash this one.

@mr-c mr-c changed the title Arvados module support plugins for alternative FsAccess Nov 22, 2024
@mr-c mr-c merged commit fc92b48 into main Nov 22, 2024
33 checks passed
@mr-c mr-c deleted the arvados-module branch November 22, 2024 13:33
@mr-c
Copy link
Member

mr-c commented Nov 22, 2024

Thank you @tetron !

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