Skip to content

Keep requests package mapping lowercase#533

Open
StantonMatt wants to merge 1 commit into
bndr:masterfrom
StantonMatt:fix-requests-package-case
Open

Keep requests package mapping lowercase#533
StantonMatt wants to merge 1 commit into
bndr:masterfrom
StantonMatt:fix-requests-package-case

Conversation

@StantonMatt

@StantonMatt StantonMatt commented Jun 1, 2026

Copy link
Copy Markdown

Summary

  • update the requests import mapping to emit the lowercase PyPI package name
  • add a regression test for get_pkg_names(['requests'])

Fixes #500.

Verification

  • uv run --with-editable . python -m unittest tests.test_pipreqs.TestPipreqs.test_get_pkg_names_keeps_requests_lowercase
  • uv run --with flake8 python -m unittest discover
  • uv run --with flake8 flake8 pipreqs tests
  • git diff --check
  • review-fix-loop clean

@bubaizhanshen

Copy link
Copy Markdown

I checked the mapping change locally on Python 3.10.

The focused tests pass:

python -m unittest tests.test_pipreqs.TestPipreqs.test_get_pkg_names_keeps_requests_lowercase tests.test_pipreqs.TestPipreqs.test_get_pkg_names
python -m flake8 pipreqs tests
python -m py_compile pipreqs/pipreqs.py tests/test_pipreqs.py
git diff --check upstream/master...HEAD

A small end-to-end probe with import requests changes the generated no-pin output from Requests on upstream/master to lowercase requests on this branch, which is the issue #500 is asking for.

One separate note: in my environment there are two local requests records visible, so this branch alone can write two lowercase requests lines. That is the duplicate-output issue covered by #537 rather than a problem with this mapping change itself.

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.

Wrongly capitalizes module name: "Requests"

2 participants