diff options
author | John Kacur <jkacur@redhat.com> | 2023-02-16 11:03:59 -0500 |
---|---|---|
committer | John Kacur <jkacur@redhat.com> | 2023-08-10 13:41:06 -0400 |
commit | e18ddaf23636cbd81f28cadcd8aae2753d6c2478 (patch) | |
tree | fc2ba40c09e82f7dad9af0e41861f69d35cdb1ed | |
parent | 7f43598387e44e2da93ead2e075b7232429e4cc4 (diff) | |
download | python-linux-procfs-e18ddaf23636cbd81f28cadcd8aae2753d6c2478.tar.gz |
python_linux_procfs: setup.py: Remove distutils
distutils is deprecated, so use sysconfig instead
different versions of python produce different results, which is why
we test which SCHEME is available before calculating our answer.
TODO: test whether we need to calculate PYTHONLIB at all. Is it being
used during the setup? We don't appear to be using a --prefix from our
specfiles. This patch ensures that if it is used, we are getting a
correct PYTHONLIB without using distutils, but perhaps we can just drop
this section.
We need to bump the version number as well here, it looks like it was
missed the last time.
Signed-off-by: John Kacur <jkacur@redhat.com>
-rwxr-xr-x | setup.py | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1,17 +1,21 @@ #!/usr/bin/python3 import os -from os.path import isfile, join -from distutils.sysconfig import get_python_lib +from os.path import isfile, relpath +import sysconfig from setuptools import setup if isfile("MANIFEST"): os.unlink("MANIFEST") +SCHEME = 'rpm_prefix' +if not SCHEME in sysconfig.get_scheme_names(): + SCHEME = 'posix_prefix' + # Get PYTHONLIB with no prefix so --prefix installs work. -PYTHONLIB = join(get_python_lib(standard_lib=1, prefix=''), 'site-packages') +PYTHONLIB = relpath(sysconfig.get_path('platlib', SCHEME), '/usr') setup(name="python-linux-procfs", - version = "0.7.0", + version = "0.7.1", description = "Linux /proc abstraction classes", author = "Arnaldo Carvalho de Melo", author_email = "acme@redhat.com", |