Skip to content

Commit

Permalink
style: Bump Black's target Python versions for Python 3.9 minimum (#4347
Browse files Browse the repository at this point in the history
)

* style: Bump Black's target Python versions

* style: Format with new Black settings
  • Loading branch information
echoix authored Sep 19, 2024
1 parent 6607e1c commit 51f865b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ requires-python = ">=3.9"
[tool.black]
required-version = '24'
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311', 'py312']
target-version = ['py39', 'py310', 'py311', 'py312', 'py313']
# 'extend-exclude' excludes files or directories in addition to the defaults
extend-exclude = '''
(
Expand Down
7 changes: 4 additions & 3 deletions scripts/g.extension/g.extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,9 +470,10 @@ def replace_shebang_win(python_file):
cur_dir = os.path.dirname(python_file)
tmp_name = os.path.join(cur_dir, gs.tempname(12))

with codecs.open(python_file, "r", encoding="utf8") as in_file, codecs.open(
tmp_name, "w", encoding="utf8"
) as out_file:
with (
codecs.open(python_file, "r", encoding="utf8") as in_file,
codecs.open(tmp_name, "w", encoding="utf8") as out_file,
):
for line in in_file:
new_line = line.replace(
"#!/usr/bin/env python\n", "#!/usr/bin/env python3\n"
Expand Down

0 comments on commit 51f865b

Please sign in to comment.