Skip to content

Don't import pandas #627

@lieryan

Description

@lieryan

pandas is really slow to import, importing this library can add seconds to a program's startup time, which can be critical for unittest and CLI programs that needs fast startup time.

To reproduce:

  1. Setup new virtualenv (optional)
  2. Install pandas and pyfakefs into your virtualenv
  3. Time python -c "import pyfakefs.fakefilesysem_unittest"
  4. Compare timing with another virtualenv where pandas is not installed

Expected behaviour:

pyfakefs should only import pandas or other libraries that it monkey patch, if the main application is already importing them. Just having the library installed in the system packages shouldn't cause pyfakefs to assume that the library is going to be used by the currently running application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions