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

Remove unnecessary jsonargparse dependencies #2046

Merged
merged 2 commits into from
May 9, 2024

Conversation

davnn
Copy link
Contributor

@davnn davnn commented May 7, 2024

📝 Description

  • Currently jsonargparse is installed with all optional dependencies jsonargparse[all], which requires everyone using anomalib to have a working C++ setup, therefore massively reducing developer experience for people adopting the library.

It appears that we do not use features that require optional dependencies, therefore, we can simplify the install to jsonargparse.

✨ Changes

Select what type of change your PR is:

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔨 Refactor (non-breaking change which refactors the code base)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Security update

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • [ x ] 📋 I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

For more information about code review checklists, see the Code Review Checklist.

@davnn davnn requested a review from samet-akcay as a code owner May 7, 2024 05:56
@samet-akcay
Copy link
Contributor

samet-akcay commented May 8, 2024

@davnn, thanks for your feedback and creating this PR. Tests seem to be failing here due to the following error:

        if not _JSONARGPARSE_SIGNATURES_AVAILABLE:
>           raise ModuleNotFoundError(f"{_JSONARGPARSE_SIGNATURES_AVAILABLE}")
E           ModuleNotFoundError: DistributionNotFound: The 'typeshed-client>=2.1.0; extra == "signatures"' distribution was not found and is required by jsonargparse. HINT: Try running `pip install -U 'jsonargparse[signatures]>=4.27.7'`

We either need to find the root cause to remove signatures or install signatures. Do you happen to know if signatures also require C++ setup or adversely impact the DX?

@davnn
Copy link
Contributor Author

davnn commented May 8, 2024

Sorry my fault, you are right, jsonargparse[signatures] is necessary. Signatures do not negatively impact DX, they just install

signatures = [
    "jsonargparse[typing-extensions]",
    "docstring-parser>=0.15",
    "typeshed-client>=2.1.0",
    "typing-extensions>=3.10.0.0; python_version < '3.10'",
]

The problematic package is jsonnet, which we do not rely on. I've updated my PR accordingly, tests should now pass.

@samet-akcay
Copy link
Contributor

Great, thanks!

@samet-akcay samet-akcay merged commit d5f744f into openvinotoolkit:main May 9, 2024
6 of 7 checks passed
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