Skip to content

Commit ba64ece

Browse files
committed
Locate VERSION file relative to the version.py module
In case this is run from somewhere else than the libjuju top directory (e.g. sphinx).
1 parent 0fe52cc commit ba64ece

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

juju/version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Copyright 2023 Canonical Ltd.
22
# Licensed under the Apache V2, see LICENCE file for details.
33

4+
import pathlib
45
import re
56

67
LTS_RELEASES = ["jammy", "focal", "bionic", "xenial", "trusty", "precise"]
@@ -14,5 +15,5 @@
1415
# to update the client to the latest.
1516
# However, for any CLIENT_VERSION > juju-controller-version, a "client incompatible
1617
# with server" will be returned by the juju controller.
17-
VERSION_FILE_PATH = './VERSION'
18+
VERSION_FILE_PATH = pathlib.Path(__file__).parent.parent / 'VERSION'
1819
CLIENT_VERSION = re.search(r'\d+\.\d+\.\d+', open(VERSION_FILE_PATH).read().strip()).group()

0 commit comments

Comments
 (0)