-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
add script to check imports #19611
add script to check imports #19611
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
All of these should now be fixed following #19655 |
should we add this to CI now? |
|
||
- name: Install langchain editable | ||
run: | | ||
poetry run pip install -e libs/langchain libs/community libs/experimental |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we install core editable as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also check partner packages (and install those here)
docs/scripts/check_imports.py
Outdated
getattr(imported_module, item) | ||
except Exception as e: | ||
offending_imports.append((module, item)) | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why a broad exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in specific exceptions I was expecting. These are broad in case I missed something among ImportError, AttributeError, or ModuleNotFoundError.
docs/scripts/check_imports.py
Outdated
offending_imports.append((module, item)) | ||
else: | ||
importlib.import_module(module) | ||
except Exception as e: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this import error?
This reverts commit 063b521.
Found via script in langchain-ai#19611
Found via script in langchain-ai/langchain#19611
A bit messy.
Currently outputs: