Should the effect version stamping achieves be preserved? · gitpython-developers/GitPython · Discussion #1895
Repository navigation
Should the effect version stamping achieves be preserved? #1895
Unanswered EliahKagan asked this question in Q&A Should the effect version stamping achieves be preserved? #1895 EliahKagan Apr 1, 2024 · 1 comment Return to top Discussion options
EliahKagan
Apr 1, 2024
Collaborator
|
Much of the dynamic logic in From the discussion there, it seems a goal is to have Changes in #1886 have the additional effect of making it so this can be done at any time, since there is already a mechanism in place, and in use for some other attributes, to provide dynamically computed attributes of the top-level The question is what the logic should actually be. A common and straightforward approach is to simply use def __getattr__(name):
if name == "__version__":
warnings.warn(
"Accessing jsonschema.__version__ is deprecated and will be "
"removed in a future release. Use importlib.metadata directly "
"to query for jsonschema's version.",
DeprecationWarning,
stacklevel=2,
)
from importlib import metadata
return metadata.version("jsonschema")
elif ...
This can of course be done without deprecating However, it may not always work quite how one wants. For example, if one makes an editable install, and then pulls changes that increase the version number, the old version number that was installed with will still be used. This could be confusing, and this sort of thing may have been part of why the complex version stamping logic in I believe, though, that we can achieve something effectively equivalent to that, by using other facilities of That the version If GitPython is also to deprecate What should be done here? |
Replies: 1 comment
Comment options
Byron
Apr 2, 2024
Maintainer
|
Thanks for bringing this up! To me it seems going with the simple version and deprecating Thanks to your work, in huge parts, I think using deprecations generously leads the way to an eventual version 4.0 with moderately breaking changes, for a GitPython that will feel more modern than ever. |