Skip to content

Commit

Permalink
#issue-1846 fixed by updating imp to importlib. (#2170)
Browse files Browse the repository at this point in the history
  • Loading branch information
teelrabbit authored Mar 19, 2024
1 parent 169d0ac commit bb62da2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
# Use of this source code is governed by a BSD-3-clause license that can be
# found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause

import imp
import importlib.util
import os
from setuptools import setup, find_packages

# Get the coremltools version string
coremltools_dir = os.path.join(os.path.dirname(__file__), "coremltools")
version_module = imp.load_source(
"coremltools.version", os.path.join(coremltools_dir, "version.py")
)
version_file = os.path.join(coremltools_dir, "version.py")

spec = importlib.util.spec_from_file_location("coremltools.version", version_file)
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)

__version__ = version_module.__version__

README = os.path.join(os.getcwd(), "README.md")
Expand Down

0 comments on commit bb62da2

Please sign in to comment.