File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11"""Settings for testing fooof."""
22
33import os
4- import pkg_resources as pkg
4+
5+ # Use importlib to get package related paths, importing depending on Python version
6+ # Note: can drop if/else when support goes to >= 3.9 (see: https://stackoverflow.com/a/75503824)
7+ import sys
8+ if sys .version_info >= (3 , 9 ):
9+ import importlib .resources as importlib_resources
10+ else :
11+ import importlib_resources
512
613###################################################################################################
714###################################################################################################
815
916# Path Settings
10- BASE_TEST_FILE_PATH = pkg . resource_filename (__name__ , ' test_files')
17+ BASE_TEST_FILE_PATH = importlib_resources . files (__name__ . split ( '.' )[ 0 ]) / 'tests/ test_files'
1118TEST_DATA_PATH = os .path .join (BASE_TEST_FILE_PATH , 'data' )
1219TEST_REPORTS_PATH = os .path .join (BASE_TEST_FILE_PATH , 'reports' )
1320TEST_PLOTS_PATH = os .path .join (BASE_TEST_FILE_PATH , 'plots' )
You can’t perform that action at this time.
0 commit comments