diff --git a/CHANGELOG.md b/CHANGELOG.md index f64e847..5b2b484 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +- fix pth when the current prefix is not the last + ## [v0.5.1] - 2022-05-02 - add metadata diff --git a/cmeel/consts.py b/cmeel/consts.py index fc4f27d..120afc4 100644 --- a/cmeel/consts.py +++ b/cmeel/consts.py @@ -1,8 +1,7 @@ import os import sys +CMEEL_PREFIX = "cmeel.prefix" SITELIB = os.sep.join( ["lib", "python" + ".".join(sys.version.split(".")[:2]), "site-packages"] ) -CMEEL_PREFIX = "cmeel.prefix" -CMEEL_PTH = os.sep.join([CMEEL_PREFIX, SITELIB]) diff --git a/cmeel/pth.py b/cmeel/pth.py index 3abc6ef..42d0bd9 100644 --- a/cmeel/pth.py +++ b/cmeel/pth.py @@ -1,6 +1,6 @@ -import os import sys +from pathlib import Path -from . import consts +from .consts import CMEEL_PREFIX, SITELIB -sys.path.append(os.sep.join([sys.path[-1], consts.CMEEL_PTH])) +sys.path.append(str(Path(__file__).parent.parent / CMEEL_PREFIX / SITELIB))