mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-22 10:07:12 +00:00
previously, this check would fail if the setuptools version would contain non-integers. On my system, that is the case: `setuptools.__version__` is `'75.1.0.post0'` I believe it is entirely fair to just check the relevant bits and refuse to continue if those can not be checked properly. But haviong something extra on the version should not immediately cause issues (e.g. the `post0` here, or slugs like `beta`, `alpha` and the likes). Probably only very few systems are running setuptools with weird version info, but supporting this doesn't cost much, i believe.
15 lines
436 B
Python
15 lines
436 B
Python
#!/usr/bin/python3
|
|
# the build path has changed in setuptools 62.1:
|
|
# https://github.com/pypa/setuptools/commit/1c23f5e1e4b18b50081cbabb2dea22bf345f5894
|
|
import sys
|
|
import sysconfig
|
|
|
|
import setuptools
|
|
|
|
|
|
if tuple(map(int, setuptools.__version__.split(".")[:2])) >= (62, 1):
|
|
identifier = sys.implementation.cache_tag
|
|
else:
|
|
identifier = "%d.%d" % sys.version_info[:2]
|
|
print("lib.{}-{}".format(sysconfig.get_platform(), identifier))
|