openSUSE / python-rpm-macros

Multi-Python, Single-Spec macros generator
Other
22 stars 20 forks source link

Deploy multiple python3 flavors #66

Closed bnavigator closed 3 years ago

bnavigator commented 4 years ago

This is intended as a tracker issue for the introduction of multiple python3 flavors and better reference in changelogs. The python-rpm-macros package with enabled flavors of python36 and python38 is in Staging:N and as expected various packages fail.

bnavigator commented 4 years ago

Wrong %python3_site(arch|lib) https://github.com/openSUSE/python-rpm-macros/pull/64#issuecomment-715373348

bnavigator commented 4 years ago
bnavigator commented 4 years ago

Python subpackages of other packages (see also #15, #73, #75, #76)

With #79, most of these packages need another iteration.

bnavigator commented 4 years ago
bnavigator commented 4 years ago

%python3_only and %ifpython3

bnavigator commented 4 years ago

BuildRequires: python3-foo where it is not enough to have one by the default provider (#69) but you need it for the specific flavor

mcepl commented 4 years ago

%python_exec is broken with multiple python3 flavours #72

bnavigator commented 4 years ago

70 already fixes that

bnavigator commented 4 years ago

Wrong shebang replacement

@mcepl, how do we deal with this one? The fix will require the new $python expansion, so I cannot just submit it to d:l:p when python-rpm-macros is stuck in Staging:N

@mcepl inline reply: For now a private definition of the macro in the package itself, possibly conditional, i.e. something like:

%{?!python_module:%define python_module() python-%{**} python3-%{**}}

We can always remove it later.

Edit: Could you please post a separate reply rather than editing my post?

bnavigator commented 4 years ago

Conflicting files outside of %python_site(lib|arch)

mcepl commented 4 years ago

Conflicting files outside of %python_site(lib|arch)

* [ ]  [python-tqdm](https://build.opensuse.org/package/show/openSUSE:Factory:Staging:N/python-tqdm)

I think this clearly calls for alternatives, however (and I guess Sphinx as well).

scarabeusiv commented 4 years ago

Why not just split bash completion file into subpkg, that would be the most proper solution.

bnavigator commented 4 years ago

I found a way that works with the old and new python_expand: sr#845689

mcepl commented 4 years ago

I found a way that works with the old and new python_expand: sr#845689

??? This is not python-tqdm. ???

bnavigator commented 4 years ago

No it is psutil. Granted the history of https://github.com/openSUSE/python-rpm-macros/issues/66#issuecomment-721016747 makes it confusing :)

tqdm is in the making.

bnavigator commented 4 years ago

python-tqdm-bash-completion: Approach for the Supplements: tag in sr#845737 is a bit hacky. Maybe we need to enhance %python_module or create a new macro for this kind of rich dependency specification.

bnavigator commented 4 years ago

(and I guess Sphinx as well).

python-Sphinx is a case of #5.

bnavigator commented 4 years ago

duplicate files found by %find_lang

.. only tick off when the fix has landed in Staging:N

bnavigator commented 4 years ago
bnavigator commented 4 years ago

Duh, the new python-sip had a wrong files section header.

bnavigator commented 4 years ago

importlib_metadata is missing. Python38 provides the stdlib importlib.metadata, but python36 does need the extra package which is already provided in SLE and Leap.

bnavigator commented 4 years ago

After providing python36-importlib-metadata, pytest is usable. Some pytest runs in my branched staging:N failed because they found tests in _build.python36 --> #78

bnavigator commented 3 years ago

Additional provides of python3-othername is not enough:

bnavigator commented 3 years ago

Incorrect expansion of $python in %python_expand

mcepl commented 3 years ago

Incorrect expansion of $python in %python_expand

Could you please elaborate on what’s wrong? Is the linked SR trying to fix the problem or is it a reproducer?

bnavigator commented 3 years ago

Incorrect expansion of $python in %python_expand

Could you please elaborate on what’s wrong? Is the linked SR trying to fix the problem or is it a reproducer?

It is trying to fix the problem. Without it %configure PYTHON="/usr/bin/$python" expands to /usr/bin/usr/bin/python3.8

mcepl commented 3 years ago

It is trying to fix the problem. Without it %configure PYTHON="/usr/bin/$python" expands to /usr/bin/usr/bin/python3.8

And how many Spec files sets $PYTHON? Wouldn’t it be easier just to change them to %configure PYTHON="$python" and be done with it? I see two: python-dbus-python and gtk-doc.

bnavigator commented 3 years ago

IIRC I did not test it. But my assumption was that there is a reason the variable for %configure needs to specify the absolute filepath. Until the update for python-rpm-macros will make it out of Staging:N, $python is replaced to python3 without the bindir. $(which $python) will always return the correct absolute path, before and after the update.

mcepl commented 3 years ago

IIRC I did not test it. But my assumption was that there is a reason the variable for %configure needs to specify the absolute filepath. Until the update for python-rpm-macros will make it out of Staging:N, $python is replaced to python3 without the bindir. $(which $python) will always return the correct absolute path, before and after the update.

I see $PYTHON used only in contexts like `PYTHON_SITE_PKG=$PYTHON -c "import distutils.sysconfig; print (distutils.sysconfig.get_python_lib(0,0));"``` and then full path to the binary should work just fine.

bnavigator commented 3 years ago

full path or basename depending on correct $PATH?

bnavigator commented 3 years ago

I see two: python-dbus-python and gtk-doc.

gtk-doc does not use %python_expand. No problem there.

bnavigator commented 3 years ago

With %configure PYTHON="$python":

[   32s] + ../configure --host=x86_64-suse-linux-gnu --build=x86_64-suse-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --disable-dependency-tracking PYTHON=python3
...
[   36s] checking for python... no
[   36s] configure: error: Cannot find python in your system path
[   36s] error: Bad exit status from /var/tmp/rpm-tmp.wWaBES (%build)
[   36s] 
mcepl commented 3 years ago

OK, so you are right. Just why to both set up the environmental variable $PYTHON and do it once more on %configure command line?

bnavigator commented 3 years ago

I don't know. It was introduced here: https://build.opensuse.org/request/show/620627. @scarabeusiv maybe just forgot to remove the export?

bnavigator commented 3 years ago

python-dbus-python SR updated: https://build.opensuse.org/request/show/850243

mcepl commented 3 years ago

python-dbus-python SR updated: https://build.opensuse.org/request/show/850243

Oh, damn. I cannot approve that submit request.

bnavigator commented 3 years ago

Let's see if a maintainer from the Base:System project is willing to. This is not urgent.

mcepl commented 3 years ago

Let's see if a maintainer from the Base:System project is willing to. This is not urgent.

Well, not urgent, but not whatever … Staging:N won’t be let through without it.

bnavigator commented 3 years ago

Yeah but there will be enough other packages to fix until this is the last blocker. I don't see it being let through anytime soon.

bnavigator commented 3 years ago
bnavigator commented 3 years ago

pytest called without macro and thus importing from non-ignored _build directory with wrong flavor

bnavigator commented 3 years ago

Requires python > 3.6

bnavigator commented 3 years ago

replace %py3_compile with python_compileall

bnavigator commented 3 years ago

missing %python_expand

bnavigator commented 3 years ago
bnavigator commented 3 years ago

Failures in python 3.6 build

bnavigator commented 3 years ago

Use of python3 flavor

bnavigator commented 3 years ago

Fix by update or removal of unnecessary BuildRequirements

bnavigator commented 3 years ago

Requires python > 3.6

bnavigator commented 3 years ago

Missing dependency to libsqlite now:

I am working on this, but it is BS … nobody should ever need pysqlite2 ever (when sqlite3 is in the standard library). I will need to investigate it more on Monday. -- @mcepl