Skip to content

Commit

Permalink
Switch to using importlib.resources
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Oct 26, 2023
1 parent 91a0797 commit ee34eb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 4 additions & 3 deletions python/cuproj/cuproj/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = ""
10 changes: 7 additions & 3 deletions python/cuspatial/cuspatial/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ = ""

0 comments on commit ee34eb4

Please sign in to comment.