From 7a5bed0454ce9c4dee6f6e31236fc8301999d123 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Tue, 14 May 2024 14:14:57 -0700 Subject: [PATCH] Switch from reorder-python-imports to isort --- .pre-commit-config.yaml | 6 +++--- docs/source/conf.py | 2 ++ pseudo_builder.py | 2 +- pyproject.toml | 5 +++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5d18ab3..4173378 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,10 +14,10 @@ repos: - id: trailing-whitespace - id: name-tests-test exclude: tests/(common.py|util.py|(helpers|integration/factories)/(.+).py) - - repo: https://github.com/asottile/reorder_python_imports - rev: v3.12.0 + - repo: https://github.com/pycqa/isort + rev: 5.13.2 hooks: - - id: reorder-python-imports + - id: isort - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.10.0 hooks: diff --git a/docs/source/conf.py b/docs/source/conf.py index 9c7b472..1293510 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,6 +13,8 @@ # sys.path.insert(0, os.path.abspath('.')) # -- Project information ----------------------------------------------------- +from __future__ import annotations + project = "release-gitter" copyright = "2021, iamthefij" author = "iamthefij" diff --git a/pseudo_builder.py b/pseudo_builder.py index 9ebe058..7cb1df0 100644 --- a/pseudo_builder.py +++ b/pseudo_builder.py @@ -2,6 +2,7 @@ This builder functions as a pseudo builder that instead downloads and installs a binary file using release-gitter based on a pyproject.toml file. It's a total hack... """ + from __future__ import annotations from dataclasses import dataclass @@ -16,7 +17,6 @@ from wheel.wheelfile import WheelFile import release_gitter as rg from release_gitter import removeprefix - PACKAGE_NAME = "pseudo" diff --git a/pyproject.toml b/pyproject.toml index aa6d35f..bf2abbe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,3 +62,8 @@ dependencies = ["pre-commit"] [tool.hatch.envs.lint.scripts] all = "pre-commit run --all-files" install-hooks = "pre-commit install --install-hooks" + +[tool.isort] +add_imports = ["from __future__ import annotations"] +force_single_line = true +profile = "black"