Skip to content

Commit 9f73a9e

Browse files
committed
Fix to find the setup.cfg file relative to the root
1 parent 0887470 commit 9f73a9e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

erdetect/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
# Note 1: added since, despite the (minimum) requirements during install, packages can be downgraded or removed later
1414
# Note 2: deliberately not in a separate module, since this is the entry point of the package and dependencies already be used after
1515
#
16+
from os.path import join, dirname, abspath
1617
from configparser import ConfigParser
1718
from importlib.metadata import version, PackageNotFoundError
1819
from re import sub as re_sub, split as re_split
1920
def normalize_version(v):
2021
return [int(x) for x in re_sub(r'(\.0+)*$','', v).split(".")]
2122

2223
cf = ConfigParser()
23-
cf.read('setup.cfg')
24+
cf.read(join(dirname(abspath(__file__)), '..', 'setup.cfg'))
2425
require_lines = [x for x in cf.get('options', 'install_requires').strip().splitlines()]
2526

2627
for req_line in require_lines:

0 commit comments

Comments
 (0)