tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: un-self-conficting python packages for non-default python



Am Tue, 19 Dec 2023 06:52:25 +0100
schrieb Thomas Klausner <wiz%gatalith.at@localhost>:

> The usual workaround is to rename the binaries from foo to
> foo-${PYVERSSUFFIX} and add an ALTERNATIVES files that provides 'foo'
> (if you have pkg_alternatives installed); and patch other packages
> that call this at build/run time to expect foo-${PYVERSSUFFIX} instead
> of foo.
> 
> Do you have cases where this is not sufficient?

I have to pedal back from my earlier answer. Looking at an older install that I did with python38 intitially and then added python39 on user request, I see this:

$ cat /sw/env/gcc-10.3.0_openmpi-4.1.1/pkgsrc/2022Q1/pkgdb/py3{8,9}-pybind11-2.9.1/+REQUIRED_BY 
py38-scipy-1.7.3nb1
py39-scipy-1.7.3nb1

$ cat /sw/env/gcc-10.3.0_openmpi-4.1.1/pkgsrc/2022Q1/pkgdb/py3{8,9}-cairo-1.20.1nb1/+REQUIRED_BY 
py38-gobject3-3.42.0
py38-matplotlib-3.4.3nb1
py39-matplotlib-3.4.3nb1

So the gobject dependency entered via default python somewhere along
the software stack, but I explicitly install scipy and matplotlib for
folks to use. Those mean that py-pybind11 and py-cairo should not
conflict.

It's simply $PREFIX/bin/pybind11-config here. It can do this:

usage: pybind11-config [-h] [--includes] [--cmakedir]

optional arguments:
  -h, --help  show this help message and exit
  --includes  Include flags for both pybind11 and Python headers.
  --cmakedir  Print the CMake module directory, ideal for setting -Dpybind11_ROOT in CMake.

I'd assume matplotlib doesn't care about using this, as some
Python+CMake magic takes care of this (just deducing the paths). Who
would even miss this script? For py-cairo:

$ tail -n 100 /sw/env/gcc-10.3.0_openmpi-4.1.1/pkgsrc/2022Q1/pkgdb/py3{8,9}-cairo-1.20.1nb1/+CONTENTS |grep -v -e @
==> /sw/env/gcc-10.3.0_openmpi-4.1.1/pkgsrc/2022Q1/pkgdb/py38-cairo-1.20.1nb1/+CONTENTS <==
lib/python3.8/site-packages/pycairo-1.20.1-py3.8.egg-info/PKG-INFO
lib/python3.8/site-packages/pycairo-1.20.1-py3.8.egg-info/SOURCES.txt
lib/python3.8/site-packages/pycairo-1.20.1-py3.8.egg-info/dependency_links.txt
lib/python3.8/site-packages/pycairo-1.20.1-py3.8.egg-info/top_level.txt
lib/python3.8/site-packages/cairo/__init__.py
lib/python3.8/site-packages/cairo/__pycache__/__init__.cpython-38.pyc
lib/python3.8/site-packages/cairo/__init__.pyi
lib/python3.8/site-packages/cairo/__pycache__/__init__.cpython-38.opt-1.pyc
lib/python3.8/site-packages/cairo/_cairo.so
lib/python3.8/site-packages/cairo/include/py3cairo.h
lib/python3.8/site-packages/cairo/py.typed
include/pycairo/py3cairo.h
lib/pkgconfig/py3cairo.pc
+COMMENT
+DESC
+BUILD_VERSION
+BUILD_INFO
+SIZE_PKG
+SIZE_ALL

==> /sw/env/gcc-10.3.0_openmpi-4.1.1/pkgsrc/2022Q1/pkgdb/py39-cairo-1.20.1nb1/+CONTENTS <==
lib/python3.9/site-packages/pycairo-1.20.1-py3.9.egg-info/PKG-INFO
lib/python3.9/site-packages/pycairo-1.20.1-py3.9.egg-info/SOURCES.txt
lib/python3.9/site-packages/pycairo-1.20.1-py3.9.egg-info/dependency_links.txt
lib/python3.9/site-packages/pycairo-1.20.1-py3.9.egg-info/top_level.txt
lib/python3.9/site-packages/cairo/__init__.py
lib/python3.9/site-packages/cairo/__pycache__/__init__.cpython-39.pyc
lib/python3.9/site-packages/cairo/__init__.pyi
lib/python3.9/site-packages/cairo/__pycache__/__init__.cpython-39.opt-1.pyc
lib/python3.9/site-packages/cairo/_cairo.so
lib/python3.9/site-packages/cairo/include/py3cairo.h
lib/python3.9/site-packages/cairo/py.typed
+COMMENT
+DESC
+BUILD_VERSION
+BUILD_INFO
+SIZE_PKG
+SIZE_ALL

So this is about C header and pkgconfig file. It seems that it doesn't
hurt dependent python packages if these are missing. I wonder when
they're needed at all. Python stuff will just use
site-packages/cairo/include/py3cairo.h

Do you think ALTERNATIVES is sensible here? To add some colour … the
$PREFIX/include header is an identical copy (not symlink) of the one in
the python prefix. My tendency is to assume that it's actually an error
to install it at all.

Is anything using pycairo outside of python modules?


Alrighty then,

Thomas

-- 
Dr. Thomas Orgis
HPC @ Universität Hamburg


Home | Main Index | Thread Index | Old Index