-
Notifications
You must be signed in to change notification settings - Fork 52
Allow custom overrites for package resolving and optional sys.path support #601
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
Conversation
Matthias Bartelt seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
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.
Would it be possible for you to add two options:
- Make respecting sys.path opt in
- Add additional overrides
Example: if codegen is installed a virtual environment, we wouldn't want to make the user set PYTHONPATH/install it into the project environment. We'd also not want to accidentally include code from their virtual enviornment
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.
Thanks for the PR by the way! Let us know if you ever have any questions.
tests/unit/codegen/sdk/python/import_resolution/test_import_resolution.py
Outdated
Show resolved
Hide resolved
thank you @spezifant |
🎉 This PR is included in version 0.37.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Motivation
Certain build systems or configurations have Python packages located in a non-default path. Those are not found by Codegen per default.
Content
Codegen now considers the
PYTHONPATH
environment variable when resolving packages.Testing
Added unit tests which resolve packages only when the
PYTHONPATH
is set in a correct way.Please check the following before marking your PR as ready for review