-
Notifications
You must be signed in to change notification settings - Fork 25
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
added env override for default index URL #286
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @djcass44. Thanks for your PR. I'm waiting for a thoth-station member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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 your contribution, @djcass44, this looks valuable. Do you think it would make sense to promote this to be an option anyone could supply to the CLI?
micropipenv install --default-index-url https://my-index.com
Or at least document this environment variable in the README file so it is easier for users to find it. Thank you!
@fridex thanks for the quick response! I've added some documentation to the README to explain how to use the environment variable. I think it would be great idea to add it to the CLI however it would be a much more involved change than a simple environment variable. If it's okay I'd prefer to merge this to get the functionality through |
Thank you, let's see what maintainers will say :) |
@frenzymadness wdyt? |
I like this change and I'm open to merging and releasing it. However, it'd be nice to have some tests for it. Do you think you can add some? |
improved handling of whitespace
@frenzymadness done! I've also improved the handling of whitespace |
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 a lot! Some comments were provided but the contribution is good and will be merged soon.
@frenzymadness thanks for the feedback! I believe I've addressed it all |
I fixed a code a little bit to improve readability and to make mypy and pydocstyle tests pass. For some reason, I'm not able to push it to your fork (probably because you opened this PR from the master branch, but I'm not sure). Could you please check #290 where all your commits and my changes are squashed together and ready to be merged? |
Related Issues and Dependencies
…
This introduces a breaking change
This Pull Request implements
Updates the
_DEFAULT_INDEX_URLS
so that it can be set from an environment variable rather than being hardcoded.Description
Context: I am attempting to use Micropipenv in an environment behind a corporate firewall where I cannot access
pypi.org
. To make things more complex, I need to build the application in two different environments which do not have a consistent Pip registry available, meaning I cannot put the registry URL in the package manager configuration file.This change adds the
MICROPIPENV_DEFAULT_INDEX_URLS
environment variable which allows a consumer to override the default registry that Micropipenv uses if it cannot find one in the package manager config.This change is implemented in a way that is not breaking. If the environment variable is not set it will behave identically to how it did before.