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

[pre-commit.ci] pre-commit autoupdate #656

Merged
merged 3 commits into from Oct 12, 2022
Merged

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Oct 11, 2022

updates:
- [github.com/psf/black: 22.8.0 → 22.10.0](psf/black@22.8.0...22.10.0)
- [github.com/asottile/pyupgrade: v2.38.2 → v3.1.0](asottile/pyupgrade@v2.38.2...v3.1.0)
@codecov
Copy link

codecov bot commented Oct 11, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (a7076f3) compared to base (3a48025).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #656   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           80        80           
  Lines        10531     10530    -1     
=========================================
- Hits         10531     10530    -1     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/qibo/optimizers.py 100.00% <ø> (ø)
src/qibo/gates/gates.py 100.00% <100.00%> (ø)
src/qibo/gates/special.py 100.00% <100.00%> (ø)
src/qibo/models/circuit.py 100.00% <100.00%> (ø)
src/qibo/models/evolution.py 100.00% <100.00%> (ø)
src/qibo/models/grover.py 100.00% <100.00%> (ø)
src/qibo/models/qgan.py 100.00% <100.00%> (ø)
src/qibo/models/variational.py 100.00% <100.00%> (ø)
src/qibo/tests/test_models_evolution.py 100.00% <100.00%> (ø)
src/qibo/tests/test_prints.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@alecandido
Copy link
Member

alecandido commented Oct 12, 2022

Problem here is the following:

https://github.com/asottile/pyupgrade/blob/d50ce21fc45d014790d4ecf71d1b1d7ccc450526/README.md#-coding--comment

# coding: ... comment

as of PEP 3120, the default encoding for python source is UTF-8

-# coding: utf-8
 x = 1

So it is clashing with:

- id: fix-encoding-pragma

Proposed solution

  1. drop pragmas and fix-encoding-pragma hook
  2. revert pyupgrade upgrade

In the second case, the offending commit is asottile/pyupgrade@57eb8ab, not surprisingly a very big one, and exactly the one before v3.0.0.
So, it should be reverted to v2.x.y (the latest of the series being v2.38.4).

@scarrazza
Copy link
Member

@alecandido thank you so much. @andrea-pasquale could you please have a look?

@felixhekhorn
Copy link

felixhekhorn commented Oct 12, 2022

Sorry for jumping in, but I believe there is even a third possibility: i.e. configure the hook as it should be able to even remove pragmas: https://github.com/pre-commit/pre-commit-hooks/blob/5420c705a4dda45ce7edb2a570b8d3f64e3648eb/pre_commit_hooks/fix_encoding_pragma.py#L123

@alecandido
Copy link
Member

Sorry for jumping in, but I believe there is even a third possibility: i.e. configure the hook as it should be able to even remove pragmas: https://github.com/pre-commit/pre-commit-hooks/blob/5420c705a4dda45ce7edb2a570b8d3f64e3648eb/pre_commit_hooks/fix_encoding_pragma.py#L123

That is not very useful, since the clash is there because pyupgrade is already doing it. Better to keep a single dependency, rather than two doing the same job (for as long as they actually do the same...).

@andrea-pasquale
Copy link
Contributor

Thanks @alecandido and @felixhekhorn.
@scarrazza I think that the safest solution is this one

2. revert pyupgrade upgrade

If you agree I'll implement this fix here.

@scarrazza
Copy link
Member

Thanks guys @felixhekhorn @alecandido. @andrea-pasquale I agree with the downgrade.

@andrea-pasquale
Copy link
Contributor

Done @scarrazza. Now tests are passing. Feel free to merge.

@scarrazza
Copy link
Member

Thank you all.

@scarrazza scarrazza merged commit 34131b5 into master Oct 12, 2022
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.

None yet

4 participants