diff --git a/.gitignore b/.gitignore index 1be4f3201..7765293d8 100644 --- a/.gitignore +++ b/.gitignore @@ -47,7 +47,3 @@ output.txt # Finder metadata .DS_Store - -# Output files for modattrs.py (these entries will be removed soon) -a -b diff --git a/ab.diff b/ab.diff deleted file mode 100644 index 1f2885b90..000000000 --- a/ab.diff +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/a b/b -index 81b3f984..099fa33b 100644 ---- a/a -+++ b/b -@@ -634,7 +634,6 @@ git.objects: - blob: - commit: - fun: -- inspect: - submodule: - tag: - tree: -@@ -770,6 +769,10 @@ git.objects.fun: - - - git.objects.submodule: -+ RootModule: -+ RootUpdateProgress: -+ Submodule: -+ UpdateProgress: - __builtins__: {'__name__': 'builtins', '__doc__': "Built-in functions, types, exceptions, and other objects.\n\nThis module provides direct access to all 'built-in'\nidentifiers of Python; for example, builtins.len is\nthe full name for the built-in function len().\n\nThis module is not normally accessed explicitly by most\napplications, but can be useful in modules that provide\nobjects with the same name as a built-in value, but in\nwhich the built-in of that name is also needed.", '__package__': '', '__loader__': , '__spec__': ModuleSpec(name='builtins', loader=, origin='built-in'), '__build_class__': , '__import__': , 'abs': , 'all': , 'any': , 'ascii': , 'bin': , 'breakpoint': , 'callable': , 'chr': , 'compile': , 'delattr': , 'dir': , 'divmod': , 'eval': , 'exec': , 'format': , 'getattr': , 'globals': , 'hasattr': , 'hash': , 'hex': , 'id': , 'input': , 'isinstance': , 'issubclass': , 'iter': , 'aiter': , 'len': , 'locals': , 'max': , 'min': , 'next': , 'anext': , 'oct': , 'ord': , 'pow': , 'print': , 'repr': , 'round': , 'setattr': , 'sorted': , 'sum': , 'vars': , 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': , 'memoryview': , 'bytearray': , 'bytes': , 'classmethod': , 'complex': , 'dict': , 'enumerate': , 'filter': , 'float': , 'frozenset': , 'property': , 'int': , 'list': , 'map': , 'object': , 'range': , 'reversed': , 'set': , 'slice': , 'staticmethod': , 'str': , 'super': , 'tuple': , 'type': , 'zip': , '__debug__': True, 'BaseException': , 'BaseExceptionGroup': , 'Exception': , 'GeneratorExit': , 'KeyboardInterrupt': , 'SystemExit': , 'ArithmeticError': , 'AssertionError': , 'AttributeError': , 'BufferError': , 'EOFError': , 'ImportError': , 'LookupError': , 'MemoryError': , 'NameError': , 'OSError': , 'ReferenceError': , 'RuntimeError': , 'StopAsyncIteration': , 'StopIteration': , 'SyntaxError': , 'SystemError': , 'TypeError': , 'ValueError': , 'Warning': , 'FloatingPointError': , 'OverflowError': , 'ZeroDivisionError': , 'BytesWarning': , 'DeprecationWarning': , 'EncodingWarning': , 'FutureWarning': , 'ImportWarning': , 'PendingDeprecationWarning': , 'ResourceWarning': , 'RuntimeWarning': , 'SyntaxWarning': , 'UnicodeWarning': , 'UserWarning': , 'BlockingIOError': , 'ChildProcessError': , 'ConnectionError': , 'FileExistsError': , 'FileNotFoundError': , 'InterruptedError': , 'IsADirectoryError': , 'NotADirectoryError': , 'PermissionError': , 'ProcessLookupError': , 'TimeoutError': , 'IndentationError': , 'IndexError': , 'KeyError': , 'ModuleNotFoundError': , 'NotImplementedError': , 'RecursionError': , 'UnboundLocalError': , 'UnicodeError': , 'BrokenPipeError': , 'ConnectionAbortedError': , 'ConnectionRefusedError': , 'ConnectionResetError': , 'TabError': , 'UnicodeDecodeError': , 'UnicodeEncodeError': , 'UnicodeTranslateError': , 'ExceptionGroup': , 'EnvironmentError': , 'IOError': , 'WindowsError': , 'open': , 'quit': Use quit() or Ctrl-Z plus Return to exit, 'exit': Use exit() or Ctrl-Z plus Return to exit, 'copyright': Copyright (c) 2001-2023 Python Software Foundation.?All Rights Reserved.??Copyright (c) 2000 BeOpen.com.?All Rights Reserved.??Copyright (c) 1995-2001 Corporation for National Research Initiatives.?All Rights Reserved.??Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.?All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands? for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.} - __cached__: 'C:\\Users\\ek\\source\\repos\\GitPython\\git\\objects\\submodule\\__pycache__\\__init__.cpython-312.pyc' - __doc__: None -@@ -881,9 +884,7 @@ git.objects.submodule.util: - Any: typing.Any - BytesIO: - GitConfigParser: -- IndexObject: - InvalidGitRepositoryError: -- Object: - PathLike: typing.Union[str, ForwardRef('os.PathLike[str]')] - Sequence: typing.Sequence - SubmoduleConfigParser: -@@ -998,7 +999,7 @@ git.objects.util: - ZERO: datetime.timedelta(0) - __builtins__: {'__name__': 'builtins', '__doc__': "Built-in functions, types, exceptions, and other objects.\n\nThis module provides direct access to all 'built-in'\nidentifiers of Python; for example, builtins.len is\nthe full name for the built-in function len().\n\nThis module is not normally accessed explicitly by most\napplications, but can be useful in modules that provide\nobjects with the same name as a built-in value, but in\nwhich the built-in of that name is also needed.", '__package__': '', '__loader__': , '__spec__': ModuleSpec(name='builtins', loader=, origin='built-in'), '__build_class__': , '__import__': , 'abs': , 'all': , 'any': , 'ascii': , 'bin': , 'breakpoint': , 'callable': , 'chr': , 'compile': , 'delattr': , 'dir': , 'divmod': , 'eval': , 'exec': , 'format': , 'getattr': , 'globals': , 'hasattr': , 'hash': , 'hex': , 'id': , 'input': , 'isinstance': , 'issubclass': , 'iter': , 'aiter': , 'len': , 'locals': , 'max': , 'min': , 'next': , 'anext': , 'oct': , 'ord': , 'pow': , 'print': , 'repr': , 'round': , 'setattr': , 'sorted': , 'sum': , 'vars': , 'None': None, 'Ellipsis': Ellipsis, 'NotImplemented': NotImplemented, 'False': False, 'True': True, 'bool': , 'memoryview': , 'bytearray': , 'bytes': , 'classmethod': , 'complex': , 'dict': , 'enumerate': , 'filter': , 'float': , 'frozenset': , 'property': , 'int': , 'list': , 'map': , 'object': , 'range': , 'reversed': , 'set': , 'slice': , 'staticmethod': , 'str': , 'super': , 'tuple': , 'type': , 'zip': , '__debug__': True, 'BaseException': , 'BaseExceptionGroup': , 'Exception': , 'GeneratorExit': , 'KeyboardInterrupt': , 'SystemExit': , 'ArithmeticError': , 'AssertionError': , 'AttributeError': , 'BufferError': , 'EOFError': , 'ImportError': , 'LookupError': , 'MemoryError': , 'NameError': , 'OSError': , 'ReferenceError': , 'RuntimeError': , 'StopAsyncIteration': , 'StopIteration': , 'SyntaxError': , 'SystemError': , 'TypeError': , 'ValueError': , 'Warning': , 'FloatingPointError': , 'OverflowError': , 'ZeroDivisionError': , 'BytesWarning': , 'DeprecationWarning': , 'EncodingWarning': , 'FutureWarning': , 'ImportWarning': , 'PendingDeprecationWarning': , 'ResourceWarning': , 'RuntimeWarning': , 'SyntaxWarning': , 'UnicodeWarning': , 'UserWarning': , 'BlockingIOError': , 'ChildProcessError': , 'ConnectionError': , 'FileExistsError': , 'FileNotFoundError': , 'InterruptedError': , 'IsADirectoryError': , 'NotADirectoryError': , 'PermissionError': , 'ProcessLookupError': , 'TimeoutError': , 'IndentationError': , 'IndexError': , 'KeyError': , 'ModuleNotFoundError': , 'NotImplementedError': , 'RecursionError': , 'UnboundLocalError': , 'UnicodeError': , 'BrokenPipeError': , 'ConnectionAbortedError': , 'ConnectionRefusedError': , 'ConnectionResetError': , 'TabError': , 'UnicodeDecodeError': , 'UnicodeEncodeError': , 'UnicodeTranslateError': , 'ExceptionGroup': , 'EnvironmentError': , 'IOError': , 'WindowsError': , 'open': , 'quit': Use quit() or Ctrl-Z plus Return to exit, 'exit': Use exit() or Ctrl-Z plus Return to exit, 'copyright': Copyright (c) 2001-2023 Python Software Foundation.?All Rights Reserved.??Copyright (c) 2000 BeOpen.com.?All Rights Reserved.??Copyright (c) 1995-2001 Corporation for National Research Initiatives.?All Rights Reserved.??Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.?All Rights Reserved., 'credits': Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands? for supporting Python development. See www.python.org for more information., 'license': Type license() to see the full license text, 'help': Type help() for interactive help, or help(object) for help about object.} - __cached__: 'C:\\Users\\ek\\source\\repos\\GitPython\\git\\objects\\__pycache__\\util.cpython-312.pyc' -- __doc__: 'General utility functions.' -+ __doc__: 'Utility functions for working with git objects.' - __file__: 'C:\\Users\\ek\\source\\repos\\GitPython\\git\\objects\\util.py' - __loader__: <_frozen_importlib_external.SourceFileLoader object at 0x...> - __name__: 'git.objects.util' diff --git a/modattrs.py b/modattrs.py deleted file mode 100755 index 245f68912..000000000 --- a/modattrs.py +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env python - -"""Script to get the names and "stabilized" reprs of module attributes in GitPython. - -Run with :envvar:`PYTHONHASHSEED` set to ``0`` for fully comparable results. These are -only still meaningful for comparing if the same platform and Python version are used. - -The output of this script should probably not be committed, because within the reprs of -objects found in modules, it may contain sensitive information, such as API keys stored -in environment variables. The "sanitization" performed here is only for common forms of -whitespace that clash with the output format. -""" - -# fmt: off - -__all__ = ["git", "main"] - -import itertools -import re -import sys - -import git - - -def main(): - # This assumes `import git` causes all of them to be loaded. - gitpython_modules = sorted( - (module_name, module) - for module_name, module in sys.modules.items() - if re.match(r"git(?:\.|$)", module_name) - ) - - # We will print two blank lines between successive module reports. - separators = itertools.chain(("",), itertools.repeat("\n\n")) - - # Report each module's contents. - for (module_name, module), separator in zip(gitpython_modules, separators): - print(f"{separator}{module_name}:") - - attributes = sorted( - (name, value) - for name, value in module.__dict__.items() - if name != "__all__" # Because we are deliberately adding these. - ) - - for name, value in attributes: - sanitized_repr = re.sub(r"[\r\n\v\f]", "?", repr(value)) - normalized_repr = re.sub(r" at 0x[0-9a-fA-F]+", " at 0x...", sanitized_repr) - print(f" {name}: {normalized_repr}") - - -if __name__ == "__main__": - main()