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

Runtime dependencies check #1670

Merged
merged 7 commits into from Mar 5, 2024
Merged

Runtime dependencies check #1670

merged 7 commits into from Mar 5, 2024

Conversation

AleksanderWWW
Copy link
Contributor

Before submitting checklist

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you ask the docs owner to review all the user-facing changes?

Copy link

codecov bot commented Mar 2, 2024

Codecov Report

Attention: Patch coverage is 20.96774% with 49 lines in your changes are missing coverage. Please review.

Project coverage is 77.38%. Comparing base (c84f454) to head (2450b0b).

Files Patch % Lines
src/neptune/integrations/mosaicml/__init__.py 0.00% 4 Missing ⚠️
src/neptune/integrations/aws/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/detectron2/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/fastai/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/kedro/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/lightgbm/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/optuna/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/prophet/__init__.py 0.00% 3 Missing ⚠️
src/neptune/integrations/pytorch/__init__.py 0.00% 3 Missing ⚠️
...neptune/integrations/pytorch_lightning/__init__.py 0.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1670      +/-   ##
==========================================
- Coverage   80.58%   77.38%   -3.21%     
==========================================
  Files         302      304       +2     
  Lines       15484    15439      -45     
==========================================
- Hits        12478    11947     -531     
- Misses       3006     3492     +486     
Flag Coverage Δ
e2e-management ?
e2e-s3 ?
e2e-s3-gcs ?
e2e-standard ?
macos 74.52% <20.96%> (-5.69%) ⬇️
py3.7 74.79% <20.96%> (-5.15%) ⬇️
ubuntu 74.66% <20.96%> (-5.64%) ⬇️
unit 74.79% <20.96%> (-0.20%) ⬇️
windows 73.71% <20.96%> (-6.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

framework_name=framework_name,
**STYLES,
)
)


class NeptuneIntegrationNotInstalledException(NeptuneMissingRequirementException):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Raalsky tbh I'm not sure I see a need for a separate exception type for integrations. It makes it all more complicated. How about we just throw a NeptuneMissingRequirementException and always link a docs page for integrations? Also @normandy7, what do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

You mean removing the installation instructions from the exception message? What are the pros/cons with this change (from an end-user perspective)? It would be ideal to have an installation command handy for copy-pasting

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No no, actually it will be just about renaming NeptuneIntegrationNotInstalledException to NeptuneMissingRequirementException and small tweaks in the message (changing 'integration' to just 'package') to make it more generic, as we'll also probably be checking installation of things like pandas which is not an integration per se

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rest will stay the same - installation instruction and link to the docs. I just don't see a need to create two separate entities which only differ in names and some small message wording details

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh I see! Yes, that should be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will introduce a simplification shortly and ask you to review, ok? 😃

Copy link
Collaborator

Choose a reason for hiding this comment

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

Certainly 👍🏻 I'll monitor my inbox

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a lot of files, but it's mostly just updating how integrations are imported. The thing to check is probably only src/neptune/exceptions.py :)

src/neptune/exceptions.py Outdated Show resolved Hide resolved
szysad
szysad previously approved these changes Mar 5, 2024
Copy link
Contributor

@szysad szysad left a comment

Choose a reason for hiding this comment

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

clean, short and simple, LGTM! 🚀

Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
@AleksanderWWW AleksanderWWW merged commit 138d608 into master Mar 5, 2024
4 checks passed
@AleksanderWWW AleksanderWWW deleted the aw/requirement-cache branch March 5, 2024 09:24
from neptune.exceptions import NeptuneMissingRequirementException


def is_installed(requirement_name: str) -> bool:
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we sure that this is going to be cached? Maybe can we just use some simple LRU cache directly?

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.

None yet

4 participants