The directory structure of my project is as follows:

.
└── Home/
    └── project/
        ├── data/
        │   ├── dataset.py
        │   └── data_utils.py
        ├── src/
        │   └── main.py
        ├── .pre-commit-config.yaml
        └── .isort.cfg

I also have a .env file that I'm using Python-dotenv to load that has the PYTHONPATH environment variable set to PYTHONPATH="$(pwd):$(pwd)/src:$(pwd)/data" so that I can perform imports from within the data directory.

In the data_utils.py file I have an import that goes from dataset import Dataset. When I run my commits Isort groups from dataset import Dataset with the other third party import statements.

I've tried to specify the following in my .isort.cfg but none of them work:

  1. known_first_party=data_utils
  2. known_first_party=data_utils & src_paths=data

I'm a little stuck as to what else I could try.

0

There are 0 answers