Skip to content

Map win32gui imports to pywin32#538

Open
StantonMatt wants to merge 1 commit into
bndr:masterfrom
StantonMatt:map-win32gui-pywin32
Open

Map win32gui imports to pywin32#538
StantonMatt wants to merge 1 commit into
bndr:masterfrom
StantonMatt:map-win32gui-pywin32

Conversation

@StantonMatt

Copy link
Copy Markdown

Fixes #331.

win32gui is provided by the pywin32 distribution, so requirements generated from projects importing win32gui should use pywin32 instead of the import name. This adds the mapping and extends the existing package-name mapping test to cover it.

Verification:

  • .venv/bin/python -m unittest tests.test_pipreqs.TestPipreqs.test_get_pkg_names
  • .venv/bin/python -m unittest discover -s tests
  • .venv/bin/python -m flake8 pipreqs tests
  • git diff --check
  • review-fix-loop: no blocking correctness issues

Signed-off-by: Matthew Stanton <stantonmatthewj@gmail.com>
@bubaizhanshen

Copy link
Copy Markdown

I checked this locally on Python 3.10.

get_pkg_names(['win32gui']) now returns ['pywin32'], which matches the package users need for the import in #331.

Checks I ran:

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

All passed.

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.

Suggest pywin32 for win32gui on py3.7

2 participants