juan-m12i/tfl-api-wrapper

helper_functions and constants are not recognised as modules when running start.py or tests.py

tony-had opened this issue · 1 comments

from helper_functions import merge_two_dicts, log_bulk, debug_bulk

from constants import DEBUG_DATA_LEVEL, STOP_TYPES

Steps To Reproduce

  1. Clone/download the repository on a clean environment.
  2. Install tfl_api using setup.py.
  3. Run start.py or tests.py.

Actual Result
Running start.py:

$ python start.py
Traceback (most recent call last):
  File "start.py", line 3, in <module>
    from tfl_api import TfLAPI
  File "C:\Users\tonyh\tfl-api-wrapper\tfl_api\__init__.py", line 1, in <module>
    from .tfl_api import Client, TfLAPI, Response
  File "C:\Users\tonyh\tfl-api-wrapper\tfl_api\tfl_api.py", line 9, in <module>
    from helper_functions import merge_two_dicts, log_bulk, debug_bulk
ModuleNotFoundError: No module named 'helper_functions'

Running tests.py:

$ python tests.py
Traceback (most recent call last):
  File "tests.py", line 4, in <module>
    from tfl_api import TfLAPI, Client, Response
  File "C:\Users\tonyh\tfl-api-wrapper\tfl_api\__init__.py", line 1, in <module>
    from .tfl_api import Client, TfLAPI, Response
  File "C:\Users\tonyh\tfl-api-wrapper\tfl_api\tfl_api.py", line 9, in <module>
    from helper_functions import merge_two_dicts, log_bulk, debug_bulk
ModuleNotFoundError: No module named 'helper_functions'

Expected Result
start.py and tests.py execute with no errors.

Workaround

from tfl_api.helper_functions import merge_two_dicts, log_bulk, debug_bulk
from tfl_api.constants import DEBUG_DATA_LEVEL, STOP_TYPES

Thanks for your comment, I'll check it over the weekend, it's been a while since I've put it up.