mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
use new build_platlib path with setuptools >= 61.2
This commit is contained in:
parent
97bd86c7c6
commit
47d68dac0f
4 changed files with 15 additions and 6 deletions
|
@ -10,8 +10,7 @@ test_python.py: test_python.py.in $(top_builddir)/config.status
|
||||||
|
|
||||||
CLEANFILES = test_python.py
|
CLEANFILES = test_python.py
|
||||||
|
|
||||||
# bah, how brittle is this?
|
PYTHON_DIST_BUILD_PATH = '$(builddir)/../build/$$($(PYTHON) buildpath.py)'
|
||||||
PYTHON_DIST_BUILD_PATH = '$(builddir)/../build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")'
|
|
||||||
|
|
||||||
TESTS = test_python.py
|
TESTS = test_python.py
|
||||||
TESTS_ENVIRONMENT = \
|
TESTS_ENVIRONMENT = \
|
||||||
|
|
10
libraries/libapparmor/swig/python/test/buildpath.py
Normal file
10
libraries/libapparmor/swig/python/test/buildpath.py
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# the build path has changed in setuptools 61.2
|
||||||
|
import sys
|
||||||
|
import sysconfig
|
||||||
|
import setuptools
|
||||||
|
if tuple(map(int,setuptools.__version__.split("."))) >= (61, 2):
|
||||||
|
identifier = sys.implementation.cache_tag
|
||||||
|
else:
|
||||||
|
identifier = "%d.%d" % sys.version_info[:2]
|
||||||
|
print("lib.%s-%s" % (sysconfig.get_platform(), identifier))
|
|
@ -31,8 +31,8 @@ ifdef USE_SYSTEM
|
||||||
BASEDIR=
|
BASEDIR=
|
||||||
PARSER=
|
PARSER=
|
||||||
else
|
else
|
||||||
# PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am
|
# PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/testbuildpath.py
|
||||||
PYTHON_DIST_BUILD_PATH = ../../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")
|
PYTHON_DIST_BUILD_PATH = ../../libraries/libapparmor/swig/python/build/$$($(PYTHON) ../../libraries/libapparmor/swig/python/test/buildpath.py)
|
||||||
LIBAPPARMOR_PATH=../../libraries/libapparmor/src/.libs/
|
LIBAPPARMOR_PATH=../../libraries/libapparmor/src/.libs/
|
||||||
LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH)
|
LD_LIBRARY_PATH=$(LIBAPPARMOR_PATH):$(PYTHON_DIST_BUILD_PATH)
|
||||||
PYTHONPATH=..:$(PYTHON_DIST_BUILD_PATH)
|
PYTHONPATH=..:$(PYTHON_DIST_BUILD_PATH)
|
||||||
|
|
|
@ -16,7 +16,7 @@ For more information, refer to the [unittest documentation](https://docs.python.
|
||||||
Make sure to set the environment variables pointing to the in-tree apparmor modules, and the in-tree libapparmor and its python wrapper:
|
Make sure to set the environment variables pointing to the in-tree apparmor modules, and the in-tree libapparmor and its python wrapper:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ export PYTHONPATH=..:../../libraries/libapparmor/swig/python/build/$(/usr/bin/python3 -c "import sysconfig; print(\"lib.%s-%s\" %(sysconfig.get_platform(), sysconfig.get_python_version()))")
|
$ export PYTHONPATH=..:../../libraries/libapparmor/swig/python/build/$(/usr/bin/python3 ../../libraries/libapparmor/swig/python/test/buildpath.py)
|
||||||
$ export __AA_CONFDIR=.
|
$ export __AA_CONFDIR=.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -24,4 +24,4 @@ To execute the test individually, run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ python3 ./test-tile.py ClassFoo.test_bar
|
$ python3 ./test-tile.py ClassFoo.test_bar
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue