detect-secrets icon indicating copy to clipboard operation
detect-secrets copied to clipboard

Problem with Python3.11 and pre-commit

Open puranss opened this issue 1 year ago • 4 comments

  • I'm submitting a ...
    • [ x] bug report
    • [ ] feature request

Currently I have installed pre-commit with pip . If I do an audit it works fine with: Nothing to audit! I added a preconfig configuration like this

  • repo: https://github.com/Yelp/detect-secrets rev: v1.0.1 hooks:
    • id: detect-secrets args: ['--baseline', '.secrets.baseline'] exclude: package.lock.json

And it exits always with error code 1 (there is no secret). I tried switching different versions but nothing seems to be working

  • What is the expected behavior?

  • That it works with precommit

  • What is the motivation / use case for changing the behavior? *That it works with pre-commit so that I can add it to my workflow

  • Please tell us about your environment:

    • detect-secrets Version: 1.0.1
    • Python Version: 3.11
    • OS Version: macOs
    • File type (if applicable):

puranss avatar Jan 29 '24 14:01 puranss

@puranss Do you have it working with another version of Python? The title implies the problem is new with Python 11.

gpflaum avatar Jan 29 '24 18:01 gpflaum

Actually no, I edited the title. The problem is, it is working when I use audit but in precommit it fails with exit code 1 but no explaination of it.

puranss avatar Jan 30 '24 06:01 puranss

I tried it with 3.9, there I have the same problem

puranss avatar Jan 30 '24 07:01 puranss

Hi @puranss, we just recently released support for Python 3.11. Could you please upgrade detect-secrets to v1.5 and let us know if this issue is still relevant?

lorenzodb1 avatar May 16 '24 18:05 lorenzodb1