Skip to content

Commit

Permalink
Apply ruff/pyupgrade rule UP036
Browse files Browse the repository at this point in the history
UP036 Version block is outdated for minimum Python version
  • Loading branch information
DimitriPapadopoulos committed Jan 15, 2025
1 parent 2130374 commit 41fbf94
Showing 1 changed file with 20 additions and 49 deletions.
69 changes: 20 additions & 49 deletions src/hatch/project/frontend/core.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import json
import sys
from functools import cache
from typing import TYPE_CHECKING, Any, Literal

Expand Down Expand Up @@ -295,58 +294,30 @@ def get_core_metadata(self, *, output_dir: str, project_root: str) -> str:
)


if sys.version_info[:2] >= (3, 9):
@cache
def hook_caller_script() -> str:
from importlib.resources import files

@cache
def hook_caller_script() -> str:
from importlib.resources import files
script = files('pyproject_hooks._in_process') / '_in_process.py'
return script.read_text(encoding='utf-8')

script = files('pyproject_hooks._in_process') / '_in_process.py'
return script.read_text(encoding='utf-8')
@cache
def runner_script() -> str:
from importlib.resources import files

@cache
def runner_script() -> str:
from importlib.resources import files
script = files('hatch.project.frontend.scripts') / 'standard.py'
return script.read_text(encoding='utf-8')

script = files('hatch.project.frontend.scripts') / 'standard.py'
return script.read_text(encoding='utf-8')
@cache
def hatch_build_deps_script() -> str:
from importlib.resources import files

@cache
def hatch_build_deps_script() -> str:
from importlib.resources import files
script = files('hatch.project.frontend.scripts') / 'build_deps.py'
return script.read_text(encoding='utf-8')

script = files('hatch.project.frontend.scripts') / 'build_deps.py'
return script.read_text(encoding='utf-8')
@cache
def hatch_core_metadata_script() -> str:
from importlib.resources import files

@cache
def hatch_core_metadata_script() -> str:
from importlib.resources import files

script = files('hatch.project.frontend.scripts') / 'core_metadata.py'
return script.read_text(encoding='utf-8')

else:

@cache
def hook_caller_script() -> str:
from importlib.resources import read_text

return read_text('pyproject_hooks._in_process', '_in_process.py')

@cache
def runner_script() -> str:
from importlib.resources import read_text

return read_text('hatch.project.frontend.scripts', 'standard.py')

@cache
def hatch_build_deps_script() -> str:
from importlib.resources import read_text

return read_text('hatch.project.frontend.scripts', 'build_deps.py')

@cache
def hatch_core_metadata_script() -> str:
from importlib.resources import read_text

return read_text('hatch.project.frontend.scripts', 'core_metadata.py')
script = files('hatch.project.frontend.scripts') / 'core_metadata.py'
return script.read_text(encoding='utf-8')

0 comments on commit 41fbf94

Please sign in to comment.