Skip to content

Commit

Permalink
[REF] Replace pkg_resources with distutils and importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
f-dangel committed Jun 24, 2024
1 parent 3b5dbcd commit 4c1294a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
"""

import sys
from distutils.version import LooseVersion
from importlib.metadata import PackageNotFoundError, version

from pkg_resources import VersionConflict, require
from setuptools import setup

try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
setuptools_version = LooseVersion(version("setuptools"))
required_version = LooseVersion("38.3")
if setuptools_version < required_version:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)
except PackageNotFoundError:
print("setuptools not found")
sys.exit(1)


if __name__ == "__main__":
setup(use_scm_version=True)

0 comments on commit 4c1294a

Please sign in to comment.