PATH:
opt
/
hc_python
/
lib
/
python3.12
/
site-packages
/
pydantic
/
_internal
"""Git utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).""" from __future__ import annotations import os import subprocess def is_git_repo(dir: str) -> bool: """Is the given directory version-controlled with git?""" return os.path.exists(os.path.join(dir, '.git')) def have_git() -> bool: """Can we run the git executable?""" try: subprocess.check_output(['git', '--help']) return True except subprocess.CalledProcessError: return False except OSError: return False def git_revision(dir: str) -> str: """Get the SHA-1 of the HEAD of a git repository.""" return subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD'], cwd=dir).decode('utf-8').strip()
[+]
__pycache__
[-] _known_annotated_metadata.py
[edit]
[-] _repr.py
[edit]
[-] _decorators_v1.py
[edit]
[-] _internal_dataclass.py
[edit]
[-] _mock_val_ser.py
[edit]
[-] _signature.py
[edit]
[-] __init__.py
[edit]
[-] _decorators.py
[edit]
[-] _discriminated_union.py
[edit]
[-] _generics.py
[edit]
[-] _model_construction.py
[edit]
[-] _validate_call.py
[edit]
[+]
..
[-] _fields.py
[edit]
[-] _docs_extraction.py
[edit]
[-] _core_utils.py
[edit]
[-] _config.py
[edit]
[-] _forward_ref.py
[edit]
[-] _std_types_schema.py
[edit]
[-] _validators.py
[edit]
[-] _generate_schema.py
[edit]
[-] _utils.py
[edit]
[-] _dataclasses.py
[edit]
[-] _git.py
[edit]
[-] _typing_extra.py
[edit]
[-] _schema_generation_shared.py
[edit]
[-] _core_metadata.py
[edit]