PR#3654: replace deprecated distutils

Merges #3654
https://pagure.io/koji/pull-request/3654

Fixes: #3514
https://pagure.io/koji/issue/3514
Replace deprecated distutils
This commit is contained in:
Tomas Kopecek 2023-01-16 12:36:25 +01:00
commit 99a7e44d2d
7 changed files with 14 additions and 6 deletions

View file

@ -1,7 +1,7 @@
SUBDIRS=koji_cli
PACKAGE = $(shell basename `pwd`)
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../devtools/get_site_packages.py )/$(PACKAGE)
FILES = koji

View file

@ -1,7 +1,7 @@
PYFILES = $(wildcard *.py)
PACKAGE = $(shell basename `pwd`)
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../../devtools/get_site_packages.py )/$(PACKAGE)
_default:
@echo "nothing to make. try make install"

View file

@ -0,0 +1,8 @@
# prints site-packages path for use in Makefiles
try:
from distutils.sysconfig import get_python_lib
print(get_python_lib())
except ImportError:
import sysconfig
print(sysconfig.get_path('purelib', 'rpm_prefix'))

View file

@ -3,7 +3,7 @@ PACKAGE = $(shell basename `pwd`)
PYFILES_ALL = $(wildcard *.py)
PYSCRIPTS =
SUBDIRS =
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../devtools/get_site_packages.py )/$(PACKAGE)
ifeq ($(PYVER_MAJOR),2)
PYFILES=$(filter-out db.py,$(PYFILES_ALL))

View file

@ -1,7 +1,7 @@
PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[:1]))')
PACKAGE = kojihub
PYFILES = $(wildcard *.py)
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../devtools/get_site_packages.py )/$(PACKAGE)
SERVERDIR = /usr/share/koji-hub

View file

@ -1,5 +1,5 @@
PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[:1]))')
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../devtools/get_site_packages.py )/$(PACKAGE)
CLIPLUGINDIR = $(PKGDIR)/koji_cli_plugins
HUBPLUGINDIR = /usr/lib/koji-hub-plugins

View file

@ -1,6 +1,6 @@
PACKAGE = $(shell basename `pwd`)
PYFILES = $(wildcard *.py)
PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
PKGDIR = $(shell $(PYTHON) ../../devtools/get_site_packages.py )/$(PACKAGE)
SERVERDIR = /kojiweb
FILES = $(wildcard *.py *.chtml)