OpenPrinting / system-config-printer

Graphical user interface for CUPS administration
GNU General Public License v2.0
155 stars 87 forks source link

Build failed because setup.py install #355

Closed zxln007 closed 1 month ago

zxln007 commented 2 months ago

build log:

Making install in .
make[1]: Entering directory '/root/rpmbuild/BUILD/system-config-printer-1.5.18'
/usr/bin/python3 setup.py build
make[2]: Entering directory '/root/rpmbuild/BUILD/system-config-printer-1.5.18'
/usr/bin/python3 setup.py install --prefix=/root/rpmbuild/BUILDROOT/system-config-printer-1.5.18-4.riscv64/usr
/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!
        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.
        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************
!!
  self.initialize_options()
/usr/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.
        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************
!!
  self.initialize_options()
TEST FAILED: /root/rpmbuild/BUILDROOT/system-config-printer-1.5.18-4.riscv64/usr/lib/python3.11/site-packages/ does NOT support .pth files
bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from.  The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
    /root/rpmbuild/BUILDROOT/system-config-printer-1.5.18-4.riscv64/usr/lib/python3.11/site-packages/
and your PYTHONPATH environment variable currently contains:
    ''
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
  on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
  variable.  (It must then also be on PYTHONPATH whenever you run
  Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
  using one of the approaches described here:
  https://setuptools.pypa.io/en/latest/deprecated/easy_install.html#custom-installation-locations

what can i do to fix it ?

thanks

tillkamppeter commented 2 months ago

Could you apply the following patch and test whether this solves your problem?

--- a/Makefile.am
+++ b/Makefile.am
@@ -63,7 +63,7 @@

 # Use distutils to install the module.
 install-exec-local: .stamp-distutils-in-builddir
-       $(PYTHON) setup.py install --prefix=$(DESTDIR)$(prefix)
+       $(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(prefix)

 # Uninstall the module, crossing our fingers that we know enough
 # about how distutils works to do this.  Unfortunately, distutils
rffontenelle commented 2 months ago

@tillkamppeter I tested and can confirm the above error message is gone. System: Arch Linux 64-bit, system-config-printer 1.5.18

After applying the above patch, the output is:

make[2]: Entering directory '/build/system-config-printer/src/system-config-printer-1.5.18'
/usr/bin/python setup.py install --root=/build/system-config-printer/pkg/system-config-printer --prefix=/usr
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
rffontenelle commented 2 months ago

@tillkamppeter And also fixes #357

zdohnal commented 1 month ago

Fixed by #361 .