Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 8 additions & 11 deletions lnt/lnttool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,20 +466,17 @@ def _version_check():
when the version number changes (which may involve changing package
requirements).
"""
import pkg_resources
import importlib.metadata
import lnt

# Get the current distribution.
installed_dist = pkg_resources.get_distribution("LNT")
if installed_dist.project_name.lower() != lnt.__name__ or \
pkg_resources.parse_version(installed_dist.version) != \
pkg_resources.parse_version(lnt.__version__):
raise SystemExit("""\
error: installed distribution %s %s is not current (%s %s), you may need to reinstall
LNT or rerun 'setup.py develop' if using development mode.""" % (
installed_dist.project_name,
installed_dist.version,
lnt.__name__, lnt.__version__))
meta = importlib.metadata.metadata("LNT")
if meta['Name'].lower() != lnt.__name__ or meta['Version'] != lnt.__version__:
installed = "{} {}".format(meta['Name'], meta['Version'])
current = "{} {}".format(lnt.__name__, lnt.__version__)
raise SystemExit(f"""\
error: installed distribution {installed} is not current ({current}), you may need to reinstall
LNT or rerun 'setup.py develop' if using development mode.""")


def show_version(ctx, param, value):
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import sys
from setuptools import setup, find_packages, Extension

if sys.version_info < (3, 6):
raise RuntimeError("Python 3.6 or higher required.")
if sys.version_info < (3, 8):
raise RuntimeError("Python 3.8 or higher required.")

cflags = []

Expand Down Expand Up @@ -80,7 +80,7 @@
'License :: OSI Approved :: Apache-2.0 with LLVM exception',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Topic :: Software Development :: Quality Assurance',
'Topic :: Software Development :: Testing',
],
Expand Down Expand Up @@ -138,5 +138,5 @@

ext_modules=[cPerf],

python_requires='>=3.6',
python_requires='>=3.8',
)