Re: Python 3 parallel install (Re: Tumbleweed - Review of the week 2020/52)
Am 26.12.20 um 16:21 schrieb Neal Gompa:
On Sat, Dec 26, 2020 at 10:02 AM Ben Greiner <code@bnavigator.de> wrote:
- Python "apps" not following the flavored python-foo naming scheme, will only collect files for one (hopefully the primary python3 providing) flavor during the packaging phase. Remove %python_modules, %python_build, %python_install, %python_expand and the sort, as it unnecessarily pulls in packages for all python flavors and tries to build and install into multiple sitelib/sitearch directories. Replace by calling python3 directly or use the equivalent %python3_* macros.
[...]
- %ifpython3 and %python3_only are evil. They have been deprecated for some months already. Essentially, they fail to recognize the new flavors python36 and python38 which replace python3. OTOH, older distributions will continue to use the python3 flavor. We have introduced a new %python_provides macro, but did not modify %ifpython3 or %python3_only to incorporate this, because it is not automatically clear whether the conditioned code block shall apply to all flavors of Python3 packages or only to the primary interpreter. Replace by something like
* `%if "%{python_flavor}" == "python3" || "%{?python_provides}" == "python3"` for sections only provided by the primary flavor.
* `%if 0%{python_version_nodots} > 34` or `%if "%{python_flavor}" != "python2"` for section applicable to all Python 3 flavors.
I'm still not convinced this is a good idea. This fundamental change to how the Python stack works means that we will have to deal with this for all the different modules, and there are packages that deliberately don't use the "singlespec" model because it doesn't work for them (e.g. they don't use setuptools or they are an application).
Nobody has to use the singlespec model. Thankfully, nobody needs to convince you, or anybody else. But if you do use the macros, you have to use them correctly. This change has nothing to do with setuptools, and for applications see my comment about not using "%python_module" and the flavorless macros, which are -- and always have been -- singlespec.
What is the compelling reason to fully build out the stack this way?
Nothing changed in the "stack". You can continue to build against the primary python interpreter only. One reason for parallel install, which I can personally imagine, is to provide future python versions faster without switching to them as the primary python3 interpreter immediately. Python 3.9 has been released some weeks ago, but virtually no packages are built against it because many upstream projects are not ready yet. If we build against python39 in devel projects, we can detect early that a package needs work. Ben
participants (1)
-
Ben Greiner