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

.napari/DESCRIPTION.md and CITATION.cff required when using napari-hub-preview-action #376

Closed
Czaki opened this issue Jan 3, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Czaki
Copy link

Czaki commented Jan 3, 2022

Description

When .napari/DESCRIPTION.md orCITATION.cffis missed then napari-hub-preview-action fail with FileNotFoundError

https://github.com/4DNucleome/PartSeg/runs/4684547184?check_suite_focus=true#step:3:538

Steps/Code to Reproduce

Source of problem is not checking if file exists before try to open it:

if local_workspace:
# read files locally since github action already checked it out
with open(os.path.join(local_workspace, file)) as f:
return f.read()

The get_file function is called here:

description = get_file(repo_url, ".napari/DESCRIPTION.md", branch=branch)

and

citation_file = get_file(repo_url, "CITATION.cff", branch=branch)

Expected Results

Files should be optional:
4DNucleome/PartSeg#489 (comment)

Actual Results

 Traceback (most recent call last):
  File "napari-hub/backend/get_preview.py", line 17, in <module>
    get_plugin_preview(repo_pth, dest_pth, args.local, args.branch)
  File "/home/runner/work/PartSeg/PartSeg/napari-hub/backend/preview/preview.py", line 48, in get_plugin_preview
    github_metadata = get_github_metadata(action_repo_url, branch=branch)
  File "/home/runner/work/PartSeg/PartSeg/napari-hub/backend/utils/github.py", line 118, in get_github_metadata
    description = get_file(repo_url, ".napari/DESCRIPTION.md", branch=branch)
  File "/home/runner/work/PartSeg/PartSeg/napari-hub/backend/utils/github.py", line 51, in get_file
    with open(os.path.join(local_workspace, file)) as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/PartSeg/PartSeg/.napari/DESCRIPTION.md'

@neuromusic

@Czaki Czaki added the bug Something isn't working label Jan 3, 2022
@neuromusic
Copy link
Collaborator

fixed in #381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants