#3654 replace deprecated distutils
Merged a year ago by tkopecek. Opened a year ago by tkopecek.
tkopecek/koji issue3514  into  master

file modified
+1 -1
@@ -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

  

file modified
+1 -1
@@ -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"

@@ -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'))

file modified
+1 -1
@@ -3,7 +3,7 @@ 

  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))

file modified
+1 -1
@@ -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

  

file modified
+1 -1
@@ -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

file modified
+1 -1
@@ -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)

distutils will get removed in python 3.12. It is usage is now replaced
by sysconfig. For py2 version code stays in specfile.

https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated

Related: https://pagure.io/koji/issue/3514

rebased onto 3e8e185

a year ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

a year ago

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

a year ago

Commit 99a7e44 fixes this pull-request

Pull-Request has been merged by tkopecek

a year ago