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

working with python 3.12 #2143

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 10 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
# 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 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")
)

try:
import importlib.util
spec = importlib.util.spec_from_file_location("coremltools.version", os.path.join(coremltools_dir, "version.py"))
version_module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
except ImportError: # Python 3.5 and below
import importlib.machinery
version_module = importlib.machinery.SourceFileLoader('coremltools.version', os.path.join(coremltools_dir, "version.py")).load_module()

__version__ = version_module.__version__

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