Skip to content

Add option to load script from a remote location#8208

Merged
TimMonko merged 3 commits into
napari:mainfrom
Czaki:execute_remote_script
Aug 15, 2025
Merged

Add option to load script from a remote location#8208
TimMonko merged 3 commits into
napari:mainfrom
Czaki:execute_remote_script

Conversation

@Czaki

@Czaki Czaki commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator

References and relevant issues

napari/docs#819 (comment)
napari/docs#819 (comment)

Description

Add an option to execute a Python script in napari without needing to download it on the local machine.

@Czaki
Czaki requested a review from a team as a code owner August 12, 2025 22:05
@github-actions github-actions Bot added the tests Something related to our tests label Aug 12, 2025
@Czaki

Czaki commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator Author

Requested by @TimMonko and @psobolewskiPhD. May be treated as security hole.

@TimMonko

Copy link
Copy Markdown
Member

While of course its a security hole, I think the same caution always applies to getting remote things, so is this really a napari liability?

@Czaki

Czaki commented Aug 12, 2025

Copy link
Copy Markdown
Collaborator Author

While of course its a security hole, I think the same caution always applies to getting remote things, so is this really a napari liability?

Nope. Maybe documentation should warn about this.

@codecov

codecov Bot commented Aug 12, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.76923% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.03%. Comparing base (5c653f2) to head (6e47369).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/napari_builtins/io/_read.py 78.26% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8208      +/-   ##
==========================================
+ Coverage   92.97%   93.03%   +0.05%     
==========================================
  Files         658      658              
  Lines       62604    62629      +25     
==========================================
+ Hits        58208    58265      +57     
+ Misses       4396     4364      -32     

☔ 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.

@psobolewskiPhD

Copy link
Copy Markdown
Member

It's pretty cool to do napari https://napari.org/stable/_downloads/8a24291ab87e35b7098a1effaa578569/3D_paths.py and run an example!
Works with the "New from Clipboard" too!!

@willingc

Copy link
Copy Markdown
Collaborator

I think mentioning using files from a trusted source is the most straightforward way to document this.

@TimMonko TimMonko added this to the 0.6.4 milestone Aug 13, 2025
Comment thread src/napari_builtins/io/_read.py Outdated
Comment thread src/napari_builtins/_tests/test_io.py Outdated

@willingc willingc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@Czaki Thanks for simplifying the test with parametrize.

I amended the other suggestion based on your comment.

@Czaki

Czaki commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator Author

Updated the code and function naming.

@TimMonko

Copy link
Copy Markdown
Member

With this will we be able to do
uvx --from 'napari[all]' napari remote_path_to_script to spin up a napari and script to show things off really fast?
https://docs.astral.sh/uv/guides/tools/#requesting-specific-versions

@Czaki

Czaki commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator Author

I think so

@willingc willingc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks @Czaki. Enjoy SciPy.

@willingc

willingc commented Aug 14, 2025

Copy link
Copy Markdown
Collaborator

For the macos error, do we know why there is no leak graph generated?

No files were found with the provided path: ./*leak-backref-graph*.pdf. No artifacts will be uploaded.

Update Nevermind. I just remember pystack isn't supported on macos.

@TimMonko TimMonko added ready to merge Last chance for comments! Will be merged in ~24h enhancement Improvement to pre-existing features labels Aug 15, 2025
@TimMonko
TimMonko merged commit c7caebd into napari:main Aug 15, 2025
100 of 108 checks passed
@github-actions github-actions Bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Aug 15, 2025
@TimMonko TimMonko added the highlight PR that should be mentioned in next release notes label Aug 15, 2025
@Czaki
Czaki deleted the execute_remote_script branch August 15, 2025 08:12
@imagesc-bot

Copy link
Copy Markdown

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/napari-0-6-4-release-candidate-for-testing/115732/2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improvement to pre-existing features highlight PR that should be mentioned in next release notes tests Something related to our tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants