[Feature] Allow Environment Override#1842
Conversation
aignas
left a comment
There was a problem hiding this comment.
I am not a maintainer, but would love to see this change to be merged.
| ) | ||
|
|
||
| assert out.exit_code == 0, out | ||
| assert expected_output == out.stdout |
There was a problem hiding this comment.
I would love to see an extra test, where we check that we can override all of the env dict values to ensure that we support passing multiple values to the --override-environment
There was a problem hiding this comment.
I added a test with multiple environment markers passed, as well as a test that uses all valid markers one at a time.
| @click.option( | ||
| "--override-environment", | ||
| multiple=True, | ||
| type=(str, str), |
There was a problem hiding this comment.
can we add validation on the values that people can override? I would expect this to fail if I pass --override-environment foo bar to the CLI. If this can be shown in the help to tell the user what environment markers can be overridden, it would improve the experience as well.
| specify the environment when gathering dependencies, allowing for cross-environment | ||
| fetching. However, a different ``requirements.txt`` must still be generated per | ||
| environment. It is recommended to override all keys in `PEP 508 environment markers`_ | ||
| when targetting a different environment so the environment is fully defined. |
There was a problem hiding this comment.
It would be great to have a short example in the README.
There was a problem hiding this comment.
Added an example for a 'typical' Linux machine
Allow the pip environment used for evaluating environment markers to be overriden, so requirements can be compiled for an environment different than the user's current environment.
for more information, see https://pre-commit.ci
|
@aignas Thanks for the comments! I made some updates based on your feedback, let me know if there are any remaining concerns you have. @atugushev I saw you are one of the leads on this project, do you think this feature makes sense? |
Allow the pip environment used for evaluating environment markers to be overriden, so requirements can be compiled for an environment different than the user's current environment.
Contributor checklist
Maintainer checklist
backwards incompatible,feature,enhancement,deprecation,bug,dependency,docsorskip-changelogas they determine changelog listing.