docs: def version(ctx, version=None, force=False):
      """ Specify a new version for the package.
  
      .. important:: If no version is specified, will take the most recent parsable git
          tag and bump the patch number.
  
      :param str version: The new version of the package.
      :param bool force: If True, skips version check
      """
  
      # define replacement strategies for files where the version needs to be in sync
      updates = {
          ctx.directory.joinpath("setup.cfg"): [
              (r"^(version\s?=\s?)(.*)", "\\g<1>{version}")
          ],
          ctx.package.directory.joinpath("__version__.py"): [
              (r"(__version__\s?=\s?)(.*)", '\\g<1>"{version}"')
          ],
      }
  
      previous_version = get_previous_version(ctx)
      if isinstance(version, str):
          version = parver.Version.parse(version)
          if not force and version <= previous_version:
              error_message = (
                  f"version {version!s} is <= to previous version {previous_version!s}"
              )
              report.error(ctx, "package.version", error_message)
              raise ValueError(error_message)
      else:
          version = previous_version.bump_release(index=len(previous_version.release) - 1)
  
      report.info(ctx, "package.version", f"updating version to {version!s}")
      for (path, replacements) in updates.items():
          if path.is_file():
              content = path.read_text()
              for (pattern, sub) in replacements:
                  report.debug(
                      ctx,
                      "package.version",
                      f"applying replacement ({pattern!r}, {sub!r}) to {path!s}",
                  )
                  content = re.sub(pattern, sub.format(version=version), content, re.M)
              path.write_text(content)