diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be7a96e..2c42f85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,16 +4,16 @@ repos: - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort - - repo: https://github.com/psf/black - rev: 24.3.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 26.1.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 - rev: 7.0.0 + rev: 7.3.0 hooks: - id: flake8 diff --git a/sphinx_gitstamp/__init__.py b/sphinx_gitstamp/__init__.py index 9e56c32..dbbd0ce 100644 --- a/sphinx_gitstamp/__init__.py +++ b/sphinx_gitstamp/__init__.py @@ -62,11 +62,8 @@ def page_context_handler(app, pagename, templatename, context, doctree): raise errors.ExtensionError("Can't fetch git history for %s." % file_path) except ValueError: # Datestamp can't be parsed. - app.info( - "%s: Can't parse datestamp () %s ) for gitstamp, output \ - won't have last updated time." - % (pagename, updated) - ) + app.info("%s: Can't parse datestamp () %s ) for gitstamp, output \ + won't have last updated time." % (pagename, updated)) pass @@ -79,23 +76,19 @@ def what_build_am_i(app): try: import git except ImportError as e: - raise errors.ExtensionError( - f"""Unable to import gitpython. \ + raise errors.ExtensionError(f"""Unable to import gitpython. \ Required to generate html. You may need to run: pip install gitpython. The error was: {e} -""" - ) +""") try: global g g = git.Git(".") except BaseException: app.info(sys.exc_info()[0]) - app.warn( - "gitstamp extension enabled, but no git repository found. No \ - git datestamps will be generated." - ) + app.warn("gitstamp extension enabled, but no git repository found. No \ + git datestamps will be generated.") else: app.connect("html-page-context", page_context_handler)