mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-05 08:45:22 +00:00
Fix for #253, by mirroring the change from1c23f5e1e4
On top of that, fix setuptools version detection in buildpath.py. libraries/libapparmor/swig/python/test/buildpath.py: The changes introduced incc7f549665
targetted a wrong setuptools version (61.2). The change in build directory naming has been introduced with 62.0. Fixes #259 Fixes #39 The first 3 commits are based on https://gitlab.com/apparmor/apparmor/-/merge_requests/897, the other two come from https://gitlab.com/apparmor/apparmor/-/merge_requests/904. Since there are several differences between 2.13 and >= 3.0, I had to adjust the patches at several places. I propose this MR for 2.11, 2.12 and 2.13. MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/910 Approved-by: John Johansen <john@jjmx.net> Merged-by: John Johansen <john@jjmx.net> (cherry picked from commit3c047517a4
) Signed-off-by: John Johansen <john.johansen@canonical.com>
14 lines
427 B
Python
14 lines
427 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("."))) >= (62, 1):
|
|
identifier = sys.implementation.cache_tag
|
|
else:
|
|
identifier = "%d.%d" % sys.version_info[:2]
|
|
print("lib.%s-%s" % (sysconfig.get_platform(), identifier))
|