openSUSE / opi

OBS Package Installer (CLI)
GNU General Public License v3.0
244 stars 22 forks source link

What is the minimum python version required? #147

Closed ecsgh closed 1 year ago

ecsgh commented 1 year ago

I can't find a definition of this in the sources. And the built version in utilities for 15.5 does not work.

nobkd commented 1 year ago

Just, if it helps, the tests use the python3 package

ecsgh commented 1 year ago

Unfortunately not really. Because Python stands in Leap, if I know it correctly, for python 3.6 and inTumbleweed for Python 3.10 or 3.11.

asdil12 commented 1 year ago

hm - in which way does it 'not work'?

I can't actually reproduce the issue:

podman run -it --rm opensuse/leap:15.5
zypper in opi
opi --version
# use opi to install opi from utilities repo
opi opi
opi --version
# python3 --version
Python 3.6.15
ecsgh commented 1 year ago

opi --version still works without errors. But if you search for a package the error appears.

And why is it so hard to say which is the minimum required Python version?

nobkd commented 1 year ago

Are you running opi with sudo?

Are you able to provide the error log?

Because as far as I see theoretically all python 3 versions should work.

ecsgh commented 1 year ago

Why should i run with sudo? Never.

opi is from repo utilities.

opi firefox Pick a number (0 to quit): 1 You have selected package name: MozillaFirefox Traceback (most recent call last): File "/usr/bin/opi", line 92, in binaries = opi.search_local_repos(selected_name) + binaries File "/usr/lib/python3.6/site-packages/opi/init.py", line 165, in search_local_repos installable['repository'] = repos_by_name[repo_name] KeyError: 'repositories:mozilla 15.5'

asdil12 commented 1 year ago

And why is it so hard to say which is the minimum required Python version?

I actually don't know exactly. I simply run the testsuite for latest leap and tumbleweed. As it passes for Leap15.5 shipping python3.6, I would expect it to work for python >=3.6.

asdil12 commented 1 year ago

The stack trace indicates that this is not an issue with the python version but there seems to be a bug in opi (>=3.x.x I guess) that is triggered by a repo that is enabled on your local system. Could you send me the output of zypper lr -u as well as the content of the .repo file (in /etc/zypp/repos.d) for the repo that this error refers to ('repositories:mozilla 15.5' - I guess the file has mozilla in its name).

ecsgh commented 1 year ago

zypper lr: Alias | Name | Enabled | GPG Check |Refresh ... repositories_mozilla | repositories:mozilla 15.5 | Ja | (r ) Ja | Ja

Content of mozilla.repo: [repositories_mozilla] name=repositories:mozilla $releasever enabled=1 autorefresh=1 baseurl=https://download.opensuse.org/repositories/mozilla/openSUSE_Leap_$releasever/ path=/ type=rpm-md keeppackages=0

But one more note. This is not the only repo where the error occurs.

asdil12 commented 1 year ago

I can reproduce the issue. I'm pretty sure that the $releasever in the name field is what opi can't deal with at the moment.

ecsgh commented 1 year ago

I have now done my own research.

It is the line: name=repositories:mozilla $releasever And here at the character $. With the old opi version it works. With the 3er however not.

asdil12 commented 1 year ago

Yes - that is because with opi 3 the local repos will be searched as well. opi version 2 doesn't have this feature yet.

ecsgh commented 1 year ago

Ah okay. With your change es patch for 3.4.0 opi runs without error. Thank you.