python / python/mypy

Stubgen hangs forever for some packages

Open
#17,761 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

Bug Report

When executing
stubgen --package great_expectations --output ../dist/result/stubs1/bundled/stubs/great_expectations/

The output is:

2024-09-12T13:12:29+0800 - INFO - Great Expectations logging enabled at 20 level by JupyterUX module.
2024-09-12T13:12:29+0800 - INFO - Could not find local file-backed GX project
2024-09-12T13:12:29+0800 - INFO - Created temporary directory '/tmp/tmp2cxwhcay' for ephemeral docs site
2024-09-12T13:12:29+0800 - INFO - Loading 'datasources' ->
[]
2024-09-12T13:12:30+0800 - INFO - Great Expectations logging enabled at 20 level by JupyterUX module.
Processed 580 modules
Generated files under ../dist/result/stubs1/bundled/stubs/great_expectations/great_expectations/

The generation seems to be successful. But:

  1. There are some abnormal logs, and seems that they are from inside the package.
  2. The process hangs forever after the last line of output. It doesn't exit.

To Reproduce
Install package great-expectations==0.18.17, and then executing
stubgen --package great_expectations

Expected Behavior

Stubgen should exit after finishing stubs generation.

Actual Behavior

It would hang forever.

Your Environment

  • Mypy version used: 1.4.1
  • Mypy command-line flags: none
  • Mypy configuration options from mypy.ini (and other config files): none
  • Python version used: python 3.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the hang with stubgen --package great_expectations using great-expectations 0.18.17, then trace the stubgen command after the reported Generated files line. Check why the process remains alive after generation and verify that the command exits once stub generation completes without leaving the abnormal package logs unresolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.