mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
🔧 Ruff format python files within utils
folder (#12142)
Remove from `exclude` list
This commit is contained in:
@@ -23,9 +23,7 @@ RELEASE_TYPE = {'a': 'alpha', 'b': 'beta'}
|
||||
VersionInfo: TypeAlias = tuple[int, int, int, str, int]
|
||||
|
||||
|
||||
def stringify_version(
|
||||
version_info: VersionInfo, in_develop: bool = True,
|
||||
) -> str:
|
||||
def stringify_version(version_info: VersionInfo, in_develop: bool = True) -> str:
|
||||
version = '.'.join(str(v) for v in version_info[:3])
|
||||
if not in_develop and version_info[3] != 'final':
|
||||
version += version_info[3][0] + str(version_info[4])
|
||||
@@ -33,9 +31,7 @@ def stringify_version(
|
||||
return version
|
||||
|
||||
|
||||
def bump_version(
|
||||
path: Path, version_info: VersionInfo, in_develop: bool = True,
|
||||
) -> None:
|
||||
def bump_version(path: Path, version_info: VersionInfo, in_develop: bool = True) -> None:
|
||||
version = stringify_version(version_info, in_develop)
|
||||
|
||||
with open(path, encoding='utf-8') as f:
|
||||
@@ -177,9 +173,10 @@ def parse_options(argv: Sequence[str]) -> argparse.Namespace:
|
||||
def main() -> None:
|
||||
options = parse_options(sys.argv[1:])
|
||||
|
||||
with processing("Rewriting sphinx/__init__.py"):
|
||||
bump_version(package_dir / 'sphinx' / '__init__.py',
|
||||
options.version, options.in_develop)
|
||||
with processing('Rewriting sphinx/__init__.py'):
|
||||
bump_version(
|
||||
package_dir / 'sphinx' / '__init__.py', options.version, options.in_develop
|
||||
)
|
||||
|
||||
with processing('Rewriting CHANGES'):
|
||||
changes = Changes(package_dir / 'CHANGES.rst')
|
||||
|
Reference in New Issue
Block a user