Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pyupgrade as pre-commit hook #1484

Merged
merged 4 commits into from
Mar 22, 2023
Merged

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Mar 21, 2023

This builds on #1483.

Pyupgrade upgrades idiomatic Python code to a particular minimum version. Thus it does things like replacing .format with f-strings, and updating some imports. It gives a substantial increase in code quality IMO.

Thank you for opening a PR!

Here are a few important guidelines and requirements to check before your PR can be merged:

  • There is an informative high-level description of the changes.
  • The description and/or commit message(s) references the relevant GitHub issue(s).
  • pre-commit is installed and set up.
  • The commit messages follow these guidelines.
  • The commits correspond to relevant logical changes, and there are no commits that fix changes introduced by other commits in the same branch/BR.
  • There are tests covering the changes introduced in the PR.

Don't worry, your PR doesn't need to be in perfect order to submit it. As development progresses and/or reviewers request changes, you can always rewrite the history of your feature/PR branches.

If your PR is an ongoing effort and you would like to involve us in the process, simply make it a draft PR.

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #1484 (ccca397) into main (1da48b5) will increase coverage by 0.03%.
The diff coverage is 98.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1484      +/-   ##
==========================================
+ Coverage   75.02%   75.06%   +0.03%     
==========================================
  Files         194      194              
  Lines       50102    50091      -11     
  Branches    12096    12096              
==========================================
+ Hits        37589    37600      +11     
+ Misses      10189    10170      -19     
+ Partials     2324     2321       -3     
Impacted Files Coverage Δ
aesara/configparser.py 84.94% <ø> (ø)
aesara/gradient.py 76.99% <ø> (-0.04%) ⬇️
aesara/graph/basic.py 88.24% <ø> (ø)
aesara/graph/fg.py 88.98% <ø> (-0.04%) ⬇️
aesara/graph/utils.py 64.84% <ø> (ø)
aesara/link/c/basic.py 87.14% <ø> (ø)
aesara/link/c/params_type.py 80.41% <ø> (ø)
aesara/link/c/type.py 75.98% <ø> (ø)
aesara/link/numba/dispatch/basic.py 92.25% <ø> (ø)
aesara/scalar/basic.py 79.17% <ø> (ø)
... and 26 more

... and 8 files with indirect coverage changes

@maresb maresb marked this pull request as ready for review March 21, 2023 14:48
@maresb maresb merged commit 4a687c0 into aesara-devs:main Mar 22, 2023
@maresb maresb deleted the add-pyupgrade branch March 22, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants