diff --git a/python/cuproj/cuproj/_version.py b/python/cuproj/cuproj/_version.py index 2a5beedaa..e7bd99791 100644 --- a/python/cuproj/cuproj/_version.py +++ b/python/cuproj/cuproj/_version.py @@ -12,8 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os.path +import importlib.resources -with open(os.path.join(os.path.dirname(__file__), 'VERSION')) as version_file: - __version__ = version_file.read().strip() +__version__ = ( + importlib.resources.files("cuproj").joinpath("VERSION").read_text().strip() +) __git_commit__ = "" diff --git a/python/cuspatial/cuspatial/_version.py b/python/cuspatial/cuspatial/_version.py index f38ca7add..e1333b17a 100644 --- a/python/cuspatial/cuspatial/_version.py +++ b/python/cuspatial/cuspatial/_version.py @@ -12,8 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os.path +import importlib.resources -with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file: - __version__ = version_file.read().strip() +__version__ = ( + importlib.resources.files("cuspatial") + .joinpath("VERSION") + .read_text() + .strip() +) __git_commit__ = ""