Skip to content

Update pre-commit hooks #581

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

Closed
wants to merge 4 commits into from
Closed

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Jan 9, 2024

@ricardoV94, for a more sustainable solution I think we should install https://github.com/marketplace/pre-commit-ci

Description

Related Issue

  • Closes #
  • Related to #

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

@ricardoV94
Copy link
Member

@ricardoV94, for a more sustainable solution I think we should install https://github.com/marketplace/pre-commit-ci

I trust you there. Just have to remember to disable our dependency update bot then?

@ricardoV94
Copy link
Member

@maresb wanna do it in this PR already?

@maresb maresb requested a review from ricardoV94 January 9, 2024 20:41
@maresb maresb force-pushed the update-pre-commit branch from ea1617f to a66b277 Compare January 9, 2024 21:12
@codecov-commenter
Copy link

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (c5b96d9) 80.92% compared to head (a66b277) 80.92%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #581      +/-   ##
==========================================
- Coverage   80.92%   80.92%   -0.01%     
==========================================
  Files         162      162              
  Lines       46641    46648       +7     
  Branches    11399    11395       -4     
==========================================
+ Hits        37746    37749       +3     
- Misses       6667     6670       +3     
- Partials     2228     2229       +1     
Files Coverage Δ
pytensor/compile/debugmode.py 61.46% <100.00%> (ø)
pytensor/compile/ops.py 83.57% <100.00%> (ø)
pytensor/compile/profiling.py 76.19% <100.00%> (ø)
pytensor/graph/rewriting/unify.py 99.34% <100.00%> (ø)
pytensor/ifelse.py 51.70% <100.00%> (ø)
pytensor/link/c/params_type.py 80.41% <ø> (ø)
pytensor/link/c/type.py 75.98% <ø> (ø)
pytensor/link/utils.py 59.69% <100.00%> (ø)
pytensor/scalar/math.py 87.79% <100.00%> (ø)
pytensor/scan/op.py 84.71% <100.00%> (ø)
... and 13 more

@@ -689,7 +689,7 @@ def _lessbroken_deepcopy(a):
else:
rval = copy.deepcopy(a)

assert type(rval) == type(a), (type(rval), type(a))
assert type(rval) is type(a), (type(rval), type(a))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this surely equivalent? Could the classes override type equality somehow?

The many places where we had type(...) == type(...) make me weary of these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ya, I am also weary of this commit. You should be very skeptical.

On my first attempt I also changed this line and it caused a test failure. (Note that this line is not like the others: .type instead of type(), and doesn't lead to a warning; I was just replacing == with is wherever I saw it next to type.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's different. Is there a reference for this rule that we can look at? Maybe that will confirm it is indeed always safe to do so.

@maresb
Copy link
Contributor Author

maresb commented Jan 15, 2024

This has been largely superseded by #586.

I split the code changes into #598, #597, and #596.

I'm going to open a fresh PR with hopefully just a pure pre-commit autoupgrade.

@maresb maresb closed this Jan 15, 2024
@maresb maresb deleted the update-pre-commit branch January 15, 2024 13:37
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.

3 participants