Skip to content

Commit

Permalink
Improved pyupgrade script
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zwicker committed Jan 3, 2024
1 parent 0dd79ed commit 9f6b74e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/run_autodoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def replace_in_file(infile, replacements, outfile=None):
if outfile is None:
outfile = infile

with open(infile, "r") as fp:
with open(infile) as fp:
content = fp.read()

for key, value in replacements.items():
Expand Down
2 changes: 1 addition & 1 deletion docs/source/sphinx_simplify_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
# replacement rules based on regular expressions
REPLACEMENTS_REGEX = {
# remove full package path and only leave the module/class identifier
"pde\.(\w+\.)*": "",
r"pde\.(\w+\.)*": "",
}


Expand Down
2 changes: 1 addition & 1 deletion scripts/format_code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

echo "Upgrading python syntax..."
pushd .. > /dev/null
pyupgrade --py38-plus **/*.py
find . -name '*.py' -exec pyupgrade --py38-plus {} +
popd > /dev/null

echo "Formating import statements..."
Expand Down

0 comments on commit 9f6b74e

Please sign in to comment.