pre-commit / pre-commit-hooks

Some out-of-the-box hooks for pre-commit
MIT License
5.34k stars 708 forks source link

requirements-txt-fixer doesn't handle new pkg_resources==0.0.0 #1030

Closed ericfrederich closed 7 months ago

ericfrederich commented 7 months ago

Perhaps something changed on PyPI but instead of Ubuntu 20.04 generating pkg-resources==0.0.0 it now generates npkg_resources==0.0.0 which should also be ignored.

ericfrederich commented 7 months ago

It's easy to demonstrate this using Docker to run the old OS.

What you'll see at the end when you run the below command is pkg_resources==0.0.0 not pkg-resources==0.0.0

docker run --rm ubuntu:20.04 \
    /bin/bash -c \
    'apt update && apt upgrade -y && apt install -y python3 python3-venv &&
    python3 -m venv /tmp/delete-me-venv &&
    source /tmp/delete-me-venv/bin/activate &&
    pip install --upgrade pip wheel &&
    echo requirements... &&
    pip freeze'