pyscaffold / pyscaffoldext-dsproject

đź’« PyScaffold extension for data-science projects

Home Page:https://pyscaffold.org/projects/dsproject

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Initializing pre-commit environment fails due to no longer supported unauthenticated protocol

daniel-smit-haw opened this issue · comments

Description of your problem

When creating a new dsproject a first commit fails during the initialization of the pre-commit environment.

putup --dsproject test
cd test
conda env create -f environment.yml
conda activate test
pre-commit install
touch test-file
git-add test-file
git commit
[WARNING] The 'rev' field of repo 'https://github.com/psf/black' appears to be a mutable reference (moving tag / branch).  Mutable references are never updated after first install and are not supported.  See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details.  Hint: `pre-commit autoupdate` often fixes this.
[INFO] Initializing environment for git://github.com/pre-commit/pre-commit-hooks.
An unexpected error has occurred: CalledProcessError: command: ('/usr/lib/git-core/git', 'fetch', 'origin', '--tags')
return code: 128
expected return code: 0
stdout: (none)
stderr:
    fatal: remote error:
      The unauthenticated git protocol on port 9418 is no longer supported.
    Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

Check the log at /home/jovyan/.cache/pre-commit/pre-commit.log

Possible solution

Only users connecting via SSH or git:// are affected. If your Git remotes start with https://, nothing in this post will affect you. If you’re an SSH user, read on for the details and timeline.
https://github.blog/2021-09-01-improving-git-protocol-security-github/

Changing - repo: git://github.com/pre-commit/pre-commit-hooks to - repo: https://github.com/pre-commit/pre-commit-hooks in .pre-commit-config.yaml does the trick for me.

Versions and main components

  • PyScaffold Version: 4.1.1
  • Python Version: 3.9.7
  • Operating system: Linux
  • How did you install PyScaffold: conda

Thanks @daniel-smit-haw for reporting this. We just released PyScaffold v4.1.3 that fixes this. Could you check? Thanks :-)

Thanks @daniel-smit-haw for reporting this. We just released PyScaffold v4.1.3 that fixes this. Could you check? Thanks :-)

Sry, for the late reply.
I just tested it with PyScaffold 4.2.1 - worked like a charm. :-)
Thanks for the fix!