Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#issue-1846 fixed by updating imp to importlib. #2170

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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