You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the use case of the packaging library is to support tooling that may run in a different environment than the processed packages are intended for. For instance, I may want to process a Requirement.marker and evaluate() it on a different platform environment that is not the environment of the current Python interpreter. However, the evaluate() method environment arg can only update the environment and can never override/replace it entirely.
But for replacing to work, don’t you need to pass the whole environment anyway? In which case the dict.update would simply replace everything from the original environment. Or am I missing something?
With that said, the fact that packaging currently implicitly depending a lot on the current environment is problematic (not just packaging.markers, but packaging.tags as well). It would be much easier to work with it if instead of providing a point for partial override, the user is always required to pass in a complete environment to replace the current one (and we can provide some helper functions to generate a complete environment dict).
One of the use case of the packaging library is to support tooling that may run in a different environment than the processed packages are intended for. For instance, I may want to process a
Requirement.marker
and evaluate() it on a different platform environment that is not the environment of the current Python interpreter. However, the evaluate() methodenvironment
arg can only update the environment and can never override/replace it entirely.packaging/packaging/markers.py
Line 302 in 8c78c35
It would be useful for tools to be able to entirely override the environment rather than just updating it.
The text was updated successfully, but these errors were encountered: