N5GEH / n5geh.tools.entirety

GNU General Public License v3.0
9 stars 6 forks source link

Pre-Commit is not used any more #158

Closed djs0109 closed 4 months ago

djs0109 commented 4 months ago

Problem

It seems like the pre-commit hook is not actively used any more. It is a good tool, but we don't have helpful information/documentation for new developers. This may confuse them and lead to unexpected error like the one below.

[WARNING] Unstaged files detected.
[INFO] Stashing unstaged files to C:\Users\gthim\.cache\pre-commit\patch1707235722-40104.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Restored changes from C:\Users\gthim\.cache\pre-commit\patch1707235722-40104.
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\gthim\\.cache\\pre-commit\\repo38t6heex\\py_env-default\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
    Processing c:\users\gthim\.cache\pre-commit\repo38t6heex
      Preparing metadata (setup.py): started
      Preparing metadata (setup.py): finished with status 'done'
    Could not fetch URL https://pypi.org/simple/flake8/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='[pypi.org](http://pypi.org/)', port=443): Max retries exceeded with url: /simple/flake8/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
    INFO: pip is looking at multiple versions of pre-commit-hooks to determine which version is compatible with other requirements. This could take a while.
stderr:
    WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flake8/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flake8/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flake8/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flake8/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/flake8/
    ERROR: Could not find a version that satisfies the requirement flake8 (from pre-commit-hooks) (from versions: none)
    ERROR: No matching distribution found for flake8

Python: 3.8 Environment: as requirements.txt

Suggestion

In my opinion, there are two ways to improve this problem.

djs0109 commented 4 months ago

@sbanoeon what do you think?

sbanoeon commented 4 months ago

I still think it is still a cleaner way of working when using pre-commit tools. We can update the pre commit hook versions to latest and check if the error persists, then may be we can decide.