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

fix import in script for use by typer #982

Merged

Conversation

zacharyburnett
Copy link
Collaborator

@zacharyburnett zacharyburnett commented Nov 8, 2023

This PR addresses an issue from #977 where the script doesn't have access to typing_extensions.Annotated at runtime

Checklist

  • added entry in CHANGES.rst under the corresponding subsection
  • updated relevant tests
  • updated relevant documentation
  • updated relevant milestone(s)
  • added relevant label(s)
  • ran regression tests, post a link to the Jenkins job below. How to run regression tests on a PR

@zacharyburnett zacharyburnett self-assigned this Nov 8, 2023
@zacharyburnett zacharyburnett marked this pull request as ready for review November 8, 2023 18:25
@zacharyburnett zacharyburnett requested a review from a team as a code owner November 8, 2023 18:25
Copy link

codecov bot commented Nov 8, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (2a234a3) 71.08% compared to head (10c24f8) 71.07%.

Files Patch % Lines
romancal/scripts/static_preview.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #982      +/-   ##
==========================================
- Coverage   71.08%   71.07%   -0.01%     
==========================================
  Files         104      104              
  Lines        7006     7005       -1     
==========================================
- Hits         4980     4979       -1     
  Misses       2026     2026              
Flag Coverage Δ *Carryforward flag
nightly 63.29% <ø> (ø) Carriedforward from 2a234a3

*This pull request uses carry forward flags. Click here to find out more.

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


def command():
from typing_extensions import Annotated
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is supposed to be available at runtime then you must include this as one of the listed dependencies.

Copy link
Collaborator Author

@zacharyburnett zacharyburnett Nov 9, 2023

Choose a reason for hiding this comment

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

good point; it looks like typer brings it in, so should it be an explicit dependency?

❯ pipdeptree --packages typing-extensions --reverse
typing-extensions==4.8.0
└── typer==0.9.0 [requires: typing-extensions>=3.7.4.3]
    └── stpreview==0.5.1 [requires: typer]

I'll move it to the try block

Copy link
Collaborator

Choose a reason for hiding this comment

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

Its probably fine, especially in a try block. I'm just thinking about what would happen if typer dropped the dependency, which it probably will do eventually.

@github-actions github-actions bot added the dependencies Pull requests that update a dependency file label Nov 9, 2023
@zacharyburnett zacharyburnett merged commit 7eaf91e into spacetelescope:main Nov 20, 2023
@zacharyburnett zacharyburnett deleted the script/fix_static_preview branch November 20, 2023 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file no-changelog-entry-needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants