Qix- / better-exceptions

Pretty and useful exceptions in Python, automatically.
MIT License
4.59k stars 202 forks source link

ModuleNotFoundError: No module named 'better_exceptions.integrations' #111

Closed sumanthratna closed 3 years ago

sumanthratna commented 3 years ago

Hi @Qix-, sorry to bother you again.

The Django middleware integration still doesn't work because of an error I didn't catch earlier.

Reproduction

Local Editable Install

  1. git clone --depth 1 https://github.com/Qix-/better-exceptions.git
  2. cd better-exceptions
  3. python3 -m pip install -e .
  4. python3 -c "import better_exceptions.integrations" raises no error!

VCS Install

  1. python3 -m pip install git+https://github.com/Qix-/better-exceptions.git
  2. python3 -c "import better_exceptions.integrations" raises a ModuleNotFoundError

PyPI Install

  1. python3 -m pip install better-exceptions==0.3.1
  2. python3 -c "import better_exceptions.integrations" raises a ModuleNotFoundError

so my guess is that somewhere in setup.py, package subdirectories are not copied into the wheel (and the source .tar.gz file on PyPI contains the integrations directory while the .whl doesn't)

I think using setuptools.find_packages() will fix this (or we could hard-code the packages kwarg). I can try creating a PR but I want to make sure this won't break anything with the PTH file

Environment

Qix- commented 3 years ago

Ah yeah this is my fault, I forgot about this.

Python package management is a huge pain :/

Qix- commented 3 years ago

Okay released as 0.3.2, let me know if that fixes it :)

sumanthratna commented 3 years ago

Yup, 97c0b200df960ab28ade687c8897290bdd08e035 fixed the issue. Thanks again!